
(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 11 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 #s(literal 1 binary64) 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)))
(t_1 (hypot x (+ y_m z))))
(*
y_s
(if (or (<= t_0 -1e-132) (not (<= t_0 INFINITY)))
(* 0.5 (- y_m (* z (/ z y_m))))
(* 0.5 (/ t_1 (/ y_m t_1)))))))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 t_1 = hypot(x, (y_m + z));
double tmp;
if ((t_0 <= -1e-132) || !(t_0 <= ((double) INFINITY))) {
tmp = 0.5 * (y_m - (z * (z / y_m)));
} else {
tmp = 0.5 * (t_1 / (y_m / t_1));
}
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 t_1 = Math.hypot(x, (y_m + z));
double tmp;
if ((t_0 <= -1e-132) || !(t_0 <= Double.POSITIVE_INFINITY)) {
tmp = 0.5 * (y_m - (z * (z / y_m)));
} else {
tmp = 0.5 * (t_1 / (y_m / t_1));
}
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) t_1 = math.hypot(x, (y_m + z)) tmp = 0 if (t_0 <= -1e-132) or not (t_0 <= math.inf): tmp = 0.5 * (y_m - (z * (z / y_m))) else: tmp = 0.5 * (t_1 / (y_m / t_1)) 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)) t_1 = hypot(x, Float64(y_m + z)) tmp = 0.0 if ((t_0 <= -1e-132) || !(t_0 <= Inf)) tmp = Float64(0.5 * Float64(y_m - Float64(z * Float64(z / y_m)))); else tmp = Float64(0.5 * Float64(t_1 / Float64(y_m / t_1))); 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); t_1 = hypot(x, (y_m + z)); tmp = 0.0; if ((t_0 <= -1e-132) || ~((t_0 <= Inf))) tmp = 0.5 * (y_m - (z * (z / y_m))); else tmp = 0.5 * (t_1 / (y_m / t_1)); 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]}, Block[{t$95$1 = N[Sqrt[x ^ 2 + N[(y$95$m + z), $MachinePrecision] ^ 2], $MachinePrecision]}, N[(y$95$s * If[Or[LessEqual[t$95$0, -1e-132], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[(0.5 * N[(y$95$m - N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(t$95$1 / N[(y$95$m / t$95$1), $MachinePrecision]), $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}\\
t_1 := \mathsf{hypot}\left(x, y\_m + z\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-132} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;0.5 \cdot \left(y\_m - z \cdot \frac{z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{t\_1}{\frac{y\_m}{t\_1}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < -9.9999999999999999e-133 or +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) Initial program 61.9%
remove-double-neg61.9%
distribute-lft-neg-out61.9%
distribute-frac-neg261.9%
distribute-frac-neg61.9%
neg-mul-161.9%
distribute-lft-neg-out61.9%
*-commutative61.9%
distribute-lft-neg-in61.9%
times-frac61.9%
metadata-eval61.9%
metadata-eval61.9%
associate--l+61.9%
fma-define67.9%
Simplified67.9%
Taylor expanded in x around 0 43.1%
div-sub43.1%
unpow243.1%
associate-/l*60.4%
*-inverses60.4%
*-rgt-identity60.4%
Simplified60.4%
unpow260.4%
associate-/l*67.7%
Applied egg-rr67.7%
if -9.9999999999999999e-133 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < +inf.0Initial program 77.3%
remove-double-neg77.3%
distribute-lft-neg-out77.3%
distribute-frac-neg277.3%
distribute-frac-neg77.3%
neg-mul-177.3%
distribute-lft-neg-out77.3%
*-commutative77.3%
distribute-lft-neg-in77.3%
times-frac77.3%
metadata-eval77.3%
metadata-eval77.3%
associate--l+77.3%
fma-define77.3%
Simplified77.3%
prod-diff59.2%
fma-neg59.2%
difference-of-squares59.2%
fma-define59.3%
pow259.3%
Applied egg-rr59.3%
add-sqr-sqrt45.5%
*-un-lft-identity45.5%
times-frac45.5%
Applied egg-rr65.6%
/-rgt-identity65.6%
clear-num65.5%
un-div-inv65.6%
Applied egg-rr65.6%
Final simplification66.7%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 2e+151)
(* 0.5 (/ (fma x x (- (* y_m y_m) (* z z))) y_m))
(* 0.5 (- y_m (* z (/ z y_m)))))))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 <= 2e+151) {
tmp = 0.5 * (fma(x, x, ((y_m * y_m) - (z * z))) / y_m);
} else {
tmp = 0.5 * (y_m - (z * (z / y_m)));
}
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 <= 2e+151) tmp = Float64(0.5 * Float64(fma(x, x, Float64(Float64(y_m * y_m) - Float64(z * z))) / y_m)); else tmp = Float64(0.5 * Float64(y_m - Float64(z * Float64(z / y_m)))); 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, 2e+151], N[(0.5 * N[(N[(x * x + N[(N[(y$95$m * y$95$m), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y$95$m - N[(z * N[(z / y$95$m), $MachinePrecision]), $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}\;y\_m \leq 2 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \frac{\mathsf{fma}\left(x, x, y\_m \cdot y\_m - z \cdot z\right)}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y\_m - z \cdot \frac{z}{y\_m}\right)\\
\end{array}
\end{array}
if y < 2.00000000000000003e151Initial program 78.9%
remove-double-neg78.9%
distribute-lft-neg-out78.9%
distribute-frac-neg278.9%
distribute-frac-neg78.9%
neg-mul-178.9%
distribute-lft-neg-out78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
times-frac78.9%
metadata-eval78.9%
metadata-eval78.9%
associate--l+78.9%
fma-define82.5%
Simplified82.5%
if 2.00000000000000003e151 < y Initial program 12.9%
remove-double-neg12.9%
distribute-lft-neg-out12.9%
distribute-frac-neg212.9%
distribute-frac-neg12.9%
neg-mul-112.9%
distribute-lft-neg-out12.9%
*-commutative12.9%
distribute-lft-neg-in12.9%
times-frac12.9%
metadata-eval12.9%
metadata-eval12.9%
associate--l+12.9%
fma-define12.9%
Simplified12.9%
Taylor expanded in x around 0 12.9%
div-sub12.9%
unpow212.9%
associate-/l*77.0%
*-inverses77.0%
*-rgt-identity77.0%
Simplified77.0%
unpow277.0%
associate-/l*92.4%
Applied egg-rr92.4%
Final simplification83.9%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (* x (* x (/ 0.5 y_m)))))
(*
y_s
(if (<= z 1e-214)
t_0
(if (<= z 1.25e-119)
(* y_m 0.5)
(if (<= z 1.7e-14)
t_0
(if (<= z 1.95e+32)
(* y_m 0.5)
(if (<= z 1.35e+41)
t_0
(if (<= z 8e+62)
(* z (* z (/ -0.5 y_m)))
(if (or (<= z 6.5e+92)
(and (not (<= z 4.2e+134)) (<= z 9e+158)))
(* y_m 0.5)
(* z (/ (/ z -2.0) y_m))))))))))))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 * (0.5 / y_m));
double tmp;
if (z <= 1e-214) {
tmp = t_0;
} else if (z <= 1.25e-119) {
tmp = y_m * 0.5;
} else if (z <= 1.7e-14) {
tmp = t_0;
} else if (z <= 1.95e+32) {
tmp = y_m * 0.5;
} else if (z <= 1.35e+41) {
tmp = t_0;
} else if (z <= 8e+62) {
tmp = z * (z * (-0.5 / y_m));
} else if ((z <= 6.5e+92) || (!(z <= 4.2e+134) && (z <= 9e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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) :: t_0
real(8) :: tmp
t_0 = x * (x * (0.5d0 / y_m))
if (z <= 1d-214) then
tmp = t_0
else if (z <= 1.25d-119) then
tmp = y_m * 0.5d0
else if (z <= 1.7d-14) then
tmp = t_0
else if (z <= 1.95d+32) then
tmp = y_m * 0.5d0
else if (z <= 1.35d+41) then
tmp = t_0
else if (z <= 8d+62) then
tmp = z * (z * ((-0.5d0) / y_m))
else if ((z <= 6.5d+92) .or. (.not. (z <= 4.2d+134)) .and. (z <= 9d+158)) then
tmp = y_m * 0.5d0
else
tmp = z * ((z / (-2.0d0)) / y_m)
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 t_0 = x * (x * (0.5 / y_m));
double tmp;
if (z <= 1e-214) {
tmp = t_0;
} else if (z <= 1.25e-119) {
tmp = y_m * 0.5;
} else if (z <= 1.7e-14) {
tmp = t_0;
} else if (z <= 1.95e+32) {
tmp = y_m * 0.5;
} else if (z <= 1.35e+41) {
tmp = t_0;
} else if (z <= 8e+62) {
tmp = z * (z * (-0.5 / y_m));
} else if ((z <= 6.5e+92) || (!(z <= 4.2e+134) && (z <= 9e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 * (0.5 / y_m)) tmp = 0 if z <= 1e-214: tmp = t_0 elif z <= 1.25e-119: tmp = y_m * 0.5 elif z <= 1.7e-14: tmp = t_0 elif z <= 1.95e+32: tmp = y_m * 0.5 elif z <= 1.35e+41: tmp = t_0 elif z <= 8e+62: tmp = z * (z * (-0.5 / y_m)) elif (z <= 6.5e+92) or (not (z <= 4.2e+134) and (z <= 9e+158)): tmp = y_m * 0.5 else: tmp = z * ((z / -2.0) / y_m) 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(x * Float64(x * Float64(0.5 / y_m))) tmp = 0.0 if (z <= 1e-214) tmp = t_0; elseif (z <= 1.25e-119) tmp = Float64(y_m * 0.5); elseif (z <= 1.7e-14) tmp = t_0; elseif (z <= 1.95e+32) tmp = Float64(y_m * 0.5); elseif (z <= 1.35e+41) tmp = t_0; elseif (z <= 8e+62) tmp = Float64(z * Float64(z * Float64(-0.5 / y_m))); elseif ((z <= 6.5e+92) || (!(z <= 4.2e+134) && (z <= 9e+158))) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(Float64(z / -2.0) / y_m)); 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 * (0.5 / y_m)); tmp = 0.0; if (z <= 1e-214) tmp = t_0; elseif (z <= 1.25e-119) tmp = y_m * 0.5; elseif (z <= 1.7e-14) tmp = t_0; elseif (z <= 1.95e+32) tmp = y_m * 0.5; elseif (z <= 1.35e+41) tmp = t_0; elseif (z <= 8e+62) tmp = z * (z * (-0.5 / y_m)); elseif ((z <= 6.5e+92) || (~((z <= 4.2e+134)) && (z <= 9e+158))) tmp = y_m * 0.5; else tmp = z * ((z / -2.0) / y_m); 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[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[z, 1e-214], t$95$0, If[LessEqual[z, 1.25e-119], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 1.7e-14], t$95$0, If[LessEqual[z, 1.95e+32], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 1.35e+41], t$95$0, If[LessEqual[z, 8e+62], N[(z * N[(z * N[(-0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.5e+92], And[N[Not[LessEqual[z, 4.2e+134]], $MachinePrecision], LessEqual[z, 9e+158]]], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(N[(z / -2.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]]]]]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 10^{-214}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-119}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-14}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+32}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+62}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y\_m}\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+92} \lor \neg \left(z \leq 4.2 \cdot 10^{+134}\right) \land z \leq 9 \cdot 10^{+158}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\frac{z}{-2}}{y\_m}\\
\end{array}
\end{array}
\end{array}
if z < 9.99999999999999913e-215 or 1.24999999999999998e-119 < z < 1.70000000000000001e-14 or 1.95e32 < z < 1.35e41Initial program 73.1%
clear-num73.1%
inv-pow73.1%
associate-/l*72.7%
add-sqr-sqrt72.7%
pow272.7%
hypot-define72.7%
pow272.7%
Applied egg-rr72.7%
unpow-172.7%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in x around inf 38.7%
associate-*r/38.7%
Simplified38.7%
associate-/r/38.8%
*-commutative38.8%
metadata-eval38.8%
div-inv38.8%
clear-num38.8%
unpow238.8%
associate-*r*40.5%
Applied egg-rr40.5%
if 9.99999999999999913e-215 < z < 1.24999999999999998e-119 or 1.70000000000000001e-14 < z < 1.95e32 or 8.00000000000000028e62 < z < 6.49999999999999999e92 or 4.2000000000000002e134 < z < 9.00000000000000092e158Initial program 63.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if 1.35e41 < z < 8.00000000000000028e62Initial program 54.0%
Taylor expanded in z around inf 50.6%
*-commutative50.6%
associate-*l/50.6%
Simplified50.6%
associate-/l*50.6%
pow250.6%
associate-*l*50.2%
Applied egg-rr50.2%
if 6.49999999999999999e92 < z < 4.2000000000000002e134 or 9.00000000000000092e158 < z Initial program 59.1%
Taylor expanded in z around inf 73.2%
*-commutative73.2%
associate-*l/73.2%
Simplified73.2%
associate-/l*73.2%
pow273.2%
associate-*l*79.8%
Applied egg-rr79.8%
clear-num79.8%
un-div-inv79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
*-commutative79.9%
associate-/r*79.9%
Simplified79.9%
Final simplification50.4%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(let* ((t_0 (* (/ x y_m) (/ x 2.0))))
(*
y_s
(if (<= z 6e-215)
t_0
(if (<= z 1.02e-119)
(* y_m 0.5)
(if (<= z 6.2e-15)
t_0
(if (<= z 2e+32)
(* y_m 0.5)
(if (<= z 4e+37)
(* x (* x (/ 0.5 y_m)))
(if (<= z 1.32e+60)
(* z (* z (/ -0.5 y_m)))
(if (or (<= z 1.3e+92) (and (not (<= z 8e+133)) (<= z 9e+158)))
(* y_m 0.5)
(* z (/ (/ z -2.0) y_m))))))))))))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 / y_m) * (x / 2.0);
double tmp;
if (z <= 6e-215) {
tmp = t_0;
} else if (z <= 1.02e-119) {
tmp = y_m * 0.5;
} else if (z <= 6.2e-15) {
tmp = t_0;
} else if (z <= 2e+32) {
tmp = y_m * 0.5;
} else if (z <= 4e+37) {
tmp = x * (x * (0.5 / y_m));
} else if (z <= 1.32e+60) {
tmp = z * (z * (-0.5 / y_m));
} else if ((z <= 1.3e+92) || (!(z <= 8e+133) && (z <= 9e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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) :: t_0
real(8) :: tmp
t_0 = (x / y_m) * (x / 2.0d0)
if (z <= 6d-215) then
tmp = t_0
else if (z <= 1.02d-119) then
tmp = y_m * 0.5d0
else if (z <= 6.2d-15) then
tmp = t_0
else if (z <= 2d+32) then
tmp = y_m * 0.5d0
else if (z <= 4d+37) then
tmp = x * (x * (0.5d0 / y_m))
else if (z <= 1.32d+60) then
tmp = z * (z * ((-0.5d0) / y_m))
else if ((z <= 1.3d+92) .or. (.not. (z <= 8d+133)) .and. (z <= 9d+158)) then
tmp = y_m * 0.5d0
else
tmp = z * ((z / (-2.0d0)) / y_m)
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 t_0 = (x / y_m) * (x / 2.0);
double tmp;
if (z <= 6e-215) {
tmp = t_0;
} else if (z <= 1.02e-119) {
tmp = y_m * 0.5;
} else if (z <= 6.2e-15) {
tmp = t_0;
} else if (z <= 2e+32) {
tmp = y_m * 0.5;
} else if (z <= 4e+37) {
tmp = x * (x * (0.5 / y_m));
} else if (z <= 1.32e+60) {
tmp = z * (z * (-0.5 / y_m));
} else if ((z <= 1.3e+92) || (!(z <= 8e+133) && (z <= 9e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 / y_m) * (x / 2.0) tmp = 0 if z <= 6e-215: tmp = t_0 elif z <= 1.02e-119: tmp = y_m * 0.5 elif z <= 6.2e-15: tmp = t_0 elif z <= 2e+32: tmp = y_m * 0.5 elif z <= 4e+37: tmp = x * (x * (0.5 / y_m)) elif z <= 1.32e+60: tmp = z * (z * (-0.5 / y_m)) elif (z <= 1.3e+92) or (not (z <= 8e+133) and (z <= 9e+158)): tmp = y_m * 0.5 else: tmp = z * ((z / -2.0) / y_m) 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(x / y_m) * Float64(x / 2.0)) tmp = 0.0 if (z <= 6e-215) tmp = t_0; elseif (z <= 1.02e-119) tmp = Float64(y_m * 0.5); elseif (z <= 6.2e-15) tmp = t_0; elseif (z <= 2e+32) tmp = Float64(y_m * 0.5); elseif (z <= 4e+37) tmp = Float64(x * Float64(x * Float64(0.5 / y_m))); elseif (z <= 1.32e+60) tmp = Float64(z * Float64(z * Float64(-0.5 / y_m))); elseif ((z <= 1.3e+92) || (!(z <= 8e+133) && (z <= 9e+158))) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(Float64(z / -2.0) / y_m)); 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 / y_m) * (x / 2.0); tmp = 0.0; if (z <= 6e-215) tmp = t_0; elseif (z <= 1.02e-119) tmp = y_m * 0.5; elseif (z <= 6.2e-15) tmp = t_0; elseif (z <= 2e+32) tmp = y_m * 0.5; elseif (z <= 4e+37) tmp = x * (x * (0.5 / y_m)); elseif (z <= 1.32e+60) tmp = z * (z * (-0.5 / y_m)); elseif ((z <= 1.3e+92) || (~((z <= 8e+133)) && (z <= 9e+158))) tmp = y_m * 0.5; else tmp = z * ((z / -2.0) / y_m); 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[(x / y$95$m), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[z, 6e-215], t$95$0, If[LessEqual[z, 1.02e-119], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 6.2e-15], t$95$0, If[LessEqual[z, 2e+32], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 4e+37], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.32e+60], N[(z * N[(z * N[(-0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.3e+92], And[N[Not[LessEqual[z, 8e+133]], $MachinePrecision], LessEqual[z, 9e+158]]], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(N[(z / -2.0), $MachinePrecision] / y$95$m), $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{x}{y\_m} \cdot \frac{x}{2}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{-215}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-119}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+32}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+37}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+60}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y\_m}\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+92} \lor \neg \left(z \leq 8 \cdot 10^{+133}\right) \land z \leq 9 \cdot 10^{+158}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\frac{z}{-2}}{y\_m}\\
\end{array}
\end{array}
\end{array}
if z < 6.00000000000000051e-215 or 1.02e-119 < z < 6.1999999999999998e-15Initial program 72.8%
clear-num72.8%
inv-pow72.8%
associate-/l*72.4%
add-sqr-sqrt72.4%
pow272.4%
hypot-define72.4%
pow272.4%
Applied egg-rr72.4%
unpow-172.4%
associate-*r/72.8%
Simplified72.8%
Taylor expanded in x around inf 38.0%
associate-*r/38.0%
Simplified38.0%
clear-num38.1%
unpow238.1%
*-commutative38.1%
times-frac39.9%
Applied egg-rr39.9%
if 6.00000000000000051e-215 < z < 1.02e-119 or 6.1999999999999998e-15 < z < 2.00000000000000011e32 or 1.32e60 < z < 1.2999999999999999e92 or 8.0000000000000002e133 < z < 9.00000000000000092e158Initial program 63.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if 2.00000000000000011e32 < z < 3.99999999999999982e37Initial program 100.0%
clear-num100.0%
inv-pow100.0%
associate-/l*100.0%
add-sqr-sqrt100.0%
pow2100.0%
hypot-define100.0%
pow2100.0%
Applied egg-rr100.0%
unpow-1100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-*r/100.0%
Simplified100.0%
associate-/r/100.0%
*-commutative100.0%
metadata-eval100.0%
div-inv100.0%
clear-num100.0%
unpow2100.0%
associate-*r*100.0%
Applied egg-rr100.0%
if 3.99999999999999982e37 < z < 1.32e60Initial program 54.0%
Taylor expanded in z around inf 50.6%
*-commutative50.6%
associate-*l/50.6%
Simplified50.6%
associate-/l*50.6%
pow250.6%
associate-*l*50.2%
Applied egg-rr50.2%
if 1.2999999999999999e92 < z < 8.0000000000000002e133 or 9.00000000000000092e158 < z Initial program 59.1%
Taylor expanded in z around inf 73.2%
*-commutative73.2%
associate-*l/73.2%
Simplified73.2%
associate-/l*73.2%
pow273.2%
associate-*l*79.8%
Applied egg-rr79.8%
clear-num79.8%
un-div-inv79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
*-commutative79.9%
associate-/r*79.9%
Simplified79.9%
Final simplification50.5%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= z 2.3e-214)
(* (/ x y_m) (/ x 2.0))
(if (<= z 1.02e-119)
(* y_m 0.5)
(if (<= z 2.7e-14)
(/ (* x 0.5) (/ y_m x))
(if (<= z 1.95e+32)
(* y_m 0.5)
(if (<= z 1.45e+40)
(* x (* x (/ 0.5 y_m)))
(if (<= z 2.85e+60)
(* z (* z (/ -0.5 y_m)))
(if (or (<= z 3.3e+91)
(and (not (<= z 3.8e+134)) (<= z 1.1e+158)))
(* y_m 0.5)
(* z (/ (/ z -2.0) y_m)))))))))))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 (z <= 2.3e-214) {
tmp = (x / y_m) * (x / 2.0);
} else if (z <= 1.02e-119) {
tmp = y_m * 0.5;
} else if (z <= 2.7e-14) {
tmp = (x * 0.5) / (y_m / x);
} else if (z <= 1.95e+32) {
tmp = y_m * 0.5;
} else if (z <= 1.45e+40) {
tmp = x * (x * (0.5 / y_m));
} else if (z <= 2.85e+60) {
tmp = z * (z * (-0.5 / y_m));
} else if ((z <= 3.3e+91) || (!(z <= 3.8e+134) && (z <= 1.1e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 (z <= 2.3d-214) then
tmp = (x / y_m) * (x / 2.0d0)
else if (z <= 1.02d-119) then
tmp = y_m * 0.5d0
else if (z <= 2.7d-14) then
tmp = (x * 0.5d0) / (y_m / x)
else if (z <= 1.95d+32) then
tmp = y_m * 0.5d0
else if (z <= 1.45d+40) then
tmp = x * (x * (0.5d0 / y_m))
else if (z <= 2.85d+60) then
tmp = z * (z * ((-0.5d0) / y_m))
else if ((z <= 3.3d+91) .or. (.not. (z <= 3.8d+134)) .and. (z <= 1.1d+158)) then
tmp = y_m * 0.5d0
else
tmp = z * ((z / (-2.0d0)) / y_m)
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 (z <= 2.3e-214) {
tmp = (x / y_m) * (x / 2.0);
} else if (z <= 1.02e-119) {
tmp = y_m * 0.5;
} else if (z <= 2.7e-14) {
tmp = (x * 0.5) / (y_m / x);
} else if (z <= 1.95e+32) {
tmp = y_m * 0.5;
} else if (z <= 1.45e+40) {
tmp = x * (x * (0.5 / y_m));
} else if (z <= 2.85e+60) {
tmp = z * (z * (-0.5 / y_m));
} else if ((z <= 3.3e+91) || (!(z <= 3.8e+134) && (z <= 1.1e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 z <= 2.3e-214: tmp = (x / y_m) * (x / 2.0) elif z <= 1.02e-119: tmp = y_m * 0.5 elif z <= 2.7e-14: tmp = (x * 0.5) / (y_m / x) elif z <= 1.95e+32: tmp = y_m * 0.5 elif z <= 1.45e+40: tmp = x * (x * (0.5 / y_m)) elif z <= 2.85e+60: tmp = z * (z * (-0.5 / y_m)) elif (z <= 3.3e+91) or (not (z <= 3.8e+134) and (z <= 1.1e+158)): tmp = y_m * 0.5 else: tmp = z * ((z / -2.0) / y_m) 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 (z <= 2.3e-214) tmp = Float64(Float64(x / y_m) * Float64(x / 2.0)); elseif (z <= 1.02e-119) tmp = Float64(y_m * 0.5); elseif (z <= 2.7e-14) tmp = Float64(Float64(x * 0.5) / Float64(y_m / x)); elseif (z <= 1.95e+32) tmp = Float64(y_m * 0.5); elseif (z <= 1.45e+40) tmp = Float64(x * Float64(x * Float64(0.5 / y_m))); elseif (z <= 2.85e+60) tmp = Float64(z * Float64(z * Float64(-0.5 / y_m))); elseif ((z <= 3.3e+91) || (!(z <= 3.8e+134) && (z <= 1.1e+158))) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(Float64(z / -2.0) / y_m)); 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 (z <= 2.3e-214) tmp = (x / y_m) * (x / 2.0); elseif (z <= 1.02e-119) tmp = y_m * 0.5; elseif (z <= 2.7e-14) tmp = (x * 0.5) / (y_m / x); elseif (z <= 1.95e+32) tmp = y_m * 0.5; elseif (z <= 1.45e+40) tmp = x * (x * (0.5 / y_m)); elseif (z <= 2.85e+60) tmp = z * (z * (-0.5 / y_m)); elseif ((z <= 3.3e+91) || (~((z <= 3.8e+134)) && (z <= 1.1e+158))) tmp = y_m * 0.5; else tmp = z * ((z / -2.0) / y_m); 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[z, 2.3e-214], N[(N[(x / y$95$m), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-119], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 2.7e-14], N[(N[(x * 0.5), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+32], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 1.45e+40], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e+60], N[(z * N[(z * N[(-0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.3e+91], And[N[Not[LessEqual[z, 3.8e+134]], $MachinePrecision], LessEqual[z, 1.1e+158]]], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(N[(z / -2.0), $MachinePrecision] / y$95$m), $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}\;z \leq 2.3 \cdot 10^{-214}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{2}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-119}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{x \cdot 0.5}{\frac{y\_m}{x}}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+32}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+60}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y\_m}\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+91} \lor \neg \left(z \leq 3.8 \cdot 10^{+134}\right) \land z \leq 1.1 \cdot 10^{+158}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\frac{z}{-2}}{y\_m}\\
\end{array}
\end{array}
if z < 2.30000000000000011e-214Initial program 70.5%
clear-num70.4%
inv-pow70.4%
associate-/l*70.0%
add-sqr-sqrt70.0%
pow270.0%
hypot-define70.0%
pow270.0%
Applied egg-rr70.0%
unpow-170.0%
associate-*r/70.4%
Simplified70.4%
Taylor expanded in x around inf 35.7%
associate-*r/35.7%
Simplified35.7%
clear-num35.7%
unpow235.7%
*-commutative35.7%
times-frac37.8%
Applied egg-rr37.8%
if 2.30000000000000011e-214 < z < 1.02e-119 or 2.6999999999999999e-14 < z < 1.95e32 or 2.84999999999999989e60 < z < 3.30000000000000017e91 or 3.79999999999999998e134 < z < 1.1000000000000001e158Initial program 63.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if 1.02e-119 < z < 2.6999999999999999e-14Initial program 90.5%
clear-num90.5%
inv-pow90.5%
associate-/l*90.6%
add-sqr-sqrt90.6%
pow290.6%
hypot-define90.6%
pow290.6%
Applied egg-rr90.6%
unpow-190.6%
associate-*r/90.5%
Simplified90.5%
Taylor expanded in x around inf 56.3%
associate-*r/56.3%
Simplified56.3%
clear-num56.4%
unpow256.4%
*-commutative56.4%
times-frac56.3%
Applied egg-rr56.3%
*-commutative56.3%
clear-num56.3%
un-div-inv56.3%
div-inv56.3%
metadata-eval56.3%
Applied egg-rr56.3%
if 1.95e32 < z < 1.45000000000000009e40Initial program 100.0%
clear-num100.0%
inv-pow100.0%
associate-/l*100.0%
add-sqr-sqrt100.0%
pow2100.0%
hypot-define100.0%
pow2100.0%
Applied egg-rr100.0%
unpow-1100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-*r/100.0%
Simplified100.0%
associate-/r/100.0%
*-commutative100.0%
metadata-eval100.0%
div-inv100.0%
clear-num100.0%
unpow2100.0%
associate-*r*100.0%
Applied egg-rr100.0%
if 1.45000000000000009e40 < z < 2.84999999999999989e60Initial program 54.0%
Taylor expanded in z around inf 50.6%
*-commutative50.6%
associate-*l/50.6%
Simplified50.6%
associate-/l*50.6%
pow250.6%
associate-*l*50.2%
Applied egg-rr50.2%
if 3.30000000000000017e91 < z < 3.79999999999999998e134 or 1.1000000000000001e158 < z Initial program 59.1%
Taylor expanded in z around inf 73.2%
*-commutative73.2%
associate-*l/73.2%
Simplified73.2%
associate-/l*73.2%
pow273.2%
associate-*l*79.8%
Applied egg-rr79.8%
clear-num79.8%
un-div-inv79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
*-commutative79.9%
associate-/r*79.9%
Simplified79.9%
Final simplification50.5%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= z 5e-215)
(* (/ x y_m) (/ x 2.0))
(if (<= z 8.6e-120)
(* y_m 0.5)
(if (<= z 6e-15)
(/ (* x 0.5) (/ y_m x))
(if (<= z 2e+32)
(* y_m 0.5)
(if (<= z 2.1e+36)
(* x (* x (/ 0.5 y_m)))
(if (<= z 2.65e+65)
(/ (* z (* z -0.5)) y_m)
(if (or (<= z 2.6e+92)
(and (not (<= z 2.05e+133)) (<= z 1.1e+158)))
(* y_m 0.5)
(* z (/ (/ z -2.0) y_m)))))))))))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 (z <= 5e-215) {
tmp = (x / y_m) * (x / 2.0);
} else if (z <= 8.6e-120) {
tmp = y_m * 0.5;
} else if (z <= 6e-15) {
tmp = (x * 0.5) / (y_m / x);
} else if (z <= 2e+32) {
tmp = y_m * 0.5;
} else if (z <= 2.1e+36) {
tmp = x * (x * (0.5 / y_m));
} else if (z <= 2.65e+65) {
tmp = (z * (z * -0.5)) / y_m;
} else if ((z <= 2.6e+92) || (!(z <= 2.05e+133) && (z <= 1.1e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 (z <= 5d-215) then
tmp = (x / y_m) * (x / 2.0d0)
else if (z <= 8.6d-120) then
tmp = y_m * 0.5d0
else if (z <= 6d-15) then
tmp = (x * 0.5d0) / (y_m / x)
else if (z <= 2d+32) then
tmp = y_m * 0.5d0
else if (z <= 2.1d+36) then
tmp = x * (x * (0.5d0 / y_m))
else if (z <= 2.65d+65) then
tmp = (z * (z * (-0.5d0))) / y_m
else if ((z <= 2.6d+92) .or. (.not. (z <= 2.05d+133)) .and. (z <= 1.1d+158)) then
tmp = y_m * 0.5d0
else
tmp = z * ((z / (-2.0d0)) / y_m)
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 (z <= 5e-215) {
tmp = (x / y_m) * (x / 2.0);
} else if (z <= 8.6e-120) {
tmp = y_m * 0.5;
} else if (z <= 6e-15) {
tmp = (x * 0.5) / (y_m / x);
} else if (z <= 2e+32) {
tmp = y_m * 0.5;
} else if (z <= 2.1e+36) {
tmp = x * (x * (0.5 / y_m));
} else if (z <= 2.65e+65) {
tmp = (z * (z * -0.5)) / y_m;
} else if ((z <= 2.6e+92) || (!(z <= 2.05e+133) && (z <= 1.1e+158))) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 z <= 5e-215: tmp = (x / y_m) * (x / 2.0) elif z <= 8.6e-120: tmp = y_m * 0.5 elif z <= 6e-15: tmp = (x * 0.5) / (y_m / x) elif z <= 2e+32: tmp = y_m * 0.5 elif z <= 2.1e+36: tmp = x * (x * (0.5 / y_m)) elif z <= 2.65e+65: tmp = (z * (z * -0.5)) / y_m elif (z <= 2.6e+92) or (not (z <= 2.05e+133) and (z <= 1.1e+158)): tmp = y_m * 0.5 else: tmp = z * ((z / -2.0) / y_m) 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 (z <= 5e-215) tmp = Float64(Float64(x / y_m) * Float64(x / 2.0)); elseif (z <= 8.6e-120) tmp = Float64(y_m * 0.5); elseif (z <= 6e-15) tmp = Float64(Float64(x * 0.5) / Float64(y_m / x)); elseif (z <= 2e+32) tmp = Float64(y_m * 0.5); elseif (z <= 2.1e+36) tmp = Float64(x * Float64(x * Float64(0.5 / y_m))); elseif (z <= 2.65e+65) tmp = Float64(Float64(z * Float64(z * -0.5)) / y_m); elseif ((z <= 2.6e+92) || (!(z <= 2.05e+133) && (z <= 1.1e+158))) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(Float64(z / -2.0) / y_m)); 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 (z <= 5e-215) tmp = (x / y_m) * (x / 2.0); elseif (z <= 8.6e-120) tmp = y_m * 0.5; elseif (z <= 6e-15) tmp = (x * 0.5) / (y_m / x); elseif (z <= 2e+32) tmp = y_m * 0.5; elseif (z <= 2.1e+36) tmp = x * (x * (0.5 / y_m)); elseif (z <= 2.65e+65) tmp = (z * (z * -0.5)) / y_m; elseif ((z <= 2.6e+92) || (~((z <= 2.05e+133)) && (z <= 1.1e+158))) tmp = y_m * 0.5; else tmp = z * ((z / -2.0) / y_m); 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[z, 5e-215], N[(N[(x / y$95$m), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e-120], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 6e-15], N[(N[(x * 0.5), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+32], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 2.1e+36], N[(x * N[(x * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e+65], N[(N[(z * N[(z * -0.5), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[Or[LessEqual[z, 2.6e+92], And[N[Not[LessEqual[z, 2.05e+133]], $MachinePrecision], LessEqual[z, 1.1e+158]]], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(N[(z / -2.0), $MachinePrecision] / y$95$m), $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}\;z \leq 5 \cdot 10^{-215}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{2}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-120}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-15}:\\
\;\;\;\;\frac{x \cdot 0.5}{\frac{y\_m}{x}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+32}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y\_m}\right)\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+65}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot -0.5\right)}{y\_m}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+92} \lor \neg \left(z \leq 2.05 \cdot 10^{+133}\right) \land z \leq 1.1 \cdot 10^{+158}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\frac{z}{-2}}{y\_m}\\
\end{array}
\end{array}
if z < 4.99999999999999956e-215Initial program 70.5%
clear-num70.4%
inv-pow70.4%
associate-/l*70.0%
add-sqr-sqrt70.0%
pow270.0%
hypot-define70.0%
pow270.0%
Applied egg-rr70.0%
unpow-170.0%
associate-*r/70.4%
Simplified70.4%
Taylor expanded in x around inf 35.7%
associate-*r/35.7%
Simplified35.7%
clear-num35.7%
unpow235.7%
*-commutative35.7%
times-frac37.8%
Applied egg-rr37.8%
if 4.99999999999999956e-215 < z < 8.59999999999999964e-120 or 6e-15 < z < 2.00000000000000011e32 or 2.65000000000000011e65 < z < 2.5999999999999999e92 or 2.05000000000000002e133 < z < 1.1000000000000001e158Initial program 63.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if 8.59999999999999964e-120 < z < 6e-15Initial program 90.5%
clear-num90.5%
inv-pow90.5%
associate-/l*90.6%
add-sqr-sqrt90.6%
pow290.6%
hypot-define90.6%
pow290.6%
Applied egg-rr90.6%
unpow-190.6%
associate-*r/90.5%
Simplified90.5%
Taylor expanded in x around inf 56.3%
associate-*r/56.3%
Simplified56.3%
clear-num56.4%
unpow256.4%
*-commutative56.4%
times-frac56.3%
Applied egg-rr56.3%
*-commutative56.3%
clear-num56.3%
un-div-inv56.3%
div-inv56.3%
metadata-eval56.3%
Applied egg-rr56.3%
if 2.00000000000000011e32 < z < 2.10000000000000004e36Initial program 100.0%
clear-num100.0%
inv-pow100.0%
associate-/l*100.0%
add-sqr-sqrt100.0%
pow2100.0%
hypot-define100.0%
pow2100.0%
Applied egg-rr100.0%
unpow-1100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
associate-*r/100.0%
Simplified100.0%
associate-/r/100.0%
*-commutative100.0%
metadata-eval100.0%
div-inv100.0%
clear-num100.0%
unpow2100.0%
associate-*r*100.0%
Applied egg-rr100.0%
if 2.10000000000000004e36 < z < 2.65000000000000011e65Initial program 54.0%
Taylor expanded in z around inf 50.6%
*-commutative50.6%
associate-*l/50.6%
Simplified50.6%
associate-/l*50.6%
pow250.6%
associate-*l*50.2%
Applied egg-rr50.2%
*-commutative50.2%
associate-*r/50.2%
associate-*l/50.6%
Applied egg-rr50.6%
if 2.5999999999999999e92 < z < 2.05000000000000002e133 or 1.1000000000000001e158 < z Initial program 59.1%
Taylor expanded in z around inf 73.2%
*-commutative73.2%
associate-*l/73.2%
Simplified73.2%
associate-/l*73.2%
pow273.2%
associate-*l*79.8%
Applied egg-rr79.8%
clear-num79.8%
un-div-inv79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
*-commutative79.9%
associate-/r*79.9%
Simplified79.9%
Final simplification50.5%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= y_m 3.65e+121)
(/ (- (+ (* x x) (* y_m y_m)) (* z z)) (* y_m 2.0))
(* 0.5 (- y_m (* z (/ z y_m)))))))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.65e+121) {
tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
} else {
tmp = 0.5 * (y_m - (z * (z / y_m)));
}
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.65d+121) then
tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0d0)
else
tmp = 0.5d0 * (y_m - (z * (z / y_m)))
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.65e+121) {
tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
} else {
tmp = 0.5 * (y_m - (z * (z / y_m)));
}
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.65e+121: tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0) else: tmp = 0.5 * (y_m - (z * (z / y_m))) 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.65e+121) tmp = Float64(Float64(Float64(Float64(x * x) + Float64(y_m * y_m)) - Float64(z * z)) / Float64(y_m * 2.0)); else tmp = Float64(0.5 * Float64(y_m - Float64(z * Float64(z / y_m)))); 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.65e+121) tmp = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0); else tmp = 0.5 * (y_m - (z * (z / y_m))); 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.65e+121], 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[(0.5 * N[(y$95$m - N[(z * N[(z / y$95$m), $MachinePrecision]), $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}\;y\_m \leq 3.65 \cdot 10^{+121}:\\
\;\;\;\;\frac{\left(x \cdot x + y\_m \cdot y\_m\right) - z \cdot z}{y\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y\_m - z \cdot \frac{z}{y\_m}\right)\\
\end{array}
\end{array}
if y < 3.65e121Initial program 78.9%
if 3.65e121 < y Initial program 18.9%
remove-double-neg18.9%
distribute-lft-neg-out18.9%
distribute-frac-neg218.9%
distribute-frac-neg18.9%
neg-mul-118.9%
distribute-lft-neg-out18.9%
*-commutative18.9%
distribute-lft-neg-in18.9%
times-frac18.9%
metadata-eval18.9%
metadata-eval18.9%
associate--l+18.9%
fma-define21.4%
Simplified21.4%
Taylor expanded in x around 0 21.4%
div-sub21.4%
unpow221.4%
associate-/l*79.3%
*-inverses79.3%
*-rgt-identity79.3%
Simplified79.3%
unpow279.3%
associate-/l*93.1%
Applied egg-rr93.1%
Final simplification81.2%
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
:precision binary64
(*
y_s
(if (<= x 1.25e+172)
(* 0.5 (- y_m (* z (/ z y_m))))
(/ (* x 0.5) (/ y_m 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.25e+172) {
tmp = 0.5 * (y_m - (z * (z / y_m)));
} else {
tmp = (x * 0.5) / (y_m / 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.25d+172) then
tmp = 0.5d0 * (y_m - (z * (z / y_m)))
else
tmp = (x * 0.5d0) / (y_m / 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.25e+172) {
tmp = 0.5 * (y_m - (z * (z / y_m)));
} else {
tmp = (x * 0.5) / (y_m / 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.25e+172: tmp = 0.5 * (y_m - (z * (z / y_m))) else: tmp = (x * 0.5) / (y_m / 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.25e+172) tmp = Float64(0.5 * Float64(y_m - Float64(z * Float64(z / y_m)))); else tmp = Float64(Float64(x * 0.5) / Float64(y_m / 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.25e+172) tmp = 0.5 * (y_m - (z * (z / y_m))); else tmp = (x * 0.5) / (y_m / 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.25e+172], N[(0.5 * N[(y$95$m - N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 0.5), $MachinePrecision] / N[(y$95$m / x), $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.25 \cdot 10^{+172}:\\
\;\;\;\;0.5 \cdot \left(y\_m - z \cdot \frac{z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 0.5}{\frac{y\_m}{x}}\\
\end{array}
\end{array}
if x < 1.25e172Initial program 71.1%
remove-double-neg71.1%
distribute-lft-neg-out71.1%
distribute-frac-neg271.1%
distribute-frac-neg71.1%
neg-mul-171.1%
distribute-lft-neg-out71.1%
*-commutative71.1%
distribute-lft-neg-in71.1%
times-frac71.1%
metadata-eval71.1%
metadata-eval71.1%
associate--l+71.1%
fma-define73.2%
Simplified73.2%
Taylor expanded in x around 0 49.1%
div-sub49.2%
unpow249.2%
associate-/l*67.5%
*-inverses67.5%
*-rgt-identity67.5%
Simplified67.5%
unpow267.5%
associate-/l*71.6%
Applied egg-rr71.6%
if 1.25e172 < x Initial program 53.3%
clear-num53.3%
inv-pow53.3%
associate-/l*53.3%
add-sqr-sqrt53.3%
pow253.3%
hypot-define53.3%
pow253.3%
Applied egg-rr53.3%
unpow-153.3%
associate-*r/53.3%
Simplified53.3%
Taylor expanded in x around inf 61.8%
associate-*r/61.8%
Simplified61.8%
clear-num61.8%
unpow261.8%
*-commutative61.8%
times-frac67.8%
Applied egg-rr67.8%
*-commutative67.8%
clear-num67.8%
un-div-inv67.9%
div-inv67.9%
metadata-eval67.9%
Applied egg-rr67.9%
Final simplification71.3%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= z 4.8e+91) (* y_m 0.5) (* z (* z (/ -0.5 y_m))))))
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 (z <= 4.8e+91) {
tmp = y_m * 0.5;
} else {
tmp = z * (z * (-0.5 / y_m));
}
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 (z <= 4.8d+91) then
tmp = y_m * 0.5d0
else
tmp = z * (z * ((-0.5d0) / y_m))
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 (z <= 4.8e+91) {
tmp = y_m * 0.5;
} else {
tmp = z * (z * (-0.5 / y_m));
}
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 z <= 4.8e+91: tmp = y_m * 0.5 else: tmp = z * (z * (-0.5 / y_m)) 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 (z <= 4.8e+91) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(z * Float64(-0.5 / y_m))); 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 (z <= 4.8e+91) tmp = y_m * 0.5; else tmp = z * (z * (-0.5 / y_m)); 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[z, 4.8e+91], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(z * N[(-0.5 / y$95$m), $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}\;z \leq 4.8 \cdot 10^{+91}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{-0.5}{y\_m}\right)\\
\end{array}
\end{array}
if z < 4.79999999999999966e91Initial program 70.8%
Taylor expanded in y around inf 38.3%
*-commutative38.3%
Simplified38.3%
if 4.79999999999999966e91 < z Initial program 61.9%
Taylor expanded in z around inf 66.7%
*-commutative66.7%
associate-*l/66.7%
Simplified66.7%
associate-/l*66.7%
pow266.7%
associate-*l*72.6%
Applied egg-rr72.6%
Final simplification43.8%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) y) (FPCore (y_s x y_m z) :precision binary64 (* y_s (if (<= z 1.1e+93) (* y_m 0.5) (* z (/ (/ z -2.0) y_m)))))
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 (z <= 1.1e+93) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 (z <= 1.1d+93) then
tmp = y_m * 0.5d0
else
tmp = z * ((z / (-2.0d0)) / y_m)
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 (z <= 1.1e+93) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / -2.0) / y_m);
}
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 z <= 1.1e+93: tmp = y_m * 0.5 else: tmp = z * ((z / -2.0) / y_m) 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 (z <= 1.1e+93) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(Float64(z / -2.0) / y_m)); 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 (z <= 1.1e+93) tmp = y_m * 0.5; else tmp = z * ((z / -2.0) / y_m); 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[z, 1.1e+93], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(N[(z / -2.0), $MachinePrecision] / y$95$m), $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}\;z \leq 1.1 \cdot 10^{+93}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\frac{z}{-2}}{y\_m}\\
\end{array}
\end{array}
if z < 1.10000000000000011e93Initial program 70.8%
Taylor expanded in y around inf 38.3%
*-commutative38.3%
Simplified38.3%
if 1.10000000000000011e93 < z Initial program 61.9%
Taylor expanded in z around inf 66.7%
*-commutative66.7%
associate-*l/66.7%
Simplified66.7%
associate-/l*66.7%
pow266.7%
associate-*l*72.6%
Applied egg-rr72.6%
clear-num72.6%
un-div-inv72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
*-commutative72.6%
associate-/r*72.6%
Simplified72.6%
Final simplification43.8%
y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) 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 69.3%
Taylor expanded in y around inf 34.4%
*-commutative34.4%
Simplified34.4%
Final simplification34.4%
(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 2024078
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
:precision binary64
:alt
(- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))