
(FPCore (x y z) :precision binary64 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z): return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z) return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0)) end
function tmp = code(x, y, z) tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0); end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z): return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z) return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0)) end
function tmp = code(x, y, z) tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0); end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}
(FPCore (x y z) :precision binary64 (* (- (* (/ (- z x) y) (+ x z)) y) -0.5))
double code(double x, double y, double z) {
return ((((z - x) / y) * (x + z)) - y) * -0.5;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((z - x) / y) * (x + z)) - y) * (-0.5d0)
end function
public static double code(double x, double y, double z) {
return ((((z - x) / y) * (x + z)) - y) * -0.5;
}
def code(x, y, z): return ((((z - x) / y) * (x + z)) - y) * -0.5
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(z - x) / y) * Float64(x + z)) - y) * -0.5) end
function tmp = code(x, y, z) tmp = ((((z - x) / y) * (x + z)) - y) * -0.5; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(z - x), $MachinePrecision] / y), $MachinePrecision] * N[(x + z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] * -0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{z - x}{y} \cdot \left(x + z\right) - y\right) \cdot -0.5
\end{array}
Initial program 71.5%
sub-neg71.5%
+-commutative71.5%
neg-sub071.5%
associate-+l-71.5%
sub0-neg71.5%
neg-mul-171.5%
*-commutative71.5%
times-frac71.5%
associate--r+71.5%
div-sub71.5%
difference-of-squares76.7%
+-commutative76.7%
associate-*r/78.7%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= (* x x) 2e-209)
(/ -0.5 (/ (/ y z) z))
(if (<= (* x x) 5e-156)
(* y 0.5)
(if (<= (* x x) 1e-73)
(/ (* -0.5 (* z z)) y)
(if (<= (* x x) 1e+72) (* y 0.5) (* 0.5 (/ x (/ y x))))))))
double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 2e-209) {
tmp = -0.5 / ((y / z) / z);
} else if ((x * x) <= 5e-156) {
tmp = y * 0.5;
} else if ((x * x) <= 1e-73) {
tmp = (-0.5 * (z * z)) / y;
} else if ((x * x) <= 1e+72) {
tmp = y * 0.5;
} else {
tmp = 0.5 * (x / (y / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * x) <= 2d-209) then
tmp = (-0.5d0) / ((y / z) / z)
else if ((x * x) <= 5d-156) then
tmp = y * 0.5d0
else if ((x * x) <= 1d-73) then
tmp = ((-0.5d0) * (z * z)) / y
else if ((x * x) <= 1d+72) then
tmp = y * 0.5d0
else
tmp = 0.5d0 * (x / (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 2e-209) {
tmp = -0.5 / ((y / z) / z);
} else if ((x * x) <= 5e-156) {
tmp = y * 0.5;
} else if ((x * x) <= 1e-73) {
tmp = (-0.5 * (z * z)) / y;
} else if ((x * x) <= 1e+72) {
tmp = y * 0.5;
} else {
tmp = 0.5 * (x / (y / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x * x) <= 2e-209: tmp = -0.5 / ((y / z) / z) elif (x * x) <= 5e-156: tmp = y * 0.5 elif (x * x) <= 1e-73: tmp = (-0.5 * (z * z)) / y elif (x * x) <= 1e+72: tmp = y * 0.5 else: tmp = 0.5 * (x / (y / x)) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(x * x) <= 2e-209) tmp = Float64(-0.5 / Float64(Float64(y / z) / z)); elseif (Float64(x * x) <= 5e-156) tmp = Float64(y * 0.5); elseif (Float64(x * x) <= 1e-73) tmp = Float64(Float64(-0.5 * Float64(z * z)) / y); elseif (Float64(x * x) <= 1e+72) tmp = Float64(y * 0.5); else tmp = Float64(0.5 * Float64(x / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x * x) <= 2e-209) tmp = -0.5 / ((y / z) / z); elseif ((x * x) <= 5e-156) tmp = y * 0.5; elseif ((x * x) <= 1e-73) tmp = (-0.5 * (z * z)) / y; elseif ((x * x) <= 1e+72) tmp = y * 0.5; else tmp = 0.5 * (x / (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(x * x), $MachinePrecision], 2e-209], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 5e-156], N[(y * 0.5), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1e-73], N[(N[(-0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 1e+72], N[(y * 0.5), $MachinePrecision], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-209}:\\
\;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{-156}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;x \cdot x \leq 10^{-73}:\\
\;\;\;\;\frac{-0.5 \cdot \left(z \cdot z\right)}{y}\\
\mathbf{elif}\;x \cdot x \leq 10^{+72}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\end{array}
\end{array}
if (*.f64 x x) < 2.0000000000000001e-209Initial program 72.3%
Taylor expanded in z around inf 56.5%
unpow256.5%
associate-*r/56.5%
Simplified56.5%
clear-num56.5%
inv-pow56.5%
*-un-lft-identity56.5%
times-frac56.5%
metadata-eval56.5%
Applied egg-rr56.5%
unpow-156.5%
associate-/r*56.5%
metadata-eval56.5%
associate-/r*57.7%
Simplified57.7%
if 2.0000000000000001e-209 < (*.f64 x x) < 5.00000000000000007e-156 or 9.99999999999999997e-74 < (*.f64 x x) < 9.99999999999999944e71Initial program 61.3%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if 5.00000000000000007e-156 < (*.f64 x x) < 9.99999999999999997e-74Initial program 95.0%
Taylor expanded in z around inf 71.0%
unpow271.0%
associate-*r/71.0%
Simplified71.0%
if 9.99999999999999944e71 < (*.f64 x x) Initial program 70.4%
Taylor expanded in x around inf 62.3%
unpow262.3%
Simplified62.3%
Taylor expanded in x around 0 62.3%
unpow262.3%
*-commutative62.3%
associate-/l*67.3%
Simplified67.3%
Final simplification64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* x (/ 0.5 y)))))
(if (<= x -2.4e+79)
t_0
(if (<= x -3.55e-37)
(* y 0.5)
(if (<= x 3.5e-105)
(* z (/ (* z -0.5) y))
(if (<= x 4.1e+30) (* y 0.5) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (x * (0.5 / y));
double tmp;
if (x <= -2.4e+79) {
tmp = t_0;
} else if (x <= -3.55e-37) {
tmp = y * 0.5;
} else if (x <= 3.5e-105) {
tmp = z * ((z * -0.5) / y);
} else if (x <= 4.1e+30) {
tmp = y * 0.5;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (x * (0.5d0 / y))
if (x <= (-2.4d+79)) then
tmp = t_0
else if (x <= (-3.55d-37)) then
tmp = y * 0.5d0
else if (x <= 3.5d-105) then
tmp = z * ((z * (-0.5d0)) / y)
else if (x <= 4.1d+30) then
tmp = y * 0.5d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (x * (0.5 / y));
double tmp;
if (x <= -2.4e+79) {
tmp = t_0;
} else if (x <= -3.55e-37) {
tmp = y * 0.5;
} else if (x <= 3.5e-105) {
tmp = z * ((z * -0.5) / y);
} else if (x <= 4.1e+30) {
tmp = y * 0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (x * (0.5 / y)) tmp = 0 if x <= -2.4e+79: tmp = t_0 elif x <= -3.55e-37: tmp = y * 0.5 elif x <= 3.5e-105: tmp = z * ((z * -0.5) / y) elif x <= 4.1e+30: tmp = y * 0.5 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(x * Float64(0.5 / y))) tmp = 0.0 if (x <= -2.4e+79) tmp = t_0; elseif (x <= -3.55e-37) tmp = Float64(y * 0.5); elseif (x <= 3.5e-105) tmp = Float64(z * Float64(Float64(z * -0.5) / y)); elseif (x <= 4.1e+30) tmp = Float64(y * 0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (x * (0.5 / y)); tmp = 0.0; if (x <= -2.4e+79) tmp = t_0; elseif (x <= -3.55e-37) tmp = y * 0.5; elseif (x <= 3.5e-105) tmp = z * ((z * -0.5) / y); elseif (x <= 4.1e+30) tmp = y * 0.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+79], t$95$0, If[LessEqual[x, -3.55e-37], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 3.5e-105], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e+30], N[(y * 0.5), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.55 \cdot 10^{-37}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-105}:\\
\;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+30}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.39999999999999986e79 or 4.10000000000000005e30 < x Initial program 70.5%
Taylor expanded in x around inf 63.1%
unpow263.1%
Simplified63.1%
times-frac68.2%
div-inv68.2%
metadata-eval68.2%
Applied egg-rr68.2%
Taylor expanded in x around 0 63.1%
*-commutative63.1%
unpow263.1%
associate-*r/68.2%
associate-*r*68.2%
associate-*l/68.2%
*-lft-identity68.2%
times-frac68.1%
/-rgt-identity68.1%
Simplified68.1%
if -2.39999999999999986e79 < x < -3.54999999999999989e-37 or 3.5e-105 < x < 4.10000000000000005e30Initial program 66.9%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -3.54999999999999989e-37 < x < 3.5e-105Initial program 74.9%
Taylor expanded in z around inf 59.0%
unpow259.0%
associate-*r/59.0%
Simplified59.0%
Taylor expanded in z around 0 59.0%
unpow259.0%
metadata-eval59.0%
times-frac59.0%
*-commutative59.0%
associate-*l*59.0%
*-commutative59.0%
times-frac60.0%
/-rgt-identity60.0%
*-commutative60.0%
Simplified60.0%
Final simplification63.4%
(FPCore (x y z)
:precision binary64
(if (<= x -3.4e+79)
(* (/ x y) (* x 0.5))
(if (<= x -3e-38)
(* y 0.5)
(if (<= x 6.5e-105)
(* z (/ (* z -0.5) y))
(if (<= x 1.1e+28) (* y 0.5) (* x (* x (/ 0.5 y))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e+79) {
tmp = (x / y) * (x * 0.5);
} else if (x <= -3e-38) {
tmp = y * 0.5;
} else if (x <= 6.5e-105) {
tmp = z * ((z * -0.5) / y);
} else if (x <= 1.1e+28) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d+79)) then
tmp = (x / y) * (x * 0.5d0)
else if (x <= (-3d-38)) then
tmp = y * 0.5d0
else if (x <= 6.5d-105) then
tmp = z * ((z * (-0.5d0)) / y)
else if (x <= 1.1d+28) then
tmp = y * 0.5d0
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e+79) {
tmp = (x / y) * (x * 0.5);
} else if (x <= -3e-38) {
tmp = y * 0.5;
} else if (x <= 6.5e-105) {
tmp = z * ((z * -0.5) / y);
} else if (x <= 1.1e+28) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e+79: tmp = (x / y) * (x * 0.5) elif x <= -3e-38: tmp = y * 0.5 elif x <= 6.5e-105: tmp = z * ((z * -0.5) / y) elif x <= 1.1e+28: tmp = y * 0.5 else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e+79) tmp = Float64(Float64(x / y) * Float64(x * 0.5)); elseif (x <= -3e-38) tmp = Float64(y * 0.5); elseif (x <= 6.5e-105) tmp = Float64(z * Float64(Float64(z * -0.5) / y)); elseif (x <= 1.1e+28) tmp = Float64(y * 0.5); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e+79) tmp = (x / y) * (x * 0.5); elseif (x <= -3e-38) tmp = y * 0.5; elseif (x <= 6.5e-105) tmp = z * ((z * -0.5) / y); elseif (x <= 1.1e+28) tmp = y * 0.5; else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e+79], N[(N[(x / y), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e-38], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 6.5e-105], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e+28], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{y} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-38}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-105}:\\
\;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+28}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if x < -3.40000000000000032e79Initial program 73.3%
Taylor expanded in x around inf 69.0%
unpow269.0%
Simplified69.0%
times-frac74.4%
div-inv74.4%
metadata-eval74.4%
Applied egg-rr74.4%
if -3.40000000000000032e79 < x < -2.99999999999999989e-38 or 6.50000000000000006e-105 < x < 1.09999999999999993e28Initial program 66.9%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -2.99999999999999989e-38 < x < 6.50000000000000006e-105Initial program 74.9%
Taylor expanded in z around inf 59.0%
unpow259.0%
associate-*r/59.0%
Simplified59.0%
Taylor expanded in z around 0 59.0%
unpow259.0%
metadata-eval59.0%
times-frac59.0%
*-commutative59.0%
associate-*l*59.0%
*-commutative59.0%
times-frac60.0%
/-rgt-identity60.0%
*-commutative60.0%
Simplified60.0%
if 1.09999999999999993e28 < x Initial program 68.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
times-frac63.4%
div-inv63.4%
metadata-eval63.4%
Applied egg-rr63.4%
Taylor expanded in x around 0 58.6%
*-commutative58.6%
unpow258.6%
associate-*r/63.4%
associate-*r*63.4%
associate-*l/63.4%
*-lft-identity63.4%
times-frac63.4%
/-rgt-identity63.4%
Simplified63.4%
Final simplification63.4%
(FPCore (x y z)
:precision binary64
(if (<= x -2.2e+79)
(* 0.5 (/ x (/ y x)))
(if (<= x -8.8e-39)
(* y 0.5)
(if (<= x 5.7e-105)
(* z (/ (* z -0.5) y))
(if (<= x 1.8e+30) (* y 0.5) (* x (* x (/ 0.5 y))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.2e+79) {
tmp = 0.5 * (x / (y / x));
} else if (x <= -8.8e-39) {
tmp = y * 0.5;
} else if (x <= 5.7e-105) {
tmp = z * ((z * -0.5) / y);
} else if (x <= 1.8e+30) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.2d+79)) then
tmp = 0.5d0 * (x / (y / x))
else if (x <= (-8.8d-39)) then
tmp = y * 0.5d0
else if (x <= 5.7d-105) then
tmp = z * ((z * (-0.5d0)) / y)
else if (x <= 1.8d+30) then
tmp = y * 0.5d0
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.2e+79) {
tmp = 0.5 * (x / (y / x));
} else if (x <= -8.8e-39) {
tmp = y * 0.5;
} else if (x <= 5.7e-105) {
tmp = z * ((z * -0.5) / y);
} else if (x <= 1.8e+30) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.2e+79: tmp = 0.5 * (x / (y / x)) elif x <= -8.8e-39: tmp = y * 0.5 elif x <= 5.7e-105: tmp = z * ((z * -0.5) / y) elif x <= 1.8e+30: tmp = y * 0.5 else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.2e+79) tmp = Float64(0.5 * Float64(x / Float64(y / x))); elseif (x <= -8.8e-39) tmp = Float64(y * 0.5); elseif (x <= 5.7e-105) tmp = Float64(z * Float64(Float64(z * -0.5) / y)); elseif (x <= 1.8e+30) tmp = Float64(y * 0.5); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.2e+79) tmp = 0.5 * (x / (y / x)); elseif (x <= -8.8e-39) tmp = y * 0.5; elseif (x <= 5.7e-105) tmp = z * ((z * -0.5) / y); elseif (x <= 1.8e+30) tmp = y * 0.5; else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.2e+79], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.8e-39], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 5.7e-105], N[(z * N[(N[(z * -0.5), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e+30], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+79}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-39}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{-105}:\\
\;\;\;\;z \cdot \frac{z \cdot -0.5}{y}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+30}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if x < -2.1999999999999999e79Initial program 73.3%
Taylor expanded in x around inf 69.0%
unpow269.0%
Simplified69.0%
Taylor expanded in x around 0 69.0%
unpow269.0%
*-commutative69.0%
associate-/l*74.5%
Simplified74.5%
if -2.1999999999999999e79 < x < -8.80000000000000003e-39 or 5.69999999999999963e-105 < x < 1.8000000000000001e30Initial program 66.9%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -8.80000000000000003e-39 < x < 5.69999999999999963e-105Initial program 74.9%
Taylor expanded in z around inf 59.0%
unpow259.0%
associate-*r/59.0%
Simplified59.0%
Taylor expanded in z around 0 59.0%
unpow259.0%
metadata-eval59.0%
times-frac59.0%
*-commutative59.0%
associate-*l*59.0%
*-commutative59.0%
times-frac60.0%
/-rgt-identity60.0%
*-commutative60.0%
Simplified60.0%
if 1.8000000000000001e30 < x Initial program 68.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
times-frac63.4%
div-inv63.4%
metadata-eval63.4%
Applied egg-rr63.4%
Taylor expanded in x around 0 58.6%
*-commutative58.6%
unpow258.6%
associate-*r/63.4%
associate-*r*63.4%
associate-*l/63.4%
*-lft-identity63.4%
times-frac63.4%
/-rgt-identity63.4%
Simplified63.4%
Final simplification63.5%
(FPCore (x y z)
:precision binary64
(if (<= x -1.5e+79)
(* 0.5 (/ x (/ y x)))
(if (<= x -6.5e-40)
(* y 0.5)
(if (<= x 4.1e-105)
(/ -0.5 (/ (/ y z) z))
(if (<= x 6.2e+26) (* y 0.5) (* x (* x (/ 0.5 y))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e+79) {
tmp = 0.5 * (x / (y / x));
} else if (x <= -6.5e-40) {
tmp = y * 0.5;
} else if (x <= 4.1e-105) {
tmp = -0.5 / ((y / z) / z);
} else if (x <= 6.2e+26) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.5d+79)) then
tmp = 0.5d0 * (x / (y / x))
else if (x <= (-6.5d-40)) then
tmp = y * 0.5d0
else if (x <= 4.1d-105) then
tmp = (-0.5d0) / ((y / z) / z)
else if (x <= 6.2d+26) then
tmp = y * 0.5d0
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e+79) {
tmp = 0.5 * (x / (y / x));
} else if (x <= -6.5e-40) {
tmp = y * 0.5;
} else if (x <= 4.1e-105) {
tmp = -0.5 / ((y / z) / z);
} else if (x <= 6.2e+26) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.5e+79: tmp = 0.5 * (x / (y / x)) elif x <= -6.5e-40: tmp = y * 0.5 elif x <= 4.1e-105: tmp = -0.5 / ((y / z) / z) elif x <= 6.2e+26: tmp = y * 0.5 else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.5e+79) tmp = Float64(0.5 * Float64(x / Float64(y / x))); elseif (x <= -6.5e-40) tmp = Float64(y * 0.5); elseif (x <= 4.1e-105) tmp = Float64(-0.5 / Float64(Float64(y / z) / z)); elseif (x <= 6.2e+26) tmp = Float64(y * 0.5); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.5e+79) tmp = 0.5 * (x / (y / x)); elseif (x <= -6.5e-40) tmp = y * 0.5; elseif (x <= 4.1e-105) tmp = -0.5 / ((y / z) / z); elseif (x <= 6.2e+26) tmp = y * 0.5; else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.5e+79], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5e-40], N[(y * 0.5), $MachinePrecision], If[LessEqual[x, 4.1e-105], N[(-0.5 / N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e+26], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+79}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-40}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{-0.5}{\frac{\frac{y}{z}}{z}}\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+26}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if x < -1.49999999999999987e79Initial program 73.3%
Taylor expanded in x around inf 69.0%
unpow269.0%
Simplified69.0%
Taylor expanded in x around 0 69.0%
unpow269.0%
*-commutative69.0%
associate-/l*74.5%
Simplified74.5%
if -1.49999999999999987e79 < x < -6.4999999999999999e-40 or 4.1000000000000003e-105 < x < 6.1999999999999999e26Initial program 66.9%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if -6.4999999999999999e-40 < x < 4.1000000000000003e-105Initial program 74.9%
Taylor expanded in z around inf 59.0%
unpow259.0%
associate-*r/59.0%
Simplified59.0%
clear-num59.0%
inv-pow59.0%
*-un-lft-identity59.0%
times-frac59.0%
metadata-eval59.0%
Applied egg-rr59.0%
unpow-159.0%
associate-/r*59.0%
metadata-eval59.0%
associate-/r*60.0%
Simplified60.0%
if 6.1999999999999999e26 < x Initial program 68.3%
Taylor expanded in x around inf 58.6%
unpow258.6%
Simplified58.6%
times-frac63.4%
div-inv63.4%
metadata-eval63.4%
Applied egg-rr63.4%
Taylor expanded in x around 0 58.6%
*-commutative58.6%
unpow258.6%
associate-*r/63.4%
associate-*r*63.4%
associate-*l/63.4%
*-lft-identity63.4%
times-frac63.4%
/-rgt-identity63.4%
Simplified63.4%
Final simplification63.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.05e+21) (not (<= y 7.8e+68))) (* -0.5 (- (* x (/ (- x) y)) y)) (* 0.5 (* (+ x z) (/ (- x z) y)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.05e+21) || !(y <= 7.8e+68)) {
tmp = -0.5 * ((x * (-x / y)) - y);
} else {
tmp = 0.5 * ((x + z) * ((x - z) / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.05d+21)) .or. (.not. (y <= 7.8d+68))) then
tmp = (-0.5d0) * ((x * (-x / y)) - y)
else
tmp = 0.5d0 * ((x + z) * ((x - z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.05e+21) || !(y <= 7.8e+68)) {
tmp = -0.5 * ((x * (-x / y)) - y);
} else {
tmp = 0.5 * ((x + z) * ((x - z) / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.05e+21) or not (y <= 7.8e+68): tmp = -0.5 * ((x * (-x / y)) - y) else: tmp = 0.5 * ((x + z) * ((x - z) / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.05e+21) || !(y <= 7.8e+68)) tmp = Float64(-0.5 * Float64(Float64(x * Float64(Float64(-x) / y)) - y)); else tmp = Float64(0.5 * Float64(Float64(x + z) * Float64(Float64(x - z) / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.05e+21) || ~((y <= 7.8e+68))) tmp = -0.5 * ((x * (-x / y)) - y); else tmp = 0.5 * ((x + z) * ((x - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.05e+21], N[Not[LessEqual[y, 7.8e+68]], $MachinePrecision]], N[(-0.5 * N[(N[(x * N[((-x) / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + z), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+21} \lor \neg \left(y \leq 7.8 \cdot 10^{+68}\right):\\
\;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(x + z\right) \cdot \frac{x - z}{y}\right)\\
\end{array}
\end{array}
if y < -1.05e21 or 7.80000000000000037e68 < y Initial program 42.2%
sub-neg42.2%
+-commutative42.2%
neg-sub042.2%
associate-+l-42.2%
sub0-neg42.2%
neg-mul-142.2%
*-commutative42.2%
times-frac42.2%
associate--r+42.2%
div-sub42.2%
difference-of-squares46.2%
+-commutative46.2%
associate-*r/50.2%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
flip-+76.6%
frac-times52.6%
Applied egg-rr52.6%
associate-/l*62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in z around 0 77.8%
mul-1-neg77.8%
unpow277.8%
associate-*l/88.9%
distribute-rgt-neg-out88.9%
Simplified88.9%
if -1.05e21 < y < 7.80000000000000037e68Initial program 92.6%
Taylor expanded in y around 0 90.0%
unpow290.0%
unpow290.0%
difference-of-squares96.1%
associate-/l*96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 96.1%
*-commutative96.1%
associate-*r/96.7%
Simplified96.7%
Final simplification93.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -9.6e+20) (not (<= y 3.3e+68))) (* -0.5 (- (* x (/ (- x) y)) y)) (* 0.5 (/ (+ x z) (/ y (- x z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9.6e+20) || !(y <= 3.3e+68)) {
tmp = -0.5 * ((x * (-x / y)) - y);
} else {
tmp = 0.5 * ((x + z) / (y / (x - z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-9.6d+20)) .or. (.not. (y <= 3.3d+68))) then
tmp = (-0.5d0) * ((x * (-x / y)) - y)
else
tmp = 0.5d0 * ((x + z) / (y / (x - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9.6e+20) || !(y <= 3.3e+68)) {
tmp = -0.5 * ((x * (-x / y)) - y);
} else {
tmp = 0.5 * ((x + z) / (y / (x - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9.6e+20) or not (y <= 3.3e+68): tmp = -0.5 * ((x * (-x / y)) - y) else: tmp = 0.5 * ((x + z) / (y / (x - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9.6e+20) || !(y <= 3.3e+68)) tmp = Float64(-0.5 * Float64(Float64(x * Float64(Float64(-x) / y)) - y)); else tmp = Float64(0.5 * Float64(Float64(x + z) / Float64(y / Float64(x - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9.6e+20) || ~((y <= 3.3e+68))) tmp = -0.5 * ((x * (-x / y)) - y); else tmp = 0.5 * ((x + z) / (y / (x - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.6e+20], N[Not[LessEqual[y, 3.3e+68]], $MachinePrecision]], N[(-0.5 * N[(N[(x * N[((-x) / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + z), $MachinePrecision] / N[(y / N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+20} \lor \neg \left(y \leq 3.3 \cdot 10^{+68}\right):\\
\;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + z}{\frac{y}{x - z}}\\
\end{array}
\end{array}
if y < -9.6e20 or 3.3e68 < y Initial program 42.2%
sub-neg42.2%
+-commutative42.2%
neg-sub042.2%
associate-+l-42.2%
sub0-neg42.2%
neg-mul-142.2%
*-commutative42.2%
times-frac42.2%
associate--r+42.2%
div-sub42.2%
difference-of-squares46.2%
+-commutative46.2%
associate-*r/50.2%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
flip-+76.6%
frac-times52.6%
Applied egg-rr52.6%
associate-/l*62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in z around 0 77.8%
mul-1-neg77.8%
unpow277.8%
associate-*l/88.9%
distribute-rgt-neg-out88.9%
Simplified88.9%
if -9.6e20 < y < 3.3e68Initial program 92.6%
Taylor expanded in y around 0 90.0%
unpow290.0%
unpow290.0%
difference-of-squares96.1%
associate-/l*96.7%
+-commutative96.7%
Simplified96.7%
Final simplification93.4%
(FPCore (x y z) :precision binary64 (if (<= (* x x) 1e+72) (* -0.5 (- (/ z (/ y z)) y)) (* -0.5 (- (* x (/ (- x) y)) y))))
double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 1e+72) {
tmp = -0.5 * ((z / (y / z)) - y);
} else {
tmp = -0.5 * ((x * (-x / y)) - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * x) <= 1d+72) then
tmp = (-0.5d0) * ((z / (y / z)) - y)
else
tmp = (-0.5d0) * ((x * (-x / y)) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 1e+72) {
tmp = -0.5 * ((z / (y / z)) - y);
} else {
tmp = -0.5 * ((x * (-x / y)) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x * x) <= 1e+72: tmp = -0.5 * ((z / (y / z)) - y) else: tmp = -0.5 * ((x * (-x / y)) - y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(x * x) <= 1e+72) tmp = Float64(-0.5 * Float64(Float64(z / Float64(y / z)) - y)); else tmp = Float64(-0.5 * Float64(Float64(x * Float64(Float64(-x) / y)) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x * x) <= 1e+72) tmp = -0.5 * ((z / (y / z)) - y); else tmp = -0.5 * ((x * (-x / y)) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e+72], N[(-0.5 * N[(N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(x * N[((-x) / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{+72}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(x \cdot \frac{-x}{y} - y\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 9.99999999999999944e71Initial program 72.5%
sub-neg72.5%
+-commutative72.5%
neg-sub072.5%
associate-+l-72.5%
sub0-neg72.5%
neg-mul-172.5%
*-commutative72.5%
times-frac72.5%
associate--r+72.5%
div-sub72.5%
difference-of-squares72.5%
+-commutative72.5%
associate-*r/73.5%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 87.6%
unpow287.6%
associate-/l*92.7%
Simplified92.7%
if 9.99999999999999944e71 < (*.f64 x x) Initial program 70.4%
sub-neg70.4%
+-commutative70.4%
neg-sub070.4%
associate-+l-70.4%
sub0-neg70.4%
neg-mul-170.4%
*-commutative70.4%
times-frac70.4%
associate--r+70.4%
div-sub70.4%
difference-of-squares81.4%
+-commutative81.4%
associate-*r/84.5%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
flip-+77.5%
frac-times61.5%
Applied egg-rr61.5%
associate-/l*68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in z around 0 72.0%
mul-1-neg72.0%
unpow272.0%
associate-*l/81.8%
distribute-rgt-neg-out81.8%
Simplified81.8%
Final simplification87.5%
(FPCore (x y z) :precision binary64 (if (<= (* x x) 1e+72) (* -0.5 (- (/ z (/ y z)) y)) (* -0.5 (- (/ (- x) (/ y x)) y))))
double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 1e+72) {
tmp = -0.5 * ((z / (y / z)) - y);
} else {
tmp = -0.5 * ((-x / (y / x)) - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * x) <= 1d+72) then
tmp = (-0.5d0) * ((z / (y / z)) - y)
else
tmp = (-0.5d0) * ((-x / (y / x)) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 1e+72) {
tmp = -0.5 * ((z / (y / z)) - y);
} else {
tmp = -0.5 * ((-x / (y / x)) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x * x) <= 1e+72: tmp = -0.5 * ((z / (y / z)) - y) else: tmp = -0.5 * ((-x / (y / x)) - y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(x * x) <= 1e+72) tmp = Float64(-0.5 * Float64(Float64(z / Float64(y / z)) - y)); else tmp = Float64(-0.5 * Float64(Float64(Float64(-x) / Float64(y / x)) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x * x) <= 1e+72) tmp = -0.5 * ((z / (y / z)) - y); else tmp = -0.5 * ((-x / (y / x)) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e+72], N[(-0.5 * N[(N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[((-x) / N[(y / x), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{+72}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\frac{-x}{\frac{y}{x}} - y\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 9.99999999999999944e71Initial program 72.5%
sub-neg72.5%
+-commutative72.5%
neg-sub072.5%
associate-+l-72.5%
sub0-neg72.5%
neg-mul-172.5%
*-commutative72.5%
times-frac72.5%
associate--r+72.5%
div-sub72.5%
difference-of-squares72.5%
+-commutative72.5%
associate-*r/73.5%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 87.6%
unpow287.6%
associate-/l*92.7%
Simplified92.7%
if 9.99999999999999944e71 < (*.f64 x x) Initial program 70.4%
sub-neg70.4%
+-commutative70.4%
neg-sub070.4%
associate-+l-70.4%
sub0-neg70.4%
neg-mul-170.4%
*-commutative70.4%
times-frac70.4%
associate--r+70.4%
div-sub70.4%
difference-of-squares81.4%
+-commutative81.4%
associate-*r/84.5%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 72.0%
mul-1-neg72.0%
unpow272.0%
associate-/l*81.8%
distribute-neg-frac81.8%
Simplified81.8%
Final simplification87.5%
(FPCore (x y z) :precision binary64 (if (<= x -1.46e+80) (* 0.5 (/ x (/ y x))) (if (<= x 1.3e+128) (* -0.5 (- (* z (/ z y)) y)) (* x (* x (/ 0.5 y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.46e+80) {
tmp = 0.5 * (x / (y / x));
} else if (x <= 1.3e+128) {
tmp = -0.5 * ((z * (z / y)) - y);
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.46d+80)) then
tmp = 0.5d0 * (x / (y / x))
else if (x <= 1.3d+128) then
tmp = (-0.5d0) * ((z * (z / y)) - y)
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.46e+80) {
tmp = 0.5 * (x / (y / x));
} else if (x <= 1.3e+128) {
tmp = -0.5 * ((z * (z / y)) - y);
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.46e+80: tmp = 0.5 * (x / (y / x)) elif x <= 1.3e+128: tmp = -0.5 * ((z * (z / y)) - y) else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.46e+80) tmp = Float64(0.5 * Float64(x / Float64(y / x))); elseif (x <= 1.3e+128) tmp = Float64(-0.5 * Float64(Float64(z * Float64(z / y)) - y)); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.46e+80) tmp = 0.5 * (x / (y / x)); elseif (x <= 1.3e+128) tmp = -0.5 * ((z * (z / y)) - y); else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.46e+80], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+128], N[(-0.5 * N[(N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{+80}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+128}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if x < -1.4599999999999999e80Initial program 72.2%
Taylor expanded in x around inf 69.8%
unpow269.8%
Simplified69.8%
Taylor expanded in x around 0 69.8%
unpow269.8%
*-commutative69.8%
associate-/l*75.5%
Simplified75.5%
if -1.4599999999999999e80 < x < 1.3e128Initial program 73.9%
sub-neg73.9%
+-commutative73.9%
neg-sub073.9%
associate-+l-73.9%
sub0-neg73.9%
neg-mul-173.9%
*-commutative73.9%
times-frac73.9%
associate--r+73.9%
div-sub73.9%
difference-of-squares73.9%
+-commutative73.9%
associate-*r/74.8%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.8%
Applied egg-rr99.8%
+-commutative99.8%
*-commutative99.8%
associate-*l/99.9%
*-un-lft-identity99.9%
flip-+94.7%
frac-times79.7%
Applied egg-rr79.7%
associate-/l*85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in z around inf 80.9%
unpow280.9%
*-lft-identity80.9%
times-frac85.5%
/-rgt-identity85.5%
Simplified85.5%
if 1.3e128 < x Initial program 60.3%
Taylor expanded in x around inf 66.5%
unpow266.5%
Simplified66.5%
times-frac74.8%
div-inv74.8%
metadata-eval74.8%
Applied egg-rr74.8%
Taylor expanded in x around 0 66.5%
*-commutative66.5%
unpow266.5%
associate-*r/74.8%
associate-*r*74.8%
associate-*l/74.8%
*-lft-identity74.8%
times-frac74.8%
/-rgt-identity74.8%
Simplified74.8%
Final simplification82.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.5e+80) (* 0.5 (/ x (/ y x))) (if (<= x 7.5e+122) (* -0.5 (- (/ z (/ y z)) y)) (* x (* x (/ 0.5 y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e+80) {
tmp = 0.5 * (x / (y / x));
} else if (x <= 7.5e+122) {
tmp = -0.5 * ((z / (y / z)) - y);
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.5d+80)) then
tmp = 0.5d0 * (x / (y / x))
else if (x <= 7.5d+122) then
tmp = (-0.5d0) * ((z / (y / z)) - y)
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e+80) {
tmp = 0.5 * (x / (y / x));
} else if (x <= 7.5e+122) {
tmp = -0.5 * ((z / (y / z)) - y);
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.5e+80: tmp = 0.5 * (x / (y / x)) elif x <= 7.5e+122: tmp = -0.5 * ((z / (y / z)) - y) else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.5e+80) tmp = Float64(0.5 * Float64(x / Float64(y / x))); elseif (x <= 7.5e+122) tmp = Float64(-0.5 * Float64(Float64(z / Float64(y / z)) - y)); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.5e+80) tmp = 0.5 * (x / (y / x)); elseif (x <= 7.5e+122) tmp = -0.5 * ((z / (y / z)) - y); else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.5e+80], N[(0.5 * N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+122], N[(-0.5 * N[(N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+80}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+122}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z}{\frac{y}{z}} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if x < -1.49999999999999993e80Initial program 72.2%
Taylor expanded in x around inf 69.8%
unpow269.8%
Simplified69.8%
Taylor expanded in x around 0 69.8%
unpow269.8%
*-commutative69.8%
associate-/l*75.5%
Simplified75.5%
if -1.49999999999999993e80 < x < 7.5000000000000002e122Initial program 73.9%
sub-neg73.9%
+-commutative73.9%
neg-sub073.9%
associate-+l-73.9%
sub0-neg73.9%
neg-mul-173.9%
*-commutative73.9%
times-frac73.9%
associate--r+73.9%
div-sub73.9%
difference-of-squares73.9%
+-commutative73.9%
associate-*r/74.8%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 80.9%
unpow280.9%
associate-/l*85.5%
Simplified85.5%
if 7.5000000000000002e122 < x Initial program 60.3%
Taylor expanded in x around inf 66.5%
unpow266.5%
Simplified66.5%
times-frac74.8%
div-inv74.8%
metadata-eval74.8%
Applied egg-rr74.8%
Taylor expanded in x around 0 66.5%
*-commutative66.5%
unpow266.5%
associate-*r/74.8%
associate-*r*74.8%
associate-*l/74.8%
*-lft-identity74.8%
times-frac74.8%
/-rgt-identity74.8%
Simplified74.8%
Final simplification82.0%
(FPCore (x y z) :precision binary64 (if (<= y -3.15e+91) (* y 0.5) (if (<= y 2e+117) (* x (* x (/ 0.5 y))) (* y 0.5))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.15e+91) {
tmp = y * 0.5;
} else if (y <= 2e+117) {
tmp = x * (x * (0.5 / y));
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-3.15d+91)) then
tmp = y * 0.5d0
else if (y <= 2d+117) then
tmp = x * (x * (0.5d0 / y))
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.15e+91) {
tmp = y * 0.5;
} else if (y <= 2e+117) {
tmp = x * (x * (0.5 / y));
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.15e+91: tmp = y * 0.5 elif y <= 2e+117: tmp = x * (x * (0.5 / y)) else: tmp = y * 0.5 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.15e+91) tmp = Float64(y * 0.5); elseif (y <= 2e+117) tmp = Float64(x * Float64(x * Float64(0.5 / y))); else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.15e+91) tmp = y * 0.5; elseif (y <= 2e+117) tmp = x * (x * (0.5 / y)); else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.15e+91], N[(y * 0.5), $MachinePrecision], If[LessEqual[y, 2e+117], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{+91}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+117}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < -3.15e91 or 2.0000000000000001e117 < y Initial program 27.9%
Taylor expanded in y around inf 79.3%
*-commutative79.3%
Simplified79.3%
if -3.15e91 < y < 2.0000000000000001e117Initial program 91.0%
Taylor expanded in x around inf 45.4%
unpow245.4%
Simplified45.4%
times-frac47.4%
div-inv47.4%
metadata-eval47.4%
Applied egg-rr47.4%
Taylor expanded in x around 0 45.4%
*-commutative45.4%
unpow245.4%
associate-*r/47.4%
associate-*r*47.4%
associate-*l/47.4%
*-lft-identity47.4%
times-frac47.4%
/-rgt-identity47.4%
Simplified47.4%
Final simplification57.3%
(FPCore (x y z) :precision binary64 (* y 0.5))
double code(double x, double y, double z) {
return y * 0.5;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * 0.5d0
end function
public static double code(double x, double y, double z) {
return y * 0.5;
}
def code(x, y, z): return y * 0.5
function code(x, y, z) return Float64(y * 0.5) end
function tmp = code(x, y, z) tmp = y * 0.5; end
code[x_, y_, z_] := N[(y * 0.5), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 0.5
\end{array}
Initial program 71.5%
Taylor expanded in y around inf 30.8%
*-commutative30.8%
Simplified30.8%
Final simplification30.8%
(FPCore (x y z) :precision binary64 (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x))))
double code(double x, double y, double z) {
return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y * 0.5d0) - (((0.5d0 / y) * (z + x)) * (z - x))
end function
public static double code(double x, double y, double z) {
return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
}
def code(x, y, z): return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x))
function code(x, y, z) return Float64(Float64(y * 0.5) - Float64(Float64(Float64(0.5 / y) * Float64(z + x)) * Float64(z - x))) end
function tmp = code(x, y, z) tmp = (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x)); end
code[x_, y_, z_] := N[(N[(y * 0.5), $MachinePrecision] - N[(N[(N[(0.5 / y), $MachinePrecision] * N[(z + x), $MachinePrecision]), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right)
\end{array}
herbie shell --seed 2023176
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
:precision binary64
:herbie-target
(- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))