
(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 10 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}
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (/ (- (+ (* x x) (* y_m y_m)) (* z z)) (* y_m 2.0))))
(*
y_s
(if (<= t_0 -4e-47)
(/ (+ y_m z) (/ (* y_m 2.0) (- y_m z)))
(if (<= t_0 INFINITY)
(* (hypot (hypot x y_m) z) (* 0.5 (/ (hypot y_m x) y_m)))
(* (/ (- y_m z) y_m) (/ (+ y_m z) 2.0)))))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
double tmp;
if (t_0 <= -4e-47) {
tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z));
} else if (t_0 <= ((double) INFINITY)) {
tmp = hypot(hypot(x, y_m), z) * (0.5 * (hypot(y_m, x) / y_m));
} else {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
}
return y_s * tmp;
}
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
double tmp;
if (t_0 <= -4e-47) {
tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.hypot(Math.hypot(x, y_m), z) * (0.5 * (Math.hypot(y_m, x) / y_m));
} else {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0) tmp = 0 if t_0 <= -4e-47: tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z)) elif t_0 <= math.inf: tmp = math.hypot(math.hypot(x, y_m), z) * (0.5 * (math.hypot(y_m, x) / y_m)) else: tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0) return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) t_0 = Float64(Float64(Float64(Float64(x * x) + Float64(y_m * y_m)) - Float64(z * z)) / Float64(y_m * 2.0)) tmp = 0.0 if (t_0 <= -4e-47) tmp = Float64(Float64(y_m + z) / Float64(Float64(y_m * 2.0) / Float64(y_m - z))); elseif (t_0 <= Inf) tmp = Float64(hypot(hypot(x, y_m), z) * Float64(0.5 * Float64(hypot(y_m, x) / y_m))); else tmp = Float64(Float64(Float64(y_m - z) / y_m) * Float64(Float64(y_m + z) / 2.0)); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0); tmp = 0.0; if (t_0 <= -4e-47) tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z)); elseif (t_0 <= Inf) tmp = hypot(hypot(x, y_m), z) * (0.5 * (hypot(y_m, x) / y_m)); else tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0); end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[t$95$0, -4e-47], N[(N[(y$95$m + z), $MachinePrecision] / N[(N[(y$95$m * 2.0), $MachinePrecision] / N[(y$95$m - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[Sqrt[x ^ 2 + y$95$m ^ 2], $MachinePrecision] ^ 2 + z ^ 2], $MachinePrecision] * N[(0.5 * N[(N[Sqrt[y$95$m ^ 2 + x ^ 2], $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$95$m - z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(y$95$m + z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := \frac{\left(x \cdot x + y\_m \cdot y\_m\right) - z \cdot z}{y\_m \cdot 2}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-47}:\\
\;\;\;\;\frac{y\_m + z}{\frac{y\_m \cdot 2}{y\_m - z}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\mathsf{hypot}\left(\mathsf{hypot}\left(x, y\_m\right), z\right) \cdot \left(0.5 \cdot \frac{\mathsf{hypot}\left(y\_m, x\right)}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m - z}{y\_m} \cdot \frac{y\_m + z}{2}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y 2)) < -3.9999999999999999e-47Initial program 80.7%
associate--l+80.7%
+-commutative80.7%
sqr-neg80.7%
difference-of-squares80.7%
fma-def80.7%
sub-neg80.7%
sub-neg80.7%
remove-double-neg80.7%
Simplified80.7%
Taylor expanded in x around 0 51.2%
associate-/l*67.0%
div-inv67.0%
*-commutative67.0%
*-un-lft-identity67.0%
times-frac67.0%
metadata-eval67.0%
Applied egg-rr67.0%
associate-*r/67.0%
*-rgt-identity67.0%
associate-*r/67.0%
*-commutative67.0%
Simplified67.0%
if -3.9999999999999999e-47 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y 2)) < +inf.0Initial program 74.2%
expm1-log1p-u71.8%
expm1-udef69.8%
Applied egg-rr69.8%
expm1-def71.8%
expm1-log1p74.2%
*-commutative74.2%
Simplified74.2%
add-cube-cbrt73.6%
pow373.6%
Applied egg-rr73.6%
rem-cube-cbrt74.2%
*-commutative74.2%
add-sqr-sqrt41.5%
associate-*l*41.5%
Applied egg-rr67.2%
Taylor expanded in z around 0 41.7%
associate-*l/41.7%
*-lft-identity41.7%
+-commutative41.7%
unpow241.7%
unpow241.7%
hypot-def67.3%
Simplified67.3%
if +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y 2)) Initial program 0.0%
associate--l+0.0%
+-commutative0.0%
sqr-neg0.0%
difference-of-squares18.2%
fma-def45.8%
sub-neg45.8%
sub-neg45.8%
remove-double-neg45.8%
Simplified45.8%
Taylor expanded in x around 0 33.6%
*-commutative33.6%
times-frac66.7%
Applied egg-rr66.7%
Final simplification67.1%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 3.3e+156)
(/ (- (fma x x (* y_m y_m)) (* z z)) (* y_m 2.0))
(* (/ (- y_m z) y_m) (/ (+ y_m z) 2.0)))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 3.3e+156) {
tmp = (fma(x, x, (y_m * y_m)) - (z * z)) / (y_m * 2.0);
} else {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
}
return y_s * tmp;
}
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 3.3e+156) tmp = Float64(Float64(fma(x, x, Float64(y_m * y_m)) - Float64(z * z)) / Float64(y_m * 2.0)); else tmp = Float64(Float64(Float64(y_m - z) / y_m) * Float64(Float64(y_m + z) / 2.0)); end return Float64(y_s * tmp) end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 3.3e+156], N[(N[(N[(x * x + N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$95$m - z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(y$95$m + z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 3.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, x, y\_m \cdot y\_m\right) - z \cdot z}{y\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m - z}{y\_m} \cdot \frac{y\_m + z}{2}\\
\end{array}
\end{array}
if y < 3.2999999999999999e156Initial program 78.3%
div-sub74.2%
sqr-neg74.2%
div-sub78.3%
sqr-neg78.3%
fma-def78.4%
Simplified78.4%
if 3.2999999999999999e156 < y Initial program 9.7%
associate--l+9.7%
+-commutative9.7%
sqr-neg9.7%
difference-of-squares18.3%
fma-def20.8%
sub-neg20.8%
sub-neg20.8%
remove-double-neg20.8%
Simplified20.8%
Taylor expanded in x around 0 18.3%
*-commutative18.3%
times-frac86.1%
Applied egg-rr86.1%
Final simplification79.6%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 3.3e+156)
(/ (fma (- y_m z) (+ y_m z) (* x x)) (* y_m 2.0))
(* (/ (- y_m z) y_m) (/ (+ y_m z) 2.0)))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 3.3e+156) {
tmp = fma((y_m - z), (y_m + z), (x * x)) / (y_m * 2.0);
} else {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
}
return y_s * tmp;
}
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 3.3e+156) tmp = Float64(fma(Float64(y_m - z), Float64(y_m + z), Float64(x * x)) / Float64(y_m * 2.0)); else tmp = Float64(Float64(Float64(y_m - z) / y_m) * Float64(Float64(y_m + z) / 2.0)); end return Float64(y_s * tmp) end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 3.3e+156], N[(N[(N[(y$95$m - z), $MachinePrecision] * N[(y$95$m + z), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$95$m - z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(y$95$m + z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 3.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y\_m - z, y\_m + z, x \cdot x\right)}{y\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m - z}{y\_m} \cdot \frac{y\_m + z}{2}\\
\end{array}
\end{array}
if y < 3.2999999999999999e156Initial program 78.3%
associate--l+78.3%
+-commutative78.3%
sqr-neg78.3%
difference-of-squares79.5%
fma-def83.3%
sub-neg83.3%
sub-neg83.3%
remove-double-neg83.3%
Simplified83.3%
if 3.2999999999999999e156 < y Initial program 9.7%
associate--l+9.7%
+-commutative9.7%
sqr-neg9.7%
difference-of-squares18.3%
fma-def20.8%
sub-neg20.8%
sub-neg20.8%
remove-double-neg20.8%
Simplified20.8%
Taylor expanded in x around 0 18.3%
*-commutative18.3%
times-frac86.1%
Applied egg-rr86.1%
Final simplification83.7%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (or (<= y_m 2.06e-11) (and (not (<= y_m 4.35e+43)) (<= y_m 4.2e+82)))
(* x (* x (/ 0.5 y_m)))
(* y_m 0.5))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((y_m <= 2.06e-11) || (!(y_m <= 4.35e+43) && (y_m <= 4.2e+82))) {
tmp = x * (x * (0.5 / y_m));
} else {
tmp = y_m * 0.5;
}
return y_s * tmp;
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((y_m <= 2.06d-11) .or. (.not. (y_m <= 4.35d+43)) .and. (y_m <= 4.2d+82)) then
tmp = x * (x * (0.5d0 / y_m))
else
tmp = y_m * 0.5d0
end if
code = y_s * tmp
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((y_m <= 2.06e-11) || (!(y_m <= 4.35e+43) && (y_m <= 4.2e+82))) {
tmp = x * (x * (0.5 / y_m));
} else {
tmp = y_m * 0.5;
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if (y_m <= 2.06e-11) or (not (y_m <= 4.35e+43) and (y_m <= 4.2e+82)): tmp = x * (x * (0.5 / y_m)) else: tmp = y_m * 0.5 return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if ((y_m <= 2.06e-11) || (!(y_m <= 4.35e+43) && (y_m <= 4.2e+82))) tmp = Float64(x * Float64(x * Float64(0.5 / y_m))); else tmp = Float64(y_m * 0.5); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if ((y_m <= 2.06e-11) || (~((y_m <= 4.35e+43)) && (y_m <= 4.2e+82))) tmp = x * (x * (0.5 / y_m)); else tmp = y_m * 0.5; end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[Or[LessEqual[y$95$m, 2.06e-11], And[N[Not[LessEqual[y$95$m, 4.35e+43]], $MachinePrecision], LessEqual[y$95$m, 4.2e+82]]], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 2.06 \cdot 10^{-11} \lor \neg \left(y\_m \leq 4.35 \cdot 10^{+43}\right) \land y\_m \leq 4.2 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\
\end{array}
\end{array}
if y < 2.0599999999999999e-11 or 4.34999999999999977e43 < y < 4.2e82Initial program 78.4%
Taylor expanded in x around inf 36.1%
div-inv36.1%
metadata-eval36.1%
div-inv36.1%
clear-num36.1%
unpow236.1%
associate-*l*38.6%
Applied egg-rr38.6%
if 2.0599999999999999e-11 < y < 4.34999999999999977e43 or 4.2e82 < y Initial program 39.1%
Taylor expanded in y around inf 61.0%
Final simplification44.9%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (or (<= y_m 1.8e-11) (and (not (<= y_m 4.2e+43)) (<= y_m 1.8e+82)))
(* (/ x y_m) (/ x 2.0))
(* y_m 0.5))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((y_m <= 1.8e-11) || (!(y_m <= 4.2e+43) && (y_m <= 1.8e+82))) {
tmp = (x / y_m) * (x / 2.0);
} else {
tmp = y_m * 0.5;
}
return y_s * tmp;
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((y_m <= 1.8d-11) .or. (.not. (y_m <= 4.2d+43)) .and. (y_m <= 1.8d+82)) then
tmp = (x / y_m) * (x / 2.0d0)
else
tmp = y_m * 0.5d0
end if
code = y_s * tmp
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if ((y_m <= 1.8e-11) || (!(y_m <= 4.2e+43) && (y_m <= 1.8e+82))) {
tmp = (x / y_m) * (x / 2.0);
} else {
tmp = y_m * 0.5;
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if (y_m <= 1.8e-11) or (not (y_m <= 4.2e+43) and (y_m <= 1.8e+82)): tmp = (x / y_m) * (x / 2.0) else: tmp = y_m * 0.5 return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if ((y_m <= 1.8e-11) || (!(y_m <= 4.2e+43) && (y_m <= 1.8e+82))) tmp = Float64(Float64(x / y_m) * Float64(x / 2.0)); else tmp = Float64(y_m * 0.5); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if ((y_m <= 1.8e-11) || (~((y_m <= 4.2e+43)) && (y_m <= 1.8e+82))) tmp = (x / y_m) * (x / 2.0); else tmp = y_m * 0.5; end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[Or[LessEqual[y$95$m, 1.8e-11], And[N[Not[LessEqual[y$95$m, 4.2e+43]], $MachinePrecision], LessEqual[y$95$m, 1.8e+82]]], N[(N[(x / y$95$m), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], N[(y$95$m * 0.5), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.8 \cdot 10^{-11} \lor \neg \left(y\_m \leq 4.2 \cdot 10^{+43}\right) \land y\_m \leq 1.8 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{2}\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\
\end{array}
\end{array}
if y < 1.79999999999999992e-11 or 4.20000000000000003e43 < y < 1.80000000000000007e82Initial program 78.4%
Taylor expanded in x around inf 36.1%
unpow236.1%
times-frac38.6%
Applied egg-rr38.6%
if 1.79999999999999992e-11 < y < 4.20000000000000003e43 or 1.80000000000000007e82 < y Initial program 39.1%
Taylor expanded in y around inf 61.0%
Final simplification44.9%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 1.25e-12)
(/ (* x (* x 0.5)) y_m)
(if (or (<= y_m 3.35e+44) (not (<= y_m 4.5e+82)))
(* y_m 0.5)
(* (/ x y_m) (/ x 2.0))))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 1.25e-12) {
tmp = (x * (x * 0.5)) / y_m;
} else if ((y_m <= 3.35e+44) || !(y_m <= 4.5e+82)) {
tmp = y_m * 0.5;
} else {
tmp = (x / y_m) * (x / 2.0);
}
return y_s * tmp;
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 1.25d-12) then
tmp = (x * (x * 0.5d0)) / y_m
else if ((y_m <= 3.35d+44) .or. (.not. (y_m <= 4.5d+82))) then
tmp = y_m * 0.5d0
else
tmp = (x / y_m) * (x / 2.0d0)
end if
code = y_s * tmp
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 1.25e-12) {
tmp = (x * (x * 0.5)) / y_m;
} else if ((y_m <= 3.35e+44) || !(y_m <= 4.5e+82)) {
tmp = y_m * 0.5;
} else {
tmp = (x / y_m) * (x / 2.0);
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if y_m <= 1.25e-12: tmp = (x * (x * 0.5)) / y_m elif (y_m <= 3.35e+44) or not (y_m <= 4.5e+82): tmp = y_m * 0.5 else: tmp = (x / y_m) * (x / 2.0) return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 1.25e-12) tmp = Float64(Float64(x * Float64(x * 0.5)) / y_m); elseif ((y_m <= 3.35e+44) || !(y_m <= 4.5e+82)) tmp = Float64(y_m * 0.5); else tmp = Float64(Float64(x / y_m) * Float64(x / 2.0)); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (y_m <= 1.25e-12) tmp = (x * (x * 0.5)) / y_m; elseif ((y_m <= 3.35e+44) || ~((y_m <= 4.5e+82))) tmp = y_m * 0.5; else tmp = (x / y_m) * (x / 2.0); end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 1.25e-12], N[(N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[Or[LessEqual[y$95$m, 3.35e+44], N[Not[LessEqual[y$95$m, 4.5e+82]], $MachinePrecision]], N[(y$95$m * 0.5), $MachinePrecision], N[(N[(x / y$95$m), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.25 \cdot 10^{-12}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot 0.5\right)}{y\_m}\\
\mathbf{elif}\;y\_m \leq 3.35 \cdot 10^{+44} \lor \neg \left(y\_m \leq 4.5 \cdot 10^{+82}\right):\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{2}\\
\end{array}
\end{array}
if y < 1.24999999999999992e-12Initial program 78.0%
Taylor expanded in x around inf 35.9%
div-inv35.9%
metadata-eval35.9%
div-inv35.9%
clear-num35.9%
unpow235.9%
associate-*l*38.0%
Applied egg-rr38.0%
*-commutative38.0%
associate-*r/38.0%
associate-*l/35.9%
Applied egg-rr35.9%
if 1.24999999999999992e-12 < y < 3.35000000000000018e44 or 4.4999999999999997e82 < y Initial program 39.1%
Taylor expanded in y around inf 61.0%
if 3.35000000000000018e44 < y < 4.4999999999999997e82Initial program 88.6%
Taylor expanded in x around inf 40.0%
unpow240.0%
times-frac51.4%
Applied egg-rr51.4%
Final simplification43.5%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 3.3e+156)
(/ (- (+ (* x x) (* y_m y_m)) (* z z)) (* y_m 2.0))
(* (/ (- y_m z) y_m) (/ (+ y_m z) 2.0)))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 3.3e+156) {
tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
} else {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
}
return y_s * tmp;
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 3.3d+156) then
tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0d0)
else
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0d0)
end if
code = y_s * tmp
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (y_m <= 3.3e+156) {
tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
} else {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if y_m <= 3.3e+156: tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0) else: tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0) return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (y_m <= 3.3e+156) tmp = Float64(Float64(Float64(Float64(x * x) + Float64(y_m * y_m)) - Float64(z * z)) / Float64(y_m * 2.0)); else tmp = Float64(Float64(Float64(y_m - z) / y_m) * Float64(Float64(y_m + z) / 2.0)); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (y_m <= 3.3e+156) tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0); else tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0); end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 3.3e+156], N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$95$m - z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(y$95$m + z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 3.3 \cdot 10^{+156}:\\
\;\;\;\;\frac{\left(x \cdot x + y\_m \cdot y\_m\right) - z \cdot z}{y\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m - z}{y\_m} \cdot \frac{y\_m + z}{2}\\
\end{array}
\end{array}
if y < 3.2999999999999999e156Initial program 78.3%
if 3.2999999999999999e156 < y Initial program 9.7%
associate--l+9.7%
+-commutative9.7%
sqr-neg9.7%
difference-of-squares18.3%
fma-def20.8%
sub-neg20.8%
sub-neg20.8%
remove-double-neg20.8%
Simplified20.8%
Taylor expanded in x around 0 18.3%
*-commutative18.3%
times-frac86.1%
Applied egg-rr86.1%
Final simplification79.6%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 1.5e+141)
(* (/ (- y_m z) y_m) (/ (+ y_m z) 2.0))
(/ x (* y_m (/ 2.0 x))))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.5e+141) {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
} else {
tmp = x / (y_m * (2.0 / x));
}
return y_s * tmp;
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.5d+141) then
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0d0)
else
tmp = x / (y_m * (2.0d0 / x))
end if
code = y_s * tmp
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 1.5e+141) {
tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0);
} else {
tmp = x / (y_m * (2.0 / x));
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 1.5e+141: tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0) else: tmp = x / (y_m * (2.0 / x)) return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 1.5e+141) tmp = Float64(Float64(Float64(y_m - z) / y_m) * Float64(Float64(y_m + z) / 2.0)); else tmp = Float64(x / Float64(y_m * Float64(2.0 / x))); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 1.5e+141) tmp = ((y_m - z) / y_m) * ((y_m + z) / 2.0); else tmp = x / (y_m * (2.0 / x)); end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.5e+141], N[(N[(N[(y$95$m - z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(y$95$m + z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y$95$m * N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{+141}:\\
\;\;\;\;\frac{y\_m - z}{y\_m} \cdot \frac{y\_m + z}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m \cdot \frac{2}{x}}\\
\end{array}
\end{array}
if x < 1.4999999999999999e141Initial program 71.0%
associate--l+71.0%
+-commutative71.0%
sqr-neg71.0%
difference-of-squares73.3%
fma-def74.6%
sub-neg74.6%
sub-neg74.6%
remove-double-neg74.6%
Simplified74.6%
Taylor expanded in x around 0 54.4%
*-commutative54.4%
times-frac76.6%
Applied egg-rr76.6%
if 1.4999999999999999e141 < x Initial program 46.5%
Taylor expanded in x around inf 65.4%
unpow265.4%
times-frac79.6%
Applied egg-rr79.6%
*-commutative79.6%
clear-num79.6%
frac-times79.6%
*-un-lft-identity79.6%
Applied egg-rr79.6%
Final simplification77.1%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 8.6e+143)
(/ (+ y_m z) (/ (* y_m 2.0) (- y_m z)))
(/ x (* y_m (/ 2.0 x))))))y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 8.6e+143) {
tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z));
} else {
tmp = x / (y_m * (2.0 / x));
}
return y_s * tmp;
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 8.6d+143) then
tmp = (y_m + z) / ((y_m * 2.0d0) / (y_m - z))
else
tmp = x / (y_m * (2.0d0 / x))
end if
code = y_s * tmp
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
double tmp;
if (x <= 8.6e+143) {
tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z));
} else {
tmp = x / (y_m * (2.0 / x));
}
return y_s * tmp;
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): tmp = 0 if x <= 8.6e+143: tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z)) else: tmp = x / (y_m * (2.0 / x)) return y_s * tmp
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) tmp = 0.0 if (x <= 8.6e+143) tmp = Float64(Float64(y_m + z) / Float64(Float64(y_m * 2.0) / Float64(y_m - z))); else tmp = Float64(x / Float64(y_m * Float64(2.0 / x))); end return Float64(y_s * tmp) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp_2 = code(y_s, x, y_m, z) tmp = 0.0; if (x <= 8.6e+143) tmp = (y_m + z) / ((y_m * 2.0) / (y_m - z)); else tmp = x / (y_m * (2.0 / x)); end tmp_2 = y_s * tmp; end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 8.6e+143], N[(N[(y$95$m + z), $MachinePrecision] / N[(N[(y$95$m * 2.0), $MachinePrecision] / N[(y$95$m - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y$95$m * N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 8.6 \cdot 10^{+143}:\\
\;\;\;\;\frac{y\_m + z}{\frac{y\_m \cdot 2}{y\_m - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m \cdot \frac{2}{x}}\\
\end{array}
\end{array}
if x < 8.60000000000000003e143Initial program 71.0%
associate--l+71.0%
+-commutative71.0%
sqr-neg71.0%
difference-of-squares73.3%
fma-def74.6%
sub-neg74.6%
sub-neg74.6%
remove-double-neg74.6%
Simplified74.6%
Taylor expanded in x around 0 54.4%
associate-/l*76.6%
div-inv76.6%
*-commutative76.6%
*-un-lft-identity76.6%
times-frac76.6%
metadata-eval76.6%
Applied egg-rr76.6%
associate-*r/76.6%
*-rgt-identity76.6%
associate-*r/76.6%
*-commutative76.6%
Simplified76.6%
if 8.60000000000000003e143 < x Initial program 46.5%
Taylor expanded in x around inf 65.4%
unpow265.4%
times-frac79.6%
Applied egg-rr79.6%
*-commutative79.6%
clear-num79.6%
frac-times79.6%
*-un-lft-identity79.6%
Applied egg-rr79.6%
Final simplification77.1%
y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (* y_m 0.5)))
y_m = fabs(y);
y_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
return y_s * (y_m * 0.5);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
real(8) function code(y_s, x, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (y_m * 0.5d0)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
return y_s * (y_m * 0.5);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) def code(y_s, x, y_m, z): return y_s * (y_m * 0.5)
y_m = abs(y) y_s = copysign(1.0, y) function code(y_s, x, y_m, z) return Float64(y_s * Float64(y_m * 0.5)) end
y_m = abs(y); y_s = sign(y) * abs(1.0); function tmp = code(y_s, x, y_m, z) tmp = y_s * (y_m * 0.5); end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(y$95$m * 0.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
y\_s \cdot \left(y\_m \cdot 0.5\right)
\end{array}
Initial program 67.4%
Taylor expanded in y around inf 34.7%
Final simplification34.7%
(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 2024031
(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)))