
(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 16 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
(*
y_s
(if (<= y_m 5.3e-252)
(* 0.5 (* (+ z x) (* (- x z) (/ 1.0 y_m))))
(* y_m (+ 0.5 (* 0.5 (* (/ (- x z) y_m) (/ (+ z x) 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 <= 5.3e-252) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else {
tmp = y_m * (0.5 + (0.5 * (((x - z) / y_m) * ((z + x) / 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 <= 5.3d-252) then
tmp = 0.5d0 * ((z + x) * ((x - z) * (1.0d0 / y_m)))
else
tmp = y_m * (0.5d0 + (0.5d0 * (((x - z) / y_m) * ((z + x) / 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 <= 5.3e-252) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else {
tmp = y_m * (0.5 + (0.5 * (((x - z) / y_m) * ((z + x) / 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 <= 5.3e-252: tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))) else: tmp = y_m * (0.5 + (0.5 * (((x - z) / y_m) * ((z + x) / 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 <= 5.3e-252) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) * Float64(1.0 / y_m)))); else tmp = Float64(y_m * Float64(0.5 + Float64(0.5 * Float64(Float64(Float64(x - z) / y_m) * Float64(Float64(z + x) / 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 <= 5.3e-252) tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))); else tmp = y_m * (0.5 + (0.5 * (((x - z) / y_m) * ((z + x) / 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, 5.3e-252], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] * N[(1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(0.5 + N[(0.5 * N[(N[(N[(x - z), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(N[(z + x), $MachinePrecision] / y$95$m), $MachinePrecision]), $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 5.3 \cdot 10^{-252}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \left(\left(x - z\right) \cdot \frac{1}{y\_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(0.5 + 0.5 \cdot \left(\frac{x - z}{y\_m} \cdot \frac{z + x}{y\_m}\right)\right)\\
\end{array}
\end{array}
if y < 5.30000000000000022e-252Initial program 71.9%
Taylor expanded in y around inf 74.0%
*-commutative74.0%
Simplified74.0%
unpow274.0%
unpow274.0%
difference-of-squares77.1%
Applied egg-rr77.1%
Taylor expanded in y around 0 66.8%
associate-/l*73.8%
+-commutative73.8%
Simplified73.8%
div-inv73.8%
Applied egg-rr73.8%
if 5.30000000000000022e-252 < y Initial program 66.8%
Taylor expanded in y around inf 69.1%
*-commutative69.1%
Simplified69.1%
unpow269.1%
unpow269.1%
difference-of-squares69.9%
Applied egg-rr69.9%
*-commutative69.9%
unpow269.9%
times-frac95.3%
Applied egg-rr95.3%
Final simplification84.1%
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 (/ (- x z) y_m)))
(*
y_s
(if (<= t_0 -2e+189)
(* 0.5 (* (+ z x) t_1))
(if (<= t_0 1e-119)
(* y_m (- 0.5 (* 0.5 (* (/ z y_m) (/ z y_m)))))
(if (<= t_0 INFINITY)
(* y_m (+ 0.5 (* 0.5 (* (/ (+ z x) y_m) (/ x y_m)))))
(* y_m (+ 0.5 (* 0.5 (* t_1 (/ 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 t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0);
double t_1 = (x - z) / y_m;
double tmp;
if (t_0 <= -2e+189) {
tmp = 0.5 * ((z + x) * t_1);
} else if (t_0 <= 1e-119) {
tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m))));
} else {
tmp = y_m * (0.5 + (0.5 * (t_1 * (z / y_m))));
}
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 = (x - z) / y_m;
double tmp;
if (t_0 <= -2e+189) {
tmp = 0.5 * ((z + x) * t_1);
} else if (t_0 <= 1e-119) {
tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m))));
} else {
tmp = y_m * (0.5 + (0.5 * (t_1 * (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): t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0) t_1 = (x - z) / y_m tmp = 0 if t_0 <= -2e+189: tmp = 0.5 * ((z + x) * t_1) elif t_0 <= 1e-119: tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m)))) elif t_0 <= math.inf: tmp = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m)))) else: tmp = y_m * (0.5 + (0.5 * (t_1 * (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) t_0 = Float64(Float64(Float64(Float64(x * x) + Float64(y_m * y_m)) - Float64(z * z)) / Float64(y_m * 2.0)) t_1 = Float64(Float64(x - z) / y_m) tmp = 0.0 if (t_0 <= -2e+189) tmp = Float64(0.5 * Float64(Float64(z + x) * t_1)); elseif (t_0 <= 1e-119) tmp = Float64(y_m * Float64(0.5 - Float64(0.5 * Float64(Float64(z / y_m) * Float64(z / y_m))))); elseif (t_0 <= Inf) tmp = Float64(y_m * Float64(0.5 + Float64(0.5 * Float64(Float64(Float64(z + x) / y_m) * Float64(x / y_m))))); else tmp = Float64(y_m * Float64(0.5 + Float64(0.5 * Float64(t_1 * 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) t_0 = (((x * x) + (y_m * y_m)) - (z * z)) / (y_m * 2.0); t_1 = (x - z) / y_m; tmp = 0.0; if (t_0 <= -2e+189) tmp = 0.5 * ((z + x) * t_1); elseif (t_0 <= 1e-119) tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m)))); elseif (t_0 <= Inf) tmp = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m)))); else tmp = y_m * (0.5 + (0.5 * (t_1 * (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_] := 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[(N[(x - z), $MachinePrecision] / y$95$m), $MachinePrecision]}, N[(y$95$s * If[LessEqual[t$95$0, -2e+189], N[(0.5 * N[(N[(z + x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-119], N[(y$95$m * N[(0.5 - N[(0.5 * N[(N[(z / y$95$m), $MachinePrecision] * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(y$95$m * N[(0.5 + N[(0.5 * N[(N[(N[(z + x), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(0.5 + N[(0.5 * N[(t$95$1 * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $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 := \frac{x - z}{y\_m}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+189}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot t\_1\right)\\
\mathbf{elif}\;t\_0 \leq 10^{-119}:\\
\;\;\;\;y\_m \cdot \left(0.5 - 0.5 \cdot \left(\frac{z}{y\_m} \cdot \frac{z}{y\_m}\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;y\_m \cdot \left(0.5 + 0.5 \cdot \left(\frac{z + x}{y\_m} \cdot \frac{x}{y\_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(0.5 + 0.5 \cdot \left(t\_1 \cdot \frac{z}{y\_m}\right)\right)\\
\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))) < -2e189Initial program 71.0%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
Simplified80.4%
unpow280.4%
unpow280.4%
difference-of-squares80.4%
Applied egg-rr80.4%
Taylor expanded in y around 0 70.1%
associate-/l*76.3%
+-commutative76.3%
Simplified76.3%
if -2e189 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < 1.00000000000000001e-119Initial program 81.7%
Taylor expanded in y around inf 65.1%
*-commutative65.1%
Simplified65.1%
unpow265.1%
unpow265.1%
difference-of-squares65.2%
Applied egg-rr65.2%
*-commutative65.2%
unpow265.2%
times-frac96.9%
Applied egg-rr96.9%
Taylor expanded in x around 0 71.0%
Taylor expanded in x around 0 71.7%
neg-mul-171.7%
distribute-neg-frac271.7%
Simplified71.7%
if 1.00000000000000001e-119 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) < +inf.0Initial program 79.1%
Taylor expanded in y around inf 83.3%
*-commutative83.3%
Simplified83.3%
unpow283.3%
unpow283.3%
difference-of-squares83.3%
Applied egg-rr83.3%
*-commutative83.3%
unpow283.3%
times-frac95.9%
Applied egg-rr95.9%
Taylor expanded in x around inf 75.3%
if +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 x x) (*.f64 y y)) (*.f64 z z)) (*.f64 y #s(literal 2 binary64))) Initial program 0.0%
Taylor expanded in y around inf 0.0%
*-commutative0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares20.0%
Applied egg-rr20.0%
*-commutative20.0%
unpow220.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 91.9%
Final simplification76.7%
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 (* 0.5 (/ (* z (- x z)) y_m))))
(*
y_s
(if (<= y_m 6.2e-120)
t_0
(if (<= y_m 4.4e-69)
(* 0.5 (/ (- x z) (/ y_m x)))
(if (<= y_m 4.1e-20)
t_0
(if (or (<= y_m 1.5e+84)
(not
(or (<= y_m 3.3e+122)
(and (not (<= y_m 3e+155)) (<= y_m 3.1e+155)))))
(* 0.5 (+ y_m (* z (/ x y_m))))
(* z (* (/ z 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 t_0 = 0.5 * ((z * (x - z)) / y_m);
double tmp;
if (y_m <= 6.2e-120) {
tmp = t_0;
} else if (y_m <= 4.4e-69) {
tmp = 0.5 * ((x - z) / (y_m / x));
} else if (y_m <= 4.1e-20) {
tmp = t_0;
} else if ((y_m <= 1.5e+84) || !((y_m <= 3.3e+122) || (!(y_m <= 3e+155) && (y_m <= 3.1e+155)))) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else {
tmp = z * ((z / 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) :: t_0
real(8) :: tmp
t_0 = 0.5d0 * ((z * (x - z)) / y_m)
if (y_m <= 6.2d-120) then
tmp = t_0
else if (y_m <= 4.4d-69) then
tmp = 0.5d0 * ((x - z) / (y_m / x))
else if (y_m <= 4.1d-20) then
tmp = t_0
else if ((y_m <= 1.5d+84) .or. (.not. (y_m <= 3.3d+122) .or. (.not. (y_m <= 3d+155)) .and. (y_m <= 3.1d+155))) then
tmp = 0.5d0 * (y_m + (z * (x / y_m)))
else
tmp = z * ((z / 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 t_0 = 0.5 * ((z * (x - z)) / y_m);
double tmp;
if (y_m <= 6.2e-120) {
tmp = t_0;
} else if (y_m <= 4.4e-69) {
tmp = 0.5 * ((x - z) / (y_m / x));
} else if (y_m <= 4.1e-20) {
tmp = t_0;
} else if ((y_m <= 1.5e+84) || !((y_m <= 3.3e+122) || (!(y_m <= 3e+155) && (y_m <= 3.1e+155)))) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else {
tmp = z * ((z / 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): t_0 = 0.5 * ((z * (x - z)) / y_m) tmp = 0 if y_m <= 6.2e-120: tmp = t_0 elif y_m <= 4.4e-69: tmp = 0.5 * ((x - z) / (y_m / x)) elif y_m <= 4.1e-20: tmp = t_0 elif (y_m <= 1.5e+84) or not ((y_m <= 3.3e+122) or (not (y_m <= 3e+155) and (y_m <= 3.1e+155))): tmp = 0.5 * (y_m + (z * (x / y_m))) else: tmp = z * ((z / 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) t_0 = Float64(0.5 * Float64(Float64(z * Float64(x - z)) / y_m)) tmp = 0.0 if (y_m <= 6.2e-120) tmp = t_0; elseif (y_m <= 4.4e-69) tmp = Float64(0.5 * Float64(Float64(x - z) / Float64(y_m / x))); elseif (y_m <= 4.1e-20) tmp = t_0; elseif ((y_m <= 1.5e+84) || !((y_m <= 3.3e+122) || (!(y_m <= 3e+155) && (y_m <= 3.1e+155)))) tmp = Float64(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))); else tmp = Float64(z * Float64(Float64(z / 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) t_0 = 0.5 * ((z * (x - z)) / y_m); tmp = 0.0; if (y_m <= 6.2e-120) tmp = t_0; elseif (y_m <= 4.4e-69) tmp = 0.5 * ((x - z) / (y_m / x)); elseif (y_m <= 4.1e-20) tmp = t_0; elseif ((y_m <= 1.5e+84) || ~(((y_m <= 3.3e+122) || (~((y_m <= 3e+155)) && (y_m <= 3.1e+155))))) tmp = 0.5 * (y_m + (z * (x / y_m))); else tmp = z * ((z / 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_] := Block[{t$95$0 = N[(0.5 * N[(N[(z * N[(x - z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 6.2e-120], t$95$0, If[LessEqual[y$95$m, 4.4e-69], N[(0.5 * N[(N[(x - z), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 4.1e-20], t$95$0, If[Or[LessEqual[y$95$m, 1.5e+84], N[Not[Or[LessEqual[y$95$m, 3.3e+122], And[N[Not[LessEqual[y$95$m, 3e+155]], $MachinePrecision], LessEqual[y$95$m, 3.1e+155]]]], $MachinePrecision]], N[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(z / y$95$m), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{z \cdot \left(x - z\right)}{y\_m}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 6.2 \cdot 10^{-120}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y\_m \leq 4.4 \cdot 10^{-69}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{\frac{y\_m}{x}}\\
\mathbf{elif}\;y\_m \leq 4.1 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y\_m \leq 1.5 \cdot 10^{+84} \lor \neg \left(y\_m \leq 3.3 \cdot 10^{+122} \lor \neg \left(y\_m \leq 3 \cdot 10^{+155}\right) \land y\_m \leq 3.1 \cdot 10^{+155}\right):\\
\;\;\;\;0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{z}{y\_m} \cdot -0.5\right)\\
\end{array}
\end{array}
\end{array}
if y < 6.20000000000000038e-120 or 4.4e-69 < y < 4.1000000000000001e-20Initial program 76.9%
Taylor expanded in y around inf 72.9%
*-commutative72.9%
Simplified72.9%
unpow272.9%
unpow272.9%
difference-of-squares75.2%
Applied egg-rr75.2%
*-commutative75.2%
unpow275.2%
times-frac94.6%
Applied egg-rr94.6%
Taylor expanded in x around 0 72.2%
Taylor expanded in y around 0 47.3%
if 6.20000000000000038e-120 < y < 4.4e-69Initial program 90.5%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
Simplified81.6%
unpow281.6%
unpow281.6%
difference-of-squares90.7%
Applied egg-rr90.7%
Taylor expanded in y around 0 99.6%
associate-/l*99.6%
+-commutative99.6%
Simplified99.6%
associate-*r/99.6%
+-commutative99.6%
div-inv99.6%
*-commutative99.6%
associate-*r*99.6%
div-inv99.9%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 46.8%
if 4.1000000000000001e-20 < y < 1.49999999999999998e84 or 3.2999999999999999e122 < y < 3.0000000000000001e155 or 3.09999999999999989e155 < y Initial program 43.3%
Taylor expanded in y around inf 66.6%
*-commutative66.6%
Simplified66.6%
unpow266.6%
unpow266.6%
difference-of-squares66.6%
Applied egg-rr66.6%
*-commutative66.6%
unpow266.6%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 81.7%
Taylor expanded in z around 0 65.1%
+-commutative65.1%
associate-*l/68.6%
distribute-lft-out68.6%
*-commutative68.6%
Simplified68.6%
if 1.49999999999999998e84 < y < 3.2999999999999999e122 or 3.0000000000000001e155 < y < 3.09999999999999989e155Initial program 67.3%
Taylor expanded in y around inf 67.3%
*-commutative67.3%
Simplified67.3%
unpow267.3%
unpow267.3%
difference-of-squares67.3%
Applied egg-rr67.3%
Taylor expanded in y around 0 68.2%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
associate-*r/68.2%
+-commutative68.2%
div-inv68.4%
*-commutative68.4%
associate-*r*99.7%
div-inv100.0%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 66.6%
associate-*r/66.6%
div-inv66.3%
associate-/r*66.8%
*-commutative66.8%
Applied egg-rr66.8%
associate-/r/67.0%
/-rgt-identity67.0%
associate-/l*66.8%
Applied egg-rr66.8%
Taylor expanded in x around 0 67.2%
Final simplification52.7%
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 (* 0.5 (+ y_m (* z (/ x y_m)))))
(t_1 (* 0.5 (/ (- x z) (/ y_m x)))))
(*
y_s
(if (<= y_m 6.5e-120)
(* z (* (- x z) (/ 0.5 y_m)))
(if (<= y_m 1.9e-64)
t_1
(if (<= y_m 3.1e-20)
(* (- x z) (* 0.5 (/ z y_m)))
(if (<= y_m 4.7e+81)
t_0
(if (<= y_m 2.8e+94)
(* 0.5 (/ (* z (- x z)) y_m))
(if (<= y_m 1.85e+106)
t_1
(if (<= y_m 2.7e+124) (* z (* (/ z y_m) -0.5)) t_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 = 0.5 * (y_m + (z * (x / y_m)));
double t_1 = 0.5 * ((x - z) / (y_m / x));
double tmp;
if (y_m <= 6.5e-120) {
tmp = z * ((x - z) * (0.5 / y_m));
} else if (y_m <= 1.9e-64) {
tmp = t_1;
} else if (y_m <= 3.1e-20) {
tmp = (x - z) * (0.5 * (z / y_m));
} else if (y_m <= 4.7e+81) {
tmp = t_0;
} else if (y_m <= 2.8e+94) {
tmp = 0.5 * ((z * (x - z)) / y_m);
} else if (y_m <= 1.85e+106) {
tmp = t_1;
} else if (y_m <= 2.7e+124) {
tmp = z * ((z / y_m) * -0.5);
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * (y_m + (z * (x / y_m)))
t_1 = 0.5d0 * ((x - z) / (y_m / x))
if (y_m <= 6.5d-120) then
tmp = z * ((x - z) * (0.5d0 / y_m))
else if (y_m <= 1.9d-64) then
tmp = t_1
else if (y_m <= 3.1d-20) then
tmp = (x - z) * (0.5d0 * (z / y_m))
else if (y_m <= 4.7d+81) then
tmp = t_0
else if (y_m <= 2.8d+94) then
tmp = 0.5d0 * ((z * (x - z)) / y_m)
else if (y_m <= 1.85d+106) then
tmp = t_1
else if (y_m <= 2.7d+124) then
tmp = z * ((z / y_m) * (-0.5d0))
else
tmp = t_0
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 = 0.5 * (y_m + (z * (x / y_m)));
double t_1 = 0.5 * ((x - z) / (y_m / x));
double tmp;
if (y_m <= 6.5e-120) {
tmp = z * ((x - z) * (0.5 / y_m));
} else if (y_m <= 1.9e-64) {
tmp = t_1;
} else if (y_m <= 3.1e-20) {
tmp = (x - z) * (0.5 * (z / y_m));
} else if (y_m <= 4.7e+81) {
tmp = t_0;
} else if (y_m <= 2.8e+94) {
tmp = 0.5 * ((z * (x - z)) / y_m);
} else if (y_m <= 1.85e+106) {
tmp = t_1;
} else if (y_m <= 2.7e+124) {
tmp = z * ((z / y_m) * -0.5);
} else {
tmp = t_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 = 0.5 * (y_m + (z * (x / y_m))) t_1 = 0.5 * ((x - z) / (y_m / x)) tmp = 0 if y_m <= 6.5e-120: tmp = z * ((x - z) * (0.5 / y_m)) elif y_m <= 1.9e-64: tmp = t_1 elif y_m <= 3.1e-20: tmp = (x - z) * (0.5 * (z / y_m)) elif y_m <= 4.7e+81: tmp = t_0 elif y_m <= 2.8e+94: tmp = 0.5 * ((z * (x - z)) / y_m) elif y_m <= 1.85e+106: tmp = t_1 elif y_m <= 2.7e+124: tmp = z * ((z / y_m) * -0.5) else: tmp = t_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(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))) t_1 = Float64(0.5 * Float64(Float64(x - z) / Float64(y_m / x))) tmp = 0.0 if (y_m <= 6.5e-120) tmp = Float64(z * Float64(Float64(x - z) * Float64(0.5 / y_m))); elseif (y_m <= 1.9e-64) tmp = t_1; elseif (y_m <= 3.1e-20) tmp = Float64(Float64(x - z) * Float64(0.5 * Float64(z / y_m))); elseif (y_m <= 4.7e+81) tmp = t_0; elseif (y_m <= 2.8e+94) tmp = Float64(0.5 * Float64(Float64(z * Float64(x - z)) / y_m)); elseif (y_m <= 1.85e+106) tmp = t_1; elseif (y_m <= 2.7e+124) tmp = Float64(z * Float64(Float64(z / y_m) * -0.5)); else tmp = t_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 = 0.5 * (y_m + (z * (x / y_m))); t_1 = 0.5 * ((x - z) / (y_m / x)); tmp = 0.0; if (y_m <= 6.5e-120) tmp = z * ((x - z) * (0.5 / y_m)); elseif (y_m <= 1.9e-64) tmp = t_1; elseif (y_m <= 3.1e-20) tmp = (x - z) * (0.5 * (z / y_m)); elseif (y_m <= 4.7e+81) tmp = t_0; elseif (y_m <= 2.8e+94) tmp = 0.5 * ((z * (x - z)) / y_m); elseif (y_m <= 1.85e+106) tmp = t_1; elseif (y_m <= 2.7e+124) tmp = z * ((z / y_m) * -0.5); else tmp = t_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[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(N[(x - z), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 6.5e-120], N[(z * N[(N[(x - z), $MachinePrecision] * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.9e-64], t$95$1, If[LessEqual[y$95$m, 3.1e-20], N[(N[(x - z), $MachinePrecision] * N[(0.5 * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 4.7e+81], t$95$0, If[LessEqual[y$95$m, 2.8e+94], N[(0.5 * N[(N[(z * N[(x - z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.85e+106], t$95$1, If[LessEqual[y$95$m, 2.7e+124], N[(z * N[(N[(z / y$95$m), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
t_1 := 0.5 \cdot \frac{x - z}{\frac{y\_m}{x}}\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 6.5 \cdot 10^{-120}:\\
\;\;\;\;z \cdot \left(\left(x - z\right) \cdot \frac{0.5}{y\_m}\right)\\
\mathbf{elif}\;y\_m \leq 1.9 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y\_m \leq 3.1 \cdot 10^{-20}:\\
\;\;\;\;\left(x - z\right) \cdot \left(0.5 \cdot \frac{z}{y\_m}\right)\\
\mathbf{elif}\;y\_m \leq 4.7 \cdot 10^{+81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y\_m \leq 2.8 \cdot 10^{+94}:\\
\;\;\;\;0.5 \cdot \frac{z \cdot \left(x - z\right)}{y\_m}\\
\mathbf{elif}\;y\_m \leq 1.85 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y\_m \leq 2.7 \cdot 10^{+124}:\\
\;\;\;\;z \cdot \left(\frac{z}{y\_m} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if y < 6.50000000000000029e-120Initial program 75.0%
Taylor expanded in y around inf 70.6%
*-commutative70.6%
Simplified70.6%
unpow270.6%
unpow270.6%
difference-of-squares73.1%
Applied egg-rr73.1%
Taylor expanded in y around 0 70.9%
associate-/l*77.1%
+-commutative77.1%
Simplified77.1%
associate-*r/70.9%
+-commutative70.9%
div-inv70.9%
*-commutative70.9%
associate-*r*77.1%
div-inv77.1%
clear-num77.1%
un-div-inv77.1%
Applied egg-rr77.1%
Taylor expanded in x around 0 49.9%
Taylor expanded in y around 0 46.8%
associate-*r/46.8%
*-commutative46.8%
associate-*r*46.8%
*-commutative46.8%
associate-*l/52.2%
*-commutative52.2%
associate-/l*52.2%
Simplified52.2%
if 6.50000000000000029e-120 < y < 1.9000000000000001e-64 or 2.79999999999999998e94 < y < 1.84999999999999997e106Initial program 92.4%
Taylor expanded in y around inf 85.4%
*-commutative85.4%
Simplified85.4%
unpow285.4%
unpow285.4%
difference-of-squares92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 99.6%
associate-/l*99.7%
+-commutative99.7%
Simplified99.7%
associate-*r/99.6%
+-commutative99.6%
div-inv99.7%
*-commutative99.7%
associate-*r*99.7%
div-inv99.9%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 51.2%
if 1.9000000000000001e-64 < y < 3.1e-20Initial program 99.8%
Taylor expanded in y around inf 99.9%
*-commutative99.9%
Simplified99.9%
unpow299.9%
unpow299.9%
difference-of-squares99.9%
Applied egg-rr99.9%
*-commutative99.9%
unpow299.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 70.1%
Taylor expanded in y around 0 57.3%
associate-*l/57.6%
*-commutative57.6%
*-commutative57.6%
associate-*l*57.6%
*-commutative57.6%
Simplified57.6%
if 3.1e-20 < y < 4.7000000000000002e81 or 2.69999999999999978e124 < y Initial program 41.6%
Taylor expanded in y around inf 65.0%
*-commutative65.0%
Simplified65.0%
unpow265.0%
unpow265.0%
difference-of-squares65.0%
Applied egg-rr65.0%
*-commutative65.0%
unpow265.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 83.4%
Taylor expanded in z around 0 65.2%
+-commutative65.2%
associate-*l/68.6%
distribute-lft-out68.6%
*-commutative68.6%
Simplified68.6%
if 4.7000000000000002e81 < y < 2.79999999999999998e94Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
unpow2100.0%
unpow2100.0%
difference-of-squares100.0%
Applied egg-rr100.0%
*-commutative100.0%
unpow2100.0%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 33.4%
Taylor expanded in y around 0 33.4%
if 1.84999999999999997e106 < y < 2.69999999999999978e124Initial program 5.5%
Taylor expanded in y around inf 5.5%
*-commutative5.5%
Simplified5.5%
unpow25.5%
unpow25.5%
difference-of-squares5.5%
Applied egg-rr5.5%
Taylor expanded in y around 0 5.5%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
associate-*r/5.5%
+-commutative5.5%
div-inv5.5%
*-commutative5.5%
associate-*r*100.0%
div-inv100.0%
clear-num100.0%
un-div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 98.4%
associate-*r/98.4%
div-inv98.4%
associate-/r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
associate-/r/100.0%
/-rgt-identity100.0%
associate-/l*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Final simplification56.2%
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 (* 0.5 (/ (- x z) (/ y_m x))))
(t_1 (* z (* (- x z) (/ 0.5 y_m))))
(t_2 (* 0.5 (+ y_m (* z (/ x y_m))))))
(*
y_s
(if (<= y_m 1.05e-119)
t_1
(if (<= y_m 7e-66)
t_0
(if (<= y_m 4.3e-20)
t_1
(if (<= y_m 3.75e+82)
t_2
(if (<= y_m 9.5e+98)
(* 0.5 (/ (* z (- x z)) y_m))
(if (<= y_m 2.45e+106)
t_0
(if (<= y_m 3.2e+122) (* z (* (/ z y_m) -0.5)) t_2))))))))))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 = 0.5 * ((x - z) / (y_m / x));
double t_1 = z * ((x - z) * (0.5 / y_m));
double t_2 = 0.5 * (y_m + (z * (x / y_m)));
double tmp;
if (y_m <= 1.05e-119) {
tmp = t_1;
} else if (y_m <= 7e-66) {
tmp = t_0;
} else if (y_m <= 4.3e-20) {
tmp = t_1;
} else if (y_m <= 3.75e+82) {
tmp = t_2;
} else if (y_m <= 9.5e+98) {
tmp = 0.5 * ((z * (x - z)) / y_m);
} else if (y_m <= 2.45e+106) {
tmp = t_0;
} else if (y_m <= 3.2e+122) {
tmp = z * ((z / y_m) * -0.5);
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.5d0 * ((x - z) / (y_m / x))
t_1 = z * ((x - z) * (0.5d0 / y_m))
t_2 = 0.5d0 * (y_m + (z * (x / y_m)))
if (y_m <= 1.05d-119) then
tmp = t_1
else if (y_m <= 7d-66) then
tmp = t_0
else if (y_m <= 4.3d-20) then
tmp = t_1
else if (y_m <= 3.75d+82) then
tmp = t_2
else if (y_m <= 9.5d+98) then
tmp = 0.5d0 * ((z * (x - z)) / y_m)
else if (y_m <= 2.45d+106) then
tmp = t_0
else if (y_m <= 3.2d+122) then
tmp = z * ((z / y_m) * (-0.5d0))
else
tmp = t_2
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 = 0.5 * ((x - z) / (y_m / x));
double t_1 = z * ((x - z) * (0.5 / y_m));
double t_2 = 0.5 * (y_m + (z * (x / y_m)));
double tmp;
if (y_m <= 1.05e-119) {
tmp = t_1;
} else if (y_m <= 7e-66) {
tmp = t_0;
} else if (y_m <= 4.3e-20) {
tmp = t_1;
} else if (y_m <= 3.75e+82) {
tmp = t_2;
} else if (y_m <= 9.5e+98) {
tmp = 0.5 * ((z * (x - z)) / y_m);
} else if (y_m <= 2.45e+106) {
tmp = t_0;
} else if (y_m <= 3.2e+122) {
tmp = z * ((z / y_m) * -0.5);
} else {
tmp = t_2;
}
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 = 0.5 * ((x - z) / (y_m / x)) t_1 = z * ((x - z) * (0.5 / y_m)) t_2 = 0.5 * (y_m + (z * (x / y_m))) tmp = 0 if y_m <= 1.05e-119: tmp = t_1 elif y_m <= 7e-66: tmp = t_0 elif y_m <= 4.3e-20: tmp = t_1 elif y_m <= 3.75e+82: tmp = t_2 elif y_m <= 9.5e+98: tmp = 0.5 * ((z * (x - z)) / y_m) elif y_m <= 2.45e+106: tmp = t_0 elif y_m <= 3.2e+122: tmp = z * ((z / y_m) * -0.5) else: tmp = t_2 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(0.5 * Float64(Float64(x - z) / Float64(y_m / x))) t_1 = Float64(z * Float64(Float64(x - z) * Float64(0.5 / y_m))) t_2 = Float64(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))) tmp = 0.0 if (y_m <= 1.05e-119) tmp = t_1; elseif (y_m <= 7e-66) tmp = t_0; elseif (y_m <= 4.3e-20) tmp = t_1; elseif (y_m <= 3.75e+82) tmp = t_2; elseif (y_m <= 9.5e+98) tmp = Float64(0.5 * Float64(Float64(z * Float64(x - z)) / y_m)); elseif (y_m <= 2.45e+106) tmp = t_0; elseif (y_m <= 3.2e+122) tmp = Float64(z * Float64(Float64(z / y_m) * -0.5)); else tmp = t_2; 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 = 0.5 * ((x - z) / (y_m / x)); t_1 = z * ((x - z) * (0.5 / y_m)); t_2 = 0.5 * (y_m + (z * (x / y_m))); tmp = 0.0; if (y_m <= 1.05e-119) tmp = t_1; elseif (y_m <= 7e-66) tmp = t_0; elseif (y_m <= 4.3e-20) tmp = t_1; elseif (y_m <= 3.75e+82) tmp = t_2; elseif (y_m <= 9.5e+98) tmp = 0.5 * ((z * (x - z)) / y_m); elseif (y_m <= 2.45e+106) tmp = t_0; elseif (y_m <= 3.2e+122) tmp = z * ((z / y_m) * -0.5); else tmp = t_2; 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[(0.5 * N[(N[(x - z), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(N[(x - z), $MachinePrecision] * N[(0.5 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 1.05e-119], t$95$1, If[LessEqual[y$95$m, 7e-66], t$95$0, If[LessEqual[y$95$m, 4.3e-20], t$95$1, If[LessEqual[y$95$m, 3.75e+82], t$95$2, If[LessEqual[y$95$m, 9.5e+98], N[(0.5 * N[(N[(z * N[(x - z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 2.45e+106], t$95$0, If[LessEqual[y$95$m, 3.2e+122], N[(z * N[(N[(z / y$95$m), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]), $MachinePrecision]]]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{x - z}{\frac{y\_m}{x}}\\
t_1 := z \cdot \left(\left(x - z\right) \cdot \frac{0.5}{y\_m}\right)\\
t_2 := 0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.05 \cdot 10^{-119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y\_m \leq 7 \cdot 10^{-66}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y\_m \leq 4.3 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y\_m \leq 3.75 \cdot 10^{+82}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y\_m \leq 9.5 \cdot 10^{+98}:\\
\;\;\;\;0.5 \cdot \frac{z \cdot \left(x - z\right)}{y\_m}\\
\mathbf{elif}\;y\_m \leq 2.45 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y\_m \leq 3.2 \cdot 10^{+122}:\\
\;\;\;\;z \cdot \left(\frac{z}{y\_m} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if y < 1.05e-119 or 7.0000000000000001e-66 < y < 4.30000000000000011e-20Initial program 76.8%
Taylor expanded in y around inf 72.8%
*-commutative72.8%
Simplified72.8%
unpow272.8%
unpow272.8%
difference-of-squares75.0%
Applied egg-rr75.0%
Taylor expanded in y around 0 72.1%
associate-/l*77.9%
+-commutative77.9%
Simplified77.9%
associate-*r/72.1%
+-commutative72.1%
div-inv72.1%
*-commutative72.1%
associate-*r*77.9%
div-inv77.9%
clear-num77.8%
un-div-inv77.8%
Applied egg-rr77.8%
Taylor expanded in x around 0 50.5%
Taylor expanded in y around 0 47.6%
associate-*r/47.6%
*-commutative47.6%
associate-*r*47.6%
*-commutative47.6%
associate-*l/52.6%
*-commutative52.6%
associate-/l*52.6%
Simplified52.6%
if 1.05e-119 < y < 7.0000000000000001e-66 or 9.5000000000000001e98 < y < 2.44999999999999999e106Initial program 92.4%
Taylor expanded in y around inf 85.4%
*-commutative85.4%
Simplified85.4%
unpow285.4%
unpow285.4%
difference-of-squares92.5%
Applied egg-rr92.5%
Taylor expanded in y around 0 99.6%
associate-/l*99.7%
+-commutative99.7%
Simplified99.7%
associate-*r/99.6%
+-commutative99.6%
div-inv99.7%
*-commutative99.7%
associate-*r*99.7%
div-inv99.9%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 51.2%
if 4.30000000000000011e-20 < y < 3.7499999999999999e82 or 3.20000000000000012e122 < y Initial program 41.6%
Taylor expanded in y around inf 65.0%
*-commutative65.0%
Simplified65.0%
unpow265.0%
unpow265.0%
difference-of-squares65.0%
Applied egg-rr65.0%
*-commutative65.0%
unpow265.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 83.4%
Taylor expanded in z around 0 65.2%
+-commutative65.2%
associate-*l/68.6%
distribute-lft-out68.6%
*-commutative68.6%
Simplified68.6%
if 3.7499999999999999e82 < y < 9.5000000000000001e98Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
unpow2100.0%
unpow2100.0%
difference-of-squares100.0%
Applied egg-rr100.0%
*-commutative100.0%
unpow2100.0%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 33.4%
Taylor expanded in y around 0 33.4%
if 2.44999999999999999e106 < y < 3.20000000000000012e122Initial program 5.5%
Taylor expanded in y around inf 5.5%
*-commutative5.5%
Simplified5.5%
unpow25.5%
unpow25.5%
difference-of-squares5.5%
Applied egg-rr5.5%
Taylor expanded in y around 0 5.5%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
associate-*r/5.5%
+-commutative5.5%
div-inv5.5%
*-commutative5.5%
associate-*r*100.0%
div-inv100.0%
clear-num100.0%
un-div-inv98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 98.4%
associate-*r/98.4%
div-inv98.4%
associate-/r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
associate-/r/100.0%
/-rgt-identity100.0%
associate-/l*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
Final simplification56.2%
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 (* y_m (- 0.5 (* 0.5 (* (/ z y_m) (/ z y_m)))))))
(*
y_s
(if (<= y_m 9.4e-21)
(* 0.5 (* (+ z x) (* (- x z) (/ 1.0 y_m))))
(if (<= y_m 9e+65)
t_0
(if (<= y_m 7.2e+66)
(* (/ x y_m) (* 0.5 x))
(if (<= y_m 1.35e+74)
(* y_m 0.5)
(if (<= y_m 8.2e+151)
(* 0.5 (* (+ z x) (/ (- x z) y_m)))
t_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 = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m))));
double tmp;
if (y_m <= 9.4e-21) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if (y_m <= 9e+65) {
tmp = t_0;
} else if (y_m <= 7.2e+66) {
tmp = (x / y_m) * (0.5 * x);
} else if (y_m <= 1.35e+74) {
tmp = y_m * 0.5;
} else if (y_m <= 8.2e+151) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y_m * (0.5d0 - (0.5d0 * ((z / y_m) * (z / y_m))))
if (y_m <= 9.4d-21) then
tmp = 0.5d0 * ((z + x) * ((x - z) * (1.0d0 / y_m)))
else if (y_m <= 9d+65) then
tmp = t_0
else if (y_m <= 7.2d+66) then
tmp = (x / y_m) * (0.5d0 * x)
else if (y_m <= 1.35d+74) then
tmp = y_m * 0.5d0
else if (y_m <= 8.2d+151) then
tmp = 0.5d0 * ((z + x) * ((x - z) / y_m))
else
tmp = t_0
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 = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m))));
double tmp;
if (y_m <= 9.4e-21) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if (y_m <= 9e+65) {
tmp = t_0;
} else if (y_m <= 7.2e+66) {
tmp = (x / y_m) * (0.5 * x);
} else if (y_m <= 1.35e+74) {
tmp = y_m * 0.5;
} else if (y_m <= 8.2e+151) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = t_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 = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m)))) tmp = 0 if y_m <= 9.4e-21: tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))) elif y_m <= 9e+65: tmp = t_0 elif y_m <= 7.2e+66: tmp = (x / y_m) * (0.5 * x) elif y_m <= 1.35e+74: tmp = y_m * 0.5 elif y_m <= 8.2e+151: tmp = 0.5 * ((z + x) * ((x - z) / y_m)) else: tmp = t_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(y_m * Float64(0.5 - Float64(0.5 * Float64(Float64(z / y_m) * Float64(z / y_m))))) tmp = 0.0 if (y_m <= 9.4e-21) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) * Float64(1.0 / y_m)))); elseif (y_m <= 9e+65) tmp = t_0; elseif (y_m <= 7.2e+66) tmp = Float64(Float64(x / y_m) * Float64(0.5 * x)); elseif (y_m <= 1.35e+74) tmp = Float64(y_m * 0.5); elseif (y_m <= 8.2e+151) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) / y_m))); else tmp = t_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 = y_m * (0.5 - (0.5 * ((z / y_m) * (z / y_m)))); tmp = 0.0; if (y_m <= 9.4e-21) tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))); elseif (y_m <= 9e+65) tmp = t_0; elseif (y_m <= 7.2e+66) tmp = (x / y_m) * (0.5 * x); elseif (y_m <= 1.35e+74) tmp = y_m * 0.5; elseif (y_m <= 8.2e+151) tmp = 0.5 * ((z + x) * ((x - z) / y_m)); else tmp = t_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[(y$95$m * N[(0.5 - N[(0.5 * N[(N[(z / y$95$m), $MachinePrecision] * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[y$95$m, 9.4e-21], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] * N[(1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 9e+65], t$95$0, If[LessEqual[y$95$m, 7.2e+66], N[(N[(x / y$95$m), $MachinePrecision] * N[(0.5 * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.35e+74], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[y$95$m, 8.2e+151], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := y\_m \cdot \left(0.5 - 0.5 \cdot \left(\frac{z}{y\_m} \cdot \frac{z}{y\_m}\right)\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 9.4 \cdot 10^{-21}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \left(\left(x - z\right) \cdot \frac{1}{y\_m}\right)\right)\\
\mathbf{elif}\;y\_m \leq 9 \cdot 10^{+65}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y\_m \leq 7.2 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \left(0.5 \cdot x\right)\\
\mathbf{elif}\;y\_m \leq 1.35 \cdot 10^{+74}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;y\_m \leq 8.2 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \frac{x - z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if y < 9.4000000000000006e-21Initial program 77.6%
Taylor expanded in y around inf 73.3%
*-commutative73.3%
Simplified73.3%
unpow273.3%
unpow273.3%
difference-of-squares75.9%
Applied egg-rr75.9%
Taylor expanded in y around 0 73.7%
associate-/l*79.2%
+-commutative79.2%
Simplified79.2%
div-inv79.1%
Applied egg-rr79.1%
if 9.4000000000000006e-21 < y < 9e65 or 8.1999999999999996e151 < y Initial program 37.4%
Taylor expanded in y around inf 62.5%
*-commutative62.5%
Simplified62.5%
unpow262.5%
unpow262.5%
difference-of-squares62.5%
Applied egg-rr62.5%
*-commutative62.5%
unpow262.5%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 83.8%
Taylor expanded in x around 0 83.8%
neg-mul-183.8%
distribute-neg-frac283.8%
Simplified83.8%
if 9e65 < y < 7.2e66Initial program 98.4%
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%
*-un-lft-identity100.0%
unpow2100.0%
times-frac98.4%
Applied egg-rr98.4%
associate-*r*98.4%
clear-num100.0%
un-div-inv100.0%
un-div-inv100.0%
Applied egg-rr100.0%
clear-num100.0%
div-inv100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if 7.2e66 < y < 1.3499999999999999e74Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
if 1.3499999999999999e74 < y < 8.1999999999999996e151Initial program 86.3%
Taylor expanded in y around inf 86.3%
*-commutative86.3%
Simplified86.3%
unpow286.3%
unpow286.3%
difference-of-squares86.3%
Applied egg-rr86.3%
Taylor expanded in y around 0 72.5%
associate-/l*86.2%
+-commutative86.2%
Simplified86.2%
Final simplification80.7%
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 (* y_m (+ 0.5 (* 0.5 (* (/ (+ z x) y_m) (/ x y_m)))))))
(*
y_s
(if (<= z 8.2e-32)
t_0
(if (<= z 5.4e-7)
(* 0.5 (* (+ z x) (* (- x z) (/ 1.0 y_m))))
(if (<= z 9e+35)
t_0
(if (<= z 2.8e+120)
(* 0.5 (* (+ z x) (/ (- x z) y_m)))
(* y_m (- 0.5 (* 0.5 (* (/ z y_m) (/ 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 t_0 = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m))));
double tmp;
if (z <= 8.2e-32) {
tmp = t_0;
} else if (z <= 5.4e-7) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if (z <= 9e+35) {
tmp = t_0;
} else if (z <= 2.8e+120) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (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) :: t_0
real(8) :: tmp
t_0 = y_m * (0.5d0 + (0.5d0 * (((z + x) / y_m) * (x / y_m))))
if (z <= 8.2d-32) then
tmp = t_0
else if (z <= 5.4d-7) then
tmp = 0.5d0 * ((z + x) * ((x - z) * (1.0d0 / y_m)))
else if (z <= 9d+35) then
tmp = t_0
else if (z <= 2.8d+120) then
tmp = 0.5d0 * ((z + x) * ((x - z) / y_m))
else
tmp = y_m * (0.5d0 - (0.5d0 * ((z / y_m) * (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 t_0 = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m))));
double tmp;
if (z <= 8.2e-32) {
tmp = t_0;
} else if (z <= 5.4e-7) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if (z <= 9e+35) {
tmp = t_0;
} else if (z <= 2.8e+120) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (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): t_0 = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m)))) tmp = 0 if z <= 8.2e-32: tmp = t_0 elif z <= 5.4e-7: tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))) elif z <= 9e+35: tmp = t_0 elif z <= 2.8e+120: tmp = 0.5 * ((z + x) * ((x - z) / y_m)) else: tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (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) t_0 = Float64(y_m * Float64(0.5 + Float64(0.5 * Float64(Float64(Float64(z + x) / y_m) * Float64(x / y_m))))) tmp = 0.0 if (z <= 8.2e-32) tmp = t_0; elseif (z <= 5.4e-7) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) * Float64(1.0 / y_m)))); elseif (z <= 9e+35) tmp = t_0; elseif (z <= 2.8e+120) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) / y_m))); else tmp = Float64(y_m * Float64(0.5 - Float64(0.5 * Float64(Float64(z / y_m) * 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) t_0 = y_m * (0.5 + (0.5 * (((z + x) / y_m) * (x / y_m)))); tmp = 0.0; if (z <= 8.2e-32) tmp = t_0; elseif (z <= 5.4e-7) tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))); elseif (z <= 9e+35) tmp = t_0; elseif (z <= 2.8e+120) tmp = 0.5 * ((z + x) * ((x - z) / y_m)); else tmp = y_m * (0.5 - (0.5 * ((z / y_m) * (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_] := Block[{t$95$0 = N[(y$95$m * N[(0.5 + N[(0.5 * N[(N[(N[(z + x), $MachinePrecision] / y$95$m), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[z, 8.2e-32], t$95$0, If[LessEqual[z, 5.4e-7], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] * N[(1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+35], t$95$0, If[LessEqual[z, 2.8e+120], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(0.5 - N[(0.5 * N[(N[(z / y$95$m), $MachinePrecision] * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $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 := y\_m \cdot \left(0.5 + 0.5 \cdot \left(\frac{z + x}{y\_m} \cdot \frac{x}{y\_m}\right)\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 8.2 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-7}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \left(\left(x - z\right) \cdot \frac{1}{y\_m}\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+120}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \frac{x - z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(0.5 - 0.5 \cdot \left(\frac{z}{y\_m} \cdot \frac{z}{y\_m}\right)\right)\\
\end{array}
\end{array}
\end{array}
if z < 8.1999999999999995e-32 or 5.40000000000000018e-7 < z < 8.9999999999999993e35Initial program 68.8%
Taylor expanded in y around inf 72.3%
*-commutative72.3%
Simplified72.3%
unpow272.3%
unpow272.3%
difference-of-squares73.4%
Applied egg-rr73.4%
*-commutative73.4%
unpow273.4%
times-frac96.4%
Applied egg-rr96.4%
Taylor expanded in x around inf 77.6%
if 8.1999999999999995e-32 < z < 5.40000000000000018e-7Initial program 99.2%
Taylor expanded in y around inf 52.6%
*-commutative52.6%
Simplified52.6%
unpow252.6%
unpow252.6%
difference-of-squares52.6%
Applied egg-rr52.6%
Taylor expanded in y around 0 99.2%
associate-/l*99.2%
+-commutative99.2%
Simplified99.2%
div-inv100.0%
Applied egg-rr100.0%
if 8.9999999999999993e35 < z < 2.8000000000000001e120Initial program 85.5%
Taylor expanded in y around inf 85.8%
*-commutative85.8%
Simplified85.8%
unpow285.8%
unpow285.8%
difference-of-squares85.9%
Applied egg-rr85.9%
Taylor expanded in y around 0 84.9%
associate-/l*84.8%
+-commutative84.8%
Simplified84.8%
if 2.8000000000000001e120 < z Initial program 62.9%
Taylor expanded in y around inf 62.5%
*-commutative62.5%
Simplified62.5%
unpow262.5%
unpow262.5%
difference-of-squares70.0%
Applied egg-rr70.0%
*-commutative70.0%
unpow270.0%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 93.3%
Taylor expanded in x around 0 90.8%
neg-mul-190.8%
distribute-neg-frac290.8%
Simplified90.8%
Final simplification80.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) (* 0.5 x))))
(*
y_s
(if (<= z 5.5e-234)
(* 0.5 (+ y_m (* z 2.0)))
(if (<= z 1.02e-60)
t_0
(if (<= z 3.3e-38)
(* y_m 0.5)
(if (<= z 4500000000.0)
t_0
(if (<= z 1.35e+27) (* y_m 0.5) (* z (* (/ z 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 t_0 = (x / y_m) * (0.5 * x);
double tmp;
if (z <= 5.5e-234) {
tmp = 0.5 * (y_m + (z * 2.0));
} else if (z <= 1.02e-60) {
tmp = t_0;
} else if (z <= 3.3e-38) {
tmp = y_m * 0.5;
} else if (z <= 4500000000.0) {
tmp = t_0;
} else if (z <= 1.35e+27) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / 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) :: t_0
real(8) :: tmp
t_0 = (x / y_m) * (0.5d0 * x)
if (z <= 5.5d-234) then
tmp = 0.5d0 * (y_m + (z * 2.0d0))
else if (z <= 1.02d-60) then
tmp = t_0
else if (z <= 3.3d-38) then
tmp = y_m * 0.5d0
else if (z <= 4500000000.0d0) then
tmp = t_0
else if (z <= 1.35d+27) then
tmp = y_m * 0.5d0
else
tmp = z * ((z / 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 t_0 = (x / y_m) * (0.5 * x);
double tmp;
if (z <= 5.5e-234) {
tmp = 0.5 * (y_m + (z * 2.0));
} else if (z <= 1.02e-60) {
tmp = t_0;
} else if (z <= 3.3e-38) {
tmp = y_m * 0.5;
} else if (z <= 4500000000.0) {
tmp = t_0;
} else if (z <= 1.35e+27) {
tmp = y_m * 0.5;
} else {
tmp = z * ((z / 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): t_0 = (x / y_m) * (0.5 * x) tmp = 0 if z <= 5.5e-234: tmp = 0.5 * (y_m + (z * 2.0)) elif z <= 1.02e-60: tmp = t_0 elif z <= 3.3e-38: tmp = y_m * 0.5 elif z <= 4500000000.0: tmp = t_0 elif z <= 1.35e+27: tmp = y_m * 0.5 else: tmp = z * ((z / 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) t_0 = Float64(Float64(x / y_m) * Float64(0.5 * x)) tmp = 0.0 if (z <= 5.5e-234) tmp = Float64(0.5 * Float64(y_m + Float64(z * 2.0))); elseif (z <= 1.02e-60) tmp = t_0; elseif (z <= 3.3e-38) tmp = Float64(y_m * 0.5); elseif (z <= 4500000000.0) tmp = t_0; elseif (z <= 1.35e+27) tmp = Float64(y_m * 0.5); else tmp = Float64(z * Float64(Float64(z / 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) t_0 = (x / y_m) * (0.5 * x); tmp = 0.0; if (z <= 5.5e-234) tmp = 0.5 * (y_m + (z * 2.0)); elseif (z <= 1.02e-60) tmp = t_0; elseif (z <= 3.3e-38) tmp = y_m * 0.5; elseif (z <= 4500000000.0) tmp = t_0; elseif (z <= 1.35e+27) tmp = y_m * 0.5; else tmp = z * ((z / 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_] := Block[{t$95$0 = N[(N[(x / y$95$m), $MachinePrecision] * N[(0.5 * x), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[z, 5.5e-234], N[(0.5 * N[(y$95$m + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-60], t$95$0, If[LessEqual[z, 3.3e-38], N[(y$95$m * 0.5), $MachinePrecision], If[LessEqual[z, 4500000000.0], t$95$0, If[LessEqual[z, 1.35e+27], N[(y$95$m * 0.5), $MachinePrecision], N[(z * N[(N[(z / y$95$m), $MachinePrecision] * -0.5), $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 \left(0.5 \cdot x\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 5.5 \cdot 10^{-234}:\\
\;\;\;\;0.5 \cdot \left(y\_m + z \cdot 2\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-38}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{elif}\;z \leq 4500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+27}:\\
\;\;\;\;y\_m \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{z}{y\_m} \cdot -0.5\right)\\
\end{array}
\end{array}
\end{array}
if z < 5.5e-234Initial program 69.6%
remove-double-neg69.6%
distribute-lft-neg-out69.6%
distribute-frac-neg269.6%
distribute-frac-neg69.6%
neg-mul-169.6%
distribute-lft-neg-out69.6%
*-commutative69.6%
distribute-lft-neg-in69.6%
times-frac69.6%
metadata-eval69.6%
metadata-eval69.6%
associate--l+69.6%
fma-define70.3%
Simplified70.3%
prod-diff56.3%
fma-neg56.3%
difference-of-squares56.7%
fma-define58.1%
pow258.1%
Applied egg-rr58.1%
add-sqr-sqrt42.9%
*-un-lft-identity42.9%
times-frac42.9%
Applied egg-rr64.5%
Taylor expanded in y around inf 37.4%
associate-*r/37.4%
*-commutative37.4%
Simplified37.4%
Taylor expanded in y around 0 32.9%
*-commutative32.9%
Simplified32.9%
if 5.5e-234 < z < 1.01999999999999994e-60 or 3.3000000000000002e-38 < z < 4.5e9Initial program 75.1%
clear-num75.2%
inv-pow75.2%
associate-/l*75.0%
add-sqr-sqrt75.0%
pow275.0%
hypot-define75.0%
pow275.0%
Applied egg-rr75.0%
unpow-175.0%
associate-*r/75.1%
Simplified75.1%
Taylor expanded in x around inf 53.0%
*-un-lft-identity53.0%
unpow253.0%
times-frac55.2%
Applied egg-rr55.2%
associate-*r*55.2%
clear-num55.2%
un-div-inv55.2%
un-div-inv55.2%
Applied egg-rr55.2%
clear-num55.2%
div-inv55.2%
clear-num55.2%
div-inv55.2%
metadata-eval55.2%
Applied egg-rr55.2%
if 1.01999999999999994e-60 < z < 3.3000000000000002e-38 or 4.5e9 < z < 1.3499999999999999e27Initial program 41.9%
Taylor expanded in y around inf 88.2%
*-commutative88.2%
Simplified88.2%
if 1.3499999999999999e27 < z Initial program 68.8%
Taylor expanded in y around inf 70.1%
*-commutative70.1%
Simplified70.1%
unpow270.1%
unpow270.1%
difference-of-squares74.9%
Applied egg-rr74.9%
Taylor expanded in y around 0 74.2%
associate-/l*81.6%
+-commutative81.6%
Simplified81.6%
associate-*r/74.2%
+-commutative74.2%
div-inv74.3%
*-commutative74.3%
associate-*r*81.6%
div-inv81.6%
clear-num81.6%
un-div-inv81.6%
Applied egg-rr81.6%
Taylor expanded in x around 0 73.4%
associate-*r/73.4%
div-inv73.4%
associate-/r*73.4%
*-commutative73.4%
Applied egg-rr73.4%
associate-/r/73.5%
/-rgt-identity73.5%
associate-/l*73.5%
Applied egg-rr73.5%
Taylor expanded in x around 0 62.4%
Final simplification45.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 1.35e+37)
(* 0.5 (* (+ z x) (* (- x z) (/ 1.0 y_m))))
(if (<= y_m 5.6e+70)
(* 0.5 (+ y_m (* z (/ x y_m))))
(if (<= y_m 1.75e+164)
(* 0.5 (* (+ z x) (/ (- x z) y_m)))
(* y_m (+ 0.5 (* 0.5 (* (/ z y_m) (/ x 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 <= 1.35e+37) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if (y_m <= 5.6e+70) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else if (y_m <= 1.75e+164) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = y_m * (0.5 + (0.5 * ((z / y_m) * (x / 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 <= 1.35d+37) then
tmp = 0.5d0 * ((z + x) * ((x - z) * (1.0d0 / y_m)))
else if (y_m <= 5.6d+70) then
tmp = 0.5d0 * (y_m + (z * (x / y_m)))
else if (y_m <= 1.75d+164) then
tmp = 0.5d0 * ((z + x) * ((x - z) / y_m))
else
tmp = y_m * (0.5d0 + (0.5d0 * ((z / y_m) * (x / 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 <= 1.35e+37) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if (y_m <= 5.6e+70) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else if (y_m <= 1.75e+164) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = y_m * (0.5 + (0.5 * ((z / y_m) * (x / 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 <= 1.35e+37: tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))) elif y_m <= 5.6e+70: tmp = 0.5 * (y_m + (z * (x / y_m))) elif y_m <= 1.75e+164: tmp = 0.5 * ((z + x) * ((x - z) / y_m)) else: tmp = y_m * (0.5 + (0.5 * ((z / y_m) * (x / 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 <= 1.35e+37) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) * Float64(1.0 / y_m)))); elseif (y_m <= 5.6e+70) tmp = Float64(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))); elseif (y_m <= 1.75e+164) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) / y_m))); else tmp = Float64(y_m * Float64(0.5 + Float64(0.5 * Float64(Float64(z / y_m) * Float64(x / 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 <= 1.35e+37) tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))); elseif (y_m <= 5.6e+70) tmp = 0.5 * (y_m + (z * (x / y_m))); elseif (y_m <= 1.75e+164) tmp = 0.5 * ((z + x) * ((x - z) / y_m)); else tmp = y_m * (0.5 + (0.5 * ((z / y_m) * (x / 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, 1.35e+37], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] * N[(1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 5.6e+70], N[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 1.75e+164], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(0.5 + N[(0.5 * N[(N[(z / y$95$m), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $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 1.35 \cdot 10^{+37}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \left(\left(x - z\right) \cdot \frac{1}{y\_m}\right)\right)\\
\mathbf{elif}\;y\_m \leq 5.6 \cdot 10^{+70}:\\
\;\;\;\;0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
\mathbf{elif}\;y\_m \leq 1.75 \cdot 10^{+164}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \frac{x - z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(0.5 + 0.5 \cdot \left(\frac{z}{y\_m} \cdot \frac{x}{y\_m}\right)\right)\\
\end{array}
\end{array}
if y < 1.34999999999999993e37Initial program 79.4%
Taylor expanded in y around inf 75.4%
*-commutative75.4%
Simplified75.4%
unpow275.4%
unpow275.4%
difference-of-squares77.8%
Applied egg-rr77.8%
Taylor expanded in y around 0 72.5%
associate-/l*77.5%
+-commutative77.5%
Simplified77.5%
div-inv77.5%
Applied egg-rr77.5%
if 1.34999999999999993e37 < y < 5.59999999999999979e70Initial program 99.5%
Taylor expanded in y around inf 99.5%
*-commutative99.5%
Simplified99.5%
unpow299.5%
unpow299.5%
difference-of-squares99.5%
Applied egg-rr99.5%
*-commutative99.5%
unpow299.5%
times-frac99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 69.3%
Taylor expanded in z around 0 69.3%
+-commutative69.3%
associate-*l/69.3%
distribute-lft-out69.3%
*-commutative69.3%
Simplified69.3%
if 5.59999999999999979e70 < y < 1.7499999999999999e164Initial program 69.8%
Taylor expanded in y around inf 77.2%
*-commutative77.2%
Simplified77.2%
unpow277.2%
unpow277.2%
difference-of-squares77.2%
Applied egg-rr77.2%
Taylor expanded in y around 0 40.5%
associate-/l*62.5%
+-commutative62.5%
Simplified62.5%
if 1.7499999999999999e164 < y Initial program 8.5%
Taylor expanded in y around inf 45.7%
*-commutative45.7%
Simplified45.7%
unpow245.7%
unpow245.7%
difference-of-squares45.7%
Applied egg-rr45.7%
*-commutative45.7%
unpow245.7%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 81.2%
Taylor expanded in x around inf 75.5%
Final simplification76.4%
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 7.2e+36)
(* 0.5 (* (+ z x) (* (- x z) (/ 1.0 y_m))))
(if (or (<= y_m 3.4e+70) (not (<= y_m 5.6e+163)))
(* 0.5 (+ y_m (* z (/ x y_m))))
(* 0.5 (* (+ z x) (/ (- x 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 <= 7.2e+36) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if ((y_m <= 3.4e+70) || !(y_m <= 5.6e+163)) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else {
tmp = 0.5 * ((z + x) * ((x - 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 <= 7.2d+36) then
tmp = 0.5d0 * ((z + x) * ((x - z) * (1.0d0 / y_m)))
else if ((y_m <= 3.4d+70) .or. (.not. (y_m <= 5.6d+163))) then
tmp = 0.5d0 * (y_m + (z * (x / y_m)))
else
tmp = 0.5d0 * ((z + x) * ((x - 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 <= 7.2e+36) {
tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m)));
} else if ((y_m <= 3.4e+70) || !(y_m <= 5.6e+163)) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else {
tmp = 0.5 * ((z + x) * ((x - 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 <= 7.2e+36: tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))) elif (y_m <= 3.4e+70) or not (y_m <= 5.6e+163): tmp = 0.5 * (y_m + (z * (x / y_m))) else: tmp = 0.5 * ((z + x) * ((x - 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 <= 7.2e+36) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) * Float64(1.0 / y_m)))); elseif ((y_m <= 3.4e+70) || !(y_m <= 5.6e+163)) tmp = Float64(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))); else tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - 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 <= 7.2e+36) tmp = 0.5 * ((z + x) * ((x - z) * (1.0 / y_m))); elseif ((y_m <= 3.4e+70) || ~((y_m <= 5.6e+163))) tmp = 0.5 * (y_m + (z * (x / y_m))); else tmp = 0.5 * ((z + x) * ((x - 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, 7.2e+36], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] * N[(1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$95$m, 3.4e+70], N[Not[LessEqual[y$95$m, 5.6e+163]], $MachinePrecision]], N[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / 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}\;y\_m \leq 7.2 \cdot 10^{+36}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \left(\left(x - z\right) \cdot \frac{1}{y\_m}\right)\right)\\
\mathbf{elif}\;y\_m \leq 3.4 \cdot 10^{+70} \lor \neg \left(y\_m \leq 5.6 \cdot 10^{+163}\right):\\
\;\;\;\;0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \frac{x - z}{y\_m}\right)\\
\end{array}
\end{array}
if y < 7.1999999999999995e36Initial program 79.4%
Taylor expanded in y around inf 75.4%
*-commutative75.4%
Simplified75.4%
unpow275.4%
unpow275.4%
difference-of-squares77.8%
Applied egg-rr77.8%
Taylor expanded in y around 0 72.5%
associate-/l*77.5%
+-commutative77.5%
Simplified77.5%
div-inv77.5%
Applied egg-rr77.5%
if 7.1999999999999995e36 < y < 3.4000000000000001e70 or 5.60000000000000029e163 < y Initial program 15.6%
Taylor expanded in y around inf 50.0%
*-commutative50.0%
Simplified50.0%
unpow250.0%
unpow250.0%
difference-of-squares50.0%
Applied egg-rr50.0%
*-commutative50.0%
unpow250.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 80.2%
Taylor expanded in z around 0 69.5%
+-commutative69.5%
associate-*l/75.0%
distribute-lft-out75.0%
*-commutative75.0%
Simplified75.0%
if 3.4000000000000001e70 < y < 5.60000000000000029e163Initial program 69.8%
Taylor expanded in y around inf 77.2%
*-commutative77.2%
Simplified77.2%
unpow277.2%
unpow277.2%
difference-of-squares77.2%
Applied egg-rr77.2%
Taylor expanded in y around 0 40.5%
associate-/l*62.5%
+-commutative62.5%
Simplified62.5%
Final simplification76.4%
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 (or (<= y_m 1.1e+37) (and (not (<= y_m 3.5e+70)) (<= y_m 1.9e+161)))
(* 0.5 (* (+ z x) (/ (- x z) y_m)))
(* 0.5 (+ y_m (* z (/ x 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 <= 1.1e+37) || (!(y_m <= 3.5e+70) && (y_m <= 1.9e+161))) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = 0.5 * (y_m + (z * (x / 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 <= 1.1d+37) .or. (.not. (y_m <= 3.5d+70)) .and. (y_m <= 1.9d+161)) then
tmp = 0.5d0 * ((z + x) * ((x - z) / y_m))
else
tmp = 0.5d0 * (y_m + (z * (x / 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 <= 1.1e+37) || (!(y_m <= 3.5e+70) && (y_m <= 1.9e+161))) {
tmp = 0.5 * ((z + x) * ((x - z) / y_m));
} else {
tmp = 0.5 * (y_m + (z * (x / 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 <= 1.1e+37) or (not (y_m <= 3.5e+70) and (y_m <= 1.9e+161)): tmp = 0.5 * ((z + x) * ((x - z) / y_m)) else: tmp = 0.5 * (y_m + (z * (x / 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 <= 1.1e+37) || (!(y_m <= 3.5e+70) && (y_m <= 1.9e+161))) tmp = Float64(0.5 * Float64(Float64(z + x) * Float64(Float64(x - z) / y_m))); else tmp = Float64(0.5 * Float64(y_m + Float64(z * Float64(x / 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 <= 1.1e+37) || (~((y_m <= 3.5e+70)) && (y_m <= 1.9e+161))) tmp = 0.5 * ((z + x) * ((x - z) / y_m)); else tmp = 0.5 * (y_m + (z * (x / 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[Or[LessEqual[y$95$m, 1.1e+37], And[N[Not[LessEqual[y$95$m, 3.5e+70]], $MachinePrecision], LessEqual[y$95$m, 1.9e+161]]], N[(0.5 * N[(N[(z + x), $MachinePrecision] * N[(N[(x - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y$95$m + N[(z * N[(x / 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 1.1 \cdot 10^{+37} \lor \neg \left(y\_m \leq 3.5 \cdot 10^{+70}\right) \land y\_m \leq 1.9 \cdot 10^{+161}:\\
\;\;\;\;0.5 \cdot \left(\left(z + x\right) \cdot \frac{x - z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
\end{array}
\end{array}
if y < 1.1e37 or 3.50000000000000002e70 < y < 1.9000000000000001e161Initial program 78.8%
Taylor expanded in y around inf 75.5%
*-commutative75.5%
Simplified75.5%
unpow275.5%
unpow275.5%
difference-of-squares77.8%
Applied egg-rr77.8%
Taylor expanded in y around 0 70.6%
associate-/l*76.6%
+-commutative76.6%
Simplified76.6%
if 1.1e37 < y < 3.50000000000000002e70 or 1.9000000000000001e161 < y Initial program 15.6%
Taylor expanded in y around inf 50.0%
*-commutative50.0%
Simplified50.0%
unpow250.0%
unpow250.0%
difference-of-squares50.0%
Applied egg-rr50.0%
*-commutative50.0%
unpow250.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 80.2%
Taylor expanded in z around 0 69.5%
+-commutative69.5%
associate-*l/75.0%
distribute-lft-out75.0%
*-commutative75.0%
Simplified75.0%
Final simplification76.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 (* 0.5 (+ y_m (* z (/ x y_m))))))
(*
y_s
(if (<= z 8.2e-32)
t_0
(if (<= z 3.15e-7)
(* 0.5 (/ (* z (- x z)) y_m))
(if (<= z 1.12e+27) t_0 (* 0.5 (/ (- x z) (/ y_m z)))))))))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 = 0.5 * (y_m + (z * (x / y_m)));
double tmp;
if (z <= 8.2e-32) {
tmp = t_0;
} else if (z <= 3.15e-7) {
tmp = 0.5 * ((z * (x - z)) / y_m);
} else if (z <= 1.12e+27) {
tmp = t_0;
} else {
tmp = 0.5 * ((x - z) / (y_m / z));
}
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 = 0.5d0 * (y_m + (z * (x / y_m)))
if (z <= 8.2d-32) then
tmp = t_0
else if (z <= 3.15d-7) then
tmp = 0.5d0 * ((z * (x - z)) / y_m)
else if (z <= 1.12d+27) then
tmp = t_0
else
tmp = 0.5d0 * ((x - z) / (y_m / z))
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 = 0.5 * (y_m + (z * (x / y_m)));
double tmp;
if (z <= 8.2e-32) {
tmp = t_0;
} else if (z <= 3.15e-7) {
tmp = 0.5 * ((z * (x - z)) / y_m);
} else if (z <= 1.12e+27) {
tmp = t_0;
} else {
tmp = 0.5 * ((x - z) / (y_m / z));
}
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 = 0.5 * (y_m + (z * (x / y_m))) tmp = 0 if z <= 8.2e-32: tmp = t_0 elif z <= 3.15e-7: tmp = 0.5 * ((z * (x - z)) / y_m) elif z <= 1.12e+27: tmp = t_0 else: tmp = 0.5 * ((x - z) / (y_m / z)) 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(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))) tmp = 0.0 if (z <= 8.2e-32) tmp = t_0; elseif (z <= 3.15e-7) tmp = Float64(0.5 * Float64(Float64(z * Float64(x - z)) / y_m)); elseif (z <= 1.12e+27) tmp = t_0; else tmp = Float64(0.5 * Float64(Float64(x - z) / Float64(y_m / z))); 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 = 0.5 * (y_m + (z * (x / y_m))); tmp = 0.0; if (z <= 8.2e-32) tmp = t_0; elseif (z <= 3.15e-7) tmp = 0.5 * ((z * (x - z)) / y_m); elseif (z <= 1.12e+27) tmp = t_0; else tmp = 0.5 * ((x - z) / (y_m / z)); 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[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[z, 8.2e-32], t$95$0, If[LessEqual[z, 3.15e-7], N[(0.5 * N[(N[(z * N[(x - z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+27], t$95$0, N[(0.5 * N[(N[(x - z), $MachinePrecision] / N[(y$95$m / z), $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 := 0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 8.2 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-7}:\\
\;\;\;\;0.5 \cdot \frac{z \cdot \left(x - z\right)}{y\_m}\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+27}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{\frac{y\_m}{z}}\\
\end{array}
\end{array}
\end{array}
if z < 8.1999999999999995e-32 or 3.15000000000000002e-7 < z < 1.12e27Initial program 69.3%
Taylor expanded in y around inf 72.4%
*-commutative72.4%
Simplified72.4%
unpow272.4%
unpow272.4%
difference-of-squares73.5%
Applied egg-rr73.5%
*-commutative73.5%
unpow273.5%
times-frac96.4%
Applied egg-rr96.4%
Taylor expanded in x around 0 68.6%
Taylor expanded in z around 0 43.5%
+-commutative43.5%
associate-*l/45.2%
distribute-lft-out45.2%
*-commutative45.2%
Simplified45.2%
if 8.1999999999999995e-32 < z < 3.15000000000000002e-7Initial program 99.2%
Taylor expanded in y around inf 52.6%
*-commutative52.6%
Simplified52.6%
unpow252.6%
unpow252.6%
difference-of-squares52.6%
Applied egg-rr52.6%
*-commutative52.6%
unpow252.6%
times-frac51.9%
Applied egg-rr51.9%
Taylor expanded in x around 0 36.2%
Taylor expanded in y around 0 82.8%
if 1.12e27 < z Initial program 68.8%
Taylor expanded in y around inf 70.1%
*-commutative70.1%
Simplified70.1%
unpow270.1%
unpow270.1%
difference-of-squares74.9%
Applied egg-rr74.9%
Taylor expanded in y around 0 74.2%
associate-/l*81.6%
+-commutative81.6%
Simplified81.6%
associate-*r/74.2%
+-commutative74.2%
div-inv74.3%
*-commutative74.3%
associate-*r*81.6%
div-inv81.6%
clear-num81.6%
un-div-inv81.6%
Applied egg-rr81.6%
Taylor expanded in x around 0 73.4%
Final simplification52.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 (or (<= y_m 4.3e-20) (and (not (<= y_m 2.2e+83)) (<= y_m 1.3e+94)))
(* z (* (/ z y_m) -0.5))
(* 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 <= 4.3e-20) || (!(y_m <= 2.2e+83) && (y_m <= 1.3e+94))) {
tmp = z * ((z / y_m) * -0.5);
} 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 <= 4.3d-20) .or. (.not. (y_m <= 2.2d+83)) .and. (y_m <= 1.3d+94)) then
tmp = z * ((z / y_m) * (-0.5d0))
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 <= 4.3e-20) || (!(y_m <= 2.2e+83) && (y_m <= 1.3e+94))) {
tmp = z * ((z / y_m) * -0.5);
} 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 <= 4.3e-20) or (not (y_m <= 2.2e+83) and (y_m <= 1.3e+94)): tmp = z * ((z / y_m) * -0.5) 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 <= 4.3e-20) || (!(y_m <= 2.2e+83) && (y_m <= 1.3e+94))) tmp = Float64(z * Float64(Float64(z / y_m) * -0.5)); 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 <= 4.3e-20) || (~((y_m <= 2.2e+83)) && (y_m <= 1.3e+94))) tmp = z * ((z / y_m) * -0.5); 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, 4.3e-20], And[N[Not[LessEqual[y$95$m, 2.2e+83]], $MachinePrecision], LessEqual[y$95$m, 1.3e+94]]], N[(z * N[(N[(z / y$95$m), $MachinePrecision] * -0.5), $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 4.3 \cdot 10^{-20} \lor \neg \left(y\_m \leq 2.2 \cdot 10^{+83}\right) \land y\_m \leq 1.3 \cdot 10^{+94}:\\
\;\;\;\;z \cdot \left(\frac{z}{y\_m} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\
\end{array}
\end{array}
if y < 4.30000000000000011e-20 or 2.19999999999999999e83 < y < 1.3e94Initial program 78.1%
Taylor expanded in y around inf 73.8%
*-commutative73.8%
Simplified73.8%
unpow273.8%
unpow273.8%
difference-of-squares76.4%
Applied egg-rr76.4%
Taylor expanded in y around 0 74.2%
associate-/l*79.6%
+-commutative79.6%
Simplified79.6%
associate-*r/74.2%
+-commutative74.2%
div-inv74.3%
*-commutative74.3%
associate-*r*79.6%
div-inv79.6%
clear-num79.5%
un-div-inv79.5%
Applied egg-rr79.5%
Taylor expanded in x around 0 49.6%
associate-*r/49.6%
div-inv49.6%
associate-/r*51.6%
*-commutative51.6%
Applied egg-rr51.6%
associate-/r/51.6%
/-rgt-identity51.6%
associate-/l*51.6%
Applied egg-rr51.6%
Taylor expanded in x around 0 42.5%
if 4.30000000000000011e-20 < y < 2.19999999999999999e83 or 1.3e94 < y Initial program 42.9%
Taylor expanded in y around inf 63.9%
*-commutative63.9%
Simplified63.9%
Final simplification47.7%
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 (* z (* (/ z y_m) -0.5))))
(*
y_s
(if (<= x 1.18e-29)
t_0
(if (<= x 6.5e+66)
(* 0.5 (+ y_m (* z (/ x y_m))))
(if (<= x 4.8e+91) t_0 (* (/ x y_m) (* 0.5 x))))))))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 = z * ((z / y_m) * -0.5);
double tmp;
if (x <= 1.18e-29) {
tmp = t_0;
} else if (x <= 6.5e+66) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else if (x <= 4.8e+91) {
tmp = t_0;
} else {
tmp = (x / y_m) * (0.5 * 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) :: t_0
real(8) :: tmp
t_0 = z * ((z / y_m) * (-0.5d0))
if (x <= 1.18d-29) then
tmp = t_0
else if (x <= 6.5d+66) then
tmp = 0.5d0 * (y_m + (z * (x / y_m)))
else if (x <= 4.8d+91) then
tmp = t_0
else
tmp = (x / y_m) * (0.5d0 * 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 t_0 = z * ((z / y_m) * -0.5);
double tmp;
if (x <= 1.18e-29) {
tmp = t_0;
} else if (x <= 6.5e+66) {
tmp = 0.5 * (y_m + (z * (x / y_m)));
} else if (x <= 4.8e+91) {
tmp = t_0;
} else {
tmp = (x / y_m) * (0.5 * 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): t_0 = z * ((z / y_m) * -0.5) tmp = 0 if x <= 1.18e-29: tmp = t_0 elif x <= 6.5e+66: tmp = 0.5 * (y_m + (z * (x / y_m))) elif x <= 4.8e+91: tmp = t_0 else: tmp = (x / y_m) * (0.5 * x) 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(z * Float64(Float64(z / y_m) * -0.5)) tmp = 0.0 if (x <= 1.18e-29) tmp = t_0; elseif (x <= 6.5e+66) tmp = Float64(0.5 * Float64(y_m + Float64(z * Float64(x / y_m)))); elseif (x <= 4.8e+91) tmp = t_0; else tmp = Float64(Float64(x / y_m) * Float64(0.5 * 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) t_0 = z * ((z / y_m) * -0.5); tmp = 0.0; if (x <= 1.18e-29) tmp = t_0; elseif (x <= 6.5e+66) tmp = 0.5 * (y_m + (z * (x / y_m))); elseif (x <= 4.8e+91) tmp = t_0; else tmp = (x / y_m) * (0.5 * 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_] := Block[{t$95$0 = N[(z * N[(N[(z / y$95$m), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * If[LessEqual[x, 1.18e-29], t$95$0, If[LessEqual[x, 6.5e+66], N[(0.5 * N[(y$95$m + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e+91], t$95$0, N[(N[(x / y$95$m), $MachinePrecision] * N[(0.5 * x), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
\begin{array}{l}
t_0 := z \cdot \left(\frac{z}{y\_m} \cdot -0.5\right)\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 1.18 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+66}:\\
\;\;\;\;0.5 \cdot \left(y\_m + z \cdot \frac{x}{y\_m}\right)\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+91}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \left(0.5 \cdot x\right)\\
\end{array}
\end{array}
\end{array}
if x < 1.17999999999999996e-29 or 6.5000000000000001e66 < x < 4.79999999999999966e91Initial program 69.4%
Taylor expanded in y around inf 71.3%
*-commutative71.3%
Simplified71.3%
unpow271.3%
unpow271.3%
difference-of-squares71.3%
Applied egg-rr71.3%
Taylor expanded in y around 0 58.9%
associate-/l*65.8%
+-commutative65.8%
Simplified65.8%
associate-*r/58.9%
+-commutative58.9%
div-inv59.0%
*-commutative59.0%
associate-*r*65.8%
div-inv65.8%
clear-num65.7%
un-div-inv65.7%
Applied egg-rr65.7%
Taylor expanded in x around 0 46.8%
associate-*r/46.8%
div-inv46.8%
associate-/r*47.3%
*-commutative47.3%
Applied egg-rr47.3%
associate-/r/47.3%
/-rgt-identity47.3%
associate-/l*47.3%
Applied egg-rr47.3%
Taylor expanded in x around 0 44.9%
if 1.17999999999999996e-29 < x < 6.5000000000000001e66Initial program 81.8%
Taylor expanded in y around inf 90.5%
*-commutative90.5%
Simplified90.5%
unpow290.5%
unpow290.5%
difference-of-squares90.5%
Applied egg-rr90.5%
*-commutative90.5%
unpow290.5%
times-frac95.2%
Applied egg-rr95.2%
Taylor expanded in x around 0 63.9%
Taylor expanded in z around 0 52.4%
+-commutative52.4%
associate-*l/52.4%
distribute-lft-out52.4%
*-commutative52.4%
Simplified52.4%
if 4.79999999999999966e91 < x Initial program 63.8%
clear-num63.8%
inv-pow63.8%
associate-/l*63.8%
add-sqr-sqrt63.8%
pow263.8%
hypot-define63.8%
pow263.8%
Applied egg-rr63.8%
unpow-163.8%
associate-*r/63.8%
Simplified63.8%
Taylor expanded in x around inf 68.5%
*-un-lft-identity68.5%
unpow268.5%
times-frac80.9%
Applied egg-rr80.9%
associate-*r*80.9%
clear-num80.8%
un-div-inv80.9%
un-div-inv80.9%
Applied egg-rr80.9%
clear-num80.8%
div-inv80.9%
clear-num80.8%
div-inv80.8%
metadata-eval80.8%
Applied egg-rr80.8%
Final simplification51.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 (<= y_m 1.15e-30) (* -0.5 (* x (/ z 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 <= 1.15e-30) {
tmp = -0.5 * (x * (z / 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 <= 1.15d-30) then
tmp = (-0.5d0) * (x * (z / 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 <= 1.15e-30) {
tmp = -0.5 * (x * (z / 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 <= 1.15e-30: tmp = -0.5 * (x * (z / 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 <= 1.15e-30) tmp = Float64(-0.5 * Float64(x * Float64(z / 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 <= 1.15e-30) tmp = -0.5 * (x * (z / 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[LessEqual[y$95$m, 1.15e-30], N[(-0.5 * N[(x * N[(z / 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 1.15 \cdot 10^{-30}:\\
\;\;\;\;-0.5 \cdot \left(x \cdot \frac{z}{y\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot 0.5\\
\end{array}
\end{array}
if y < 1.14999999999999992e-30Initial program 77.1%
Taylor expanded in y around inf 72.7%
*-commutative72.7%
Simplified72.7%
unpow272.7%
unpow272.7%
difference-of-squares75.4%
Applied egg-rr75.4%
Taylor expanded in y around 0 73.8%
associate-/l*79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 45.3%
neg-mul-160.0%
distribute-neg-frac260.0%
Simplified45.3%
Taylor expanded in z around 0 9.3%
associate-*r/9.3%
associate-*r*9.3%
associate-*l/10.9%
associate-*r/10.9%
*-commutative10.9%
*-commutative10.9%
associate-*l/10.9%
Simplified10.9%
Taylor expanded in z around 0 9.3%
associate-/l*14.5%
Simplified14.5%
if 1.14999999999999992e-30 < y Initial program 49.3%
Taylor expanded in y around inf 58.3%
*-commutative58.3%
Simplified58.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 (* 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.4%
Taylor expanded in y around inf 31.8%
*-commutative31.8%
Simplified31.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 2024107
(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)))