(FPCore (x y z) :precision binary64 (- (+ (+ (acos x) (acos y)) (acos z)) PI))
(FPCore (x y z) :precision binary64 (+ (acos x) (+ (acos z) (- (acos y) PI))))
double code(double x, double y, double z) { return ((acos(x) + acos(y)) + acos(z)) - ((double) M_PI); }
double code(double x, double y, double z) { return acos(x) + (acos(z) + (acos(y) - ((double) M_PI))); }
public static double code(double x, double y, double z) { return ((Math.acos(x) + Math.acos(y)) + Math.acos(z)) - Math.PI; }
public static double code(double x, double y, double z) { return Math.acos(x) + (Math.acos(z) + (Math.acos(y) - Math.PI)); }
def code(x, y, z): return ((math.acos(x) + math.acos(y)) + math.acos(z)) - math.pi
def code(x, y, z): return math.acos(x) + (math.acos(z) + (math.acos(y) - math.pi))
function code(x, y, z) return Float64(Float64(Float64(acos(x) + acos(y)) + acos(z)) - pi) end
function code(x, y, z) return Float64(acos(x) + Float64(acos(z) + Float64(acos(y) - pi))) end
function tmp = code(x, y, z) tmp = ((acos(x) + acos(y)) + acos(z)) - pi; end
function tmp = code(x, y, z) tmp = acos(x) + (acos(z) + (acos(y) - pi)); end
code[x_, y_, z_] := N[(N[(N[(N[ArcCos[x], $MachinePrecision] + N[ArcCos[y], $MachinePrecision]), $MachinePrecision] + N[ArcCos[z], $MachinePrecision]), $MachinePrecision] - Pi), $MachinePrecision]
code[x_, y_, z_] := N[(N[ArcCos[x], $MachinePrecision] + N[(N[ArcCos[z], $MachinePrecision] + N[(N[ArcCos[y], $MachinePrecision] - Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\cos^{-1} x + \cos^{-1} y\right) + \cos^{-1} z\right) - \pi
\cos^{-1} x + \left(\cos^{-1} z + \left(\cos^{-1} y - \pi\right)\right)
Results
Initial program 0.1
Simplified0.0
[Start]0.1 | \[ \left(\left(\cos^{-1} x + \cos^{-1} y\right) + \cos^{-1} z\right) - \pi
\] |
---|---|
associate-+l+ [=>]0.1 | \[ \color{blue}{\left(\cos^{-1} x + \left(\cos^{-1} y + \cos^{-1} z\right)\right)} - \pi
\] |
associate--l+ [=>]0.1 | \[ \color{blue}{\cos^{-1} x + \left(\left(\cos^{-1} y + \cos^{-1} z\right) - \pi\right)}
\] |
+-commutative [=>]0.1 | \[ \cos^{-1} x + \left(\color{blue}{\left(\cos^{-1} z + \cos^{-1} y\right)} - \pi\right)
\] |
associate--l+ [=>]0.0 | \[ \cos^{-1} x + \color{blue}{\left(\cos^{-1} z + \left(\cos^{-1} y - \pi\right)\right)}
\] |
Final simplification0.0
herbie shell --seed 1
(FPCore (x y z)
:name "acos(x)+acos(y)+acos(z)-PI"
:precision binary64
:pre (and (and (and (<= -1.0 x) (<= x 1.0)) (and (<= -1.0 y) (<= y 1.0))) (and (<= -1.0 z) (<= z 1.0)))
(- (+ (+ (acos x) (acos y)) (acos z)) PI))