From bc5de6bb658cb62a272403a22f04f2f883823910 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 2 Feb 1990 17:25:50 +0000 Subject: [PATCH] New definition of `complex:acos' preserves more precision and is more efficient. This one also does not introduce inexact real or imaginary zero components in certain (important) boundary cases, such as: (acos 2) ;Value: 0.+1.3169578969248166i --- v7/src/runtime/arith.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/v7/src/runtime/arith.scm b/v7/src/runtime/arith.scm index 09c6c099a..f2dae1041 100644 --- a/v7/src/runtime/arith.scm +++ b/v7/src/runtime/arith.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/arith.scm,v 1.13 1990/01/11 01:01:44 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/arith.scm,v 1.14 1990/02/02 17:25:50 cph Exp $ -Copyright (c) 1989 Massachusetts Institute of Technology +Copyright (c) 1989, 1990 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -1396,7 +1396,11 @@ MIT in each case. |# (if (or (recnum? z) (real:< z -1) (real:< 1 z)) - (complex:- rec:pi/2 (complex:asin z)) + (complex:-i* + (complex:log + (complex:+ z + (complex:+i* + (complex:sqrt (complex:- 1 (complex:* z z))))))) ((copy real:acos) z))) (define (complex:atan z) -- 2.25.1