
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 3.5e-59)
(/ (* x 2.0) (* z_m (- y t)))
(if (<= z_m 1.5e+135)
(* 2.0 (/ (/ x z_m) (- y t)))
(/ (/ x (- y t)) (* z_m 0.5))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 3.5e-59) {
tmp = (x * 2.0) / (z_m * (y - t));
} else if (z_m <= 1.5e+135) {
tmp = 2.0 * ((x / z_m) / (y - t));
} else {
tmp = (x / (y - t)) / (z_m * 0.5);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 3.5d-59) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else if (z_m <= 1.5d+135) then
tmp = 2.0d0 * ((x / z_m) / (y - t))
else
tmp = (x / (y - t)) / (z_m * 0.5d0)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 3.5e-59) {
tmp = (x * 2.0) / (z_m * (y - t));
} else if (z_m <= 1.5e+135) {
tmp = 2.0 * ((x / z_m) / (y - t));
} else {
tmp = (x / (y - t)) / (z_m * 0.5);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if z_m <= 3.5e-59: tmp = (x * 2.0) / (z_m * (y - t)) elif z_m <= 1.5e+135: tmp = 2.0 * ((x / z_m) / (y - t)) else: tmp = (x / (y - t)) / (z_m * 0.5) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (z_m <= 3.5e-59) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); elseif (z_m <= 1.5e+135) tmp = Float64(2.0 * Float64(Float64(x / z_m) / Float64(y - t))); else tmp = Float64(Float64(x / Float64(y - t)) / Float64(z_m * 0.5)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (z_m <= 3.5e-59) tmp = (x * 2.0) / (z_m * (y - t)); elseif (z_m <= 1.5e+135) tmp = 2.0 * ((x / z_m) / (y - t)); else tmp = (x / (y - t)) / (z_m * 0.5); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[z$95$m, 3.5e-59], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 1.5e+135], N[(2.0 * N[(N[(x / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(z$95$m * 0.5), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 3.5 \cdot 10^{-59}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{elif}\;z\_m \leq 1.5 \cdot 10^{+135}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - t}}{z\_m \cdot 0.5}\\
\end{array}
\end{array}
if z < 3.5000000000000001e-59Initial program 89.3%
distribute-rgt-out--92.2%
Simplified92.2%
if 3.5000000000000001e-59 < z < 1.5e135Initial program 92.2%
distribute-rgt-out--92.4%
Simplified92.4%
Taylor expanded in x around 0 92.4%
associate-/r*99.9%
Simplified99.9%
if 1.5e135 < z Initial program 78.3%
distribute-rgt-out--83.7%
Simplified83.7%
Taylor expanded in x around 0 83.6%
associate-/r*93.2%
Simplified93.2%
associate-*r/93.2%
div-inv93.2%
associate-*r*93.2%
*-commutative93.2%
associate-*r*93.2%
div-inv93.2%
associate-*l/97.2%
*-commutative97.2%
clear-num97.2%
frac-times83.7%
*-un-lft-identity83.7%
div-inv83.7%
metadata-eval83.7%
Applied egg-rr83.7%
associate-/l/97.3%
Simplified97.3%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(let* ((t_1 (* (/ x z_m) (/ 2.0 y))) (t_2 (* -2.0 (/ x (* z_m t)))))
(*
z_s
(if (<= t -9.6e+20)
t_2
(if (<= t -1.85e-190)
t_1
(if (<= t -1.8e-190)
t_2
(if (<= t 4.6e+80)
t_1
(if (<= t 4.7e+95)
(/ -2.0 (* z_m (/ t x)))
(if (<= t 3.5e+96)
(* x (/ 2.0 (* z_m y)))
(if (or (<= t 4.2e+207) (not (<= t 4.7e+253)))
(* -2.0 (/ (/ x t) z_m))
(/ (* x (/ -2.0 z_m)) t)))))))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = (x / z_m) * (2.0 / y);
double t_2 = -2.0 * (x / (z_m * t));
double tmp;
if (t <= -9.6e+20) {
tmp = t_2;
} else if (t <= -1.85e-190) {
tmp = t_1;
} else if (t <= -1.8e-190) {
tmp = t_2;
} else if (t <= 4.6e+80) {
tmp = t_1;
} else if (t <= 4.7e+95) {
tmp = -2.0 / (z_m * (t / x));
} else if (t <= 3.5e+96) {
tmp = x * (2.0 / (z_m * y));
} else if ((t <= 4.2e+207) || !(t <= 4.7e+253)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (x * (-2.0 / z_m)) / t;
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / z_m) * (2.0d0 / y)
t_2 = (-2.0d0) * (x / (z_m * t))
if (t <= (-9.6d+20)) then
tmp = t_2
else if (t <= (-1.85d-190)) then
tmp = t_1
else if (t <= (-1.8d-190)) then
tmp = t_2
else if (t <= 4.6d+80) then
tmp = t_1
else if (t <= 4.7d+95) then
tmp = (-2.0d0) / (z_m * (t / x))
else if (t <= 3.5d+96) then
tmp = x * (2.0d0 / (z_m * y))
else if ((t <= 4.2d+207) .or. (.not. (t <= 4.7d+253))) then
tmp = (-2.0d0) * ((x / t) / z_m)
else
tmp = (x * ((-2.0d0) / z_m)) / t
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = (x / z_m) * (2.0 / y);
double t_2 = -2.0 * (x / (z_m * t));
double tmp;
if (t <= -9.6e+20) {
tmp = t_2;
} else if (t <= -1.85e-190) {
tmp = t_1;
} else if (t <= -1.8e-190) {
tmp = t_2;
} else if (t <= 4.6e+80) {
tmp = t_1;
} else if (t <= 4.7e+95) {
tmp = -2.0 / (z_m * (t / x));
} else if (t <= 3.5e+96) {
tmp = x * (2.0 / (z_m * y));
} else if ((t <= 4.2e+207) || !(t <= 4.7e+253)) {
tmp = -2.0 * ((x / t) / z_m);
} else {
tmp = (x * (-2.0 / z_m)) / t;
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): t_1 = (x / z_m) * (2.0 / y) t_2 = -2.0 * (x / (z_m * t)) tmp = 0 if t <= -9.6e+20: tmp = t_2 elif t <= -1.85e-190: tmp = t_1 elif t <= -1.8e-190: tmp = t_2 elif t <= 4.6e+80: tmp = t_1 elif t <= 4.7e+95: tmp = -2.0 / (z_m * (t / x)) elif t <= 3.5e+96: tmp = x * (2.0 / (z_m * y)) elif (t <= 4.2e+207) or not (t <= 4.7e+253): tmp = -2.0 * ((x / t) / z_m) else: tmp = (x * (-2.0 / z_m)) / t return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) t_1 = Float64(Float64(x / z_m) * Float64(2.0 / y)) t_2 = Float64(-2.0 * Float64(x / Float64(z_m * t))) tmp = 0.0 if (t <= -9.6e+20) tmp = t_2; elseif (t <= -1.85e-190) tmp = t_1; elseif (t <= -1.8e-190) tmp = t_2; elseif (t <= 4.6e+80) tmp = t_1; elseif (t <= 4.7e+95) tmp = Float64(-2.0 / Float64(z_m * Float64(t / x))); elseif (t <= 3.5e+96) tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); elseif ((t <= 4.2e+207) || !(t <= 4.7e+253)) tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); else tmp = Float64(Float64(x * Float64(-2.0 / z_m)) / t); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) t_1 = (x / z_m) * (2.0 / y); t_2 = -2.0 * (x / (z_m * t)); tmp = 0.0; if (t <= -9.6e+20) tmp = t_2; elseif (t <= -1.85e-190) tmp = t_1; elseif (t <= -1.8e-190) tmp = t_2; elseif (t <= 4.6e+80) tmp = t_1; elseif (t <= 4.7e+95) tmp = -2.0 / (z_m * (t / x)); elseif (t <= 3.5e+96) tmp = x * (2.0 / (z_m * y)); elseif ((t <= 4.2e+207) || ~((t <= 4.7e+253))) tmp = -2.0 * ((x / t) / z_m); else tmp = (x * (-2.0 / z_m)) / t; end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[t, -9.6e+20], t$95$2, If[LessEqual[t, -1.85e-190], t$95$1, If[LessEqual[t, -1.8e-190], t$95$2, If[LessEqual[t, 4.6e+80], t$95$1, If[LessEqual[t, 4.7e+95], N[(-2.0 / N[(z$95$m * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+96], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 4.2e+207], N[Not[LessEqual[t, 4.7e+253]], $MachinePrecision]], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{x}{z\_m} \cdot \frac{2}{y}\\
t_2 := -2 \cdot \frac{x}{z\_m \cdot t}\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -9.6 \cdot 10^{+20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-190}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+95}:\\
\;\;\;\;\frac{-2}{z\_m \cdot \frac{t}{x}}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+207} \lor \neg \left(t \leq 4.7 \cdot 10^{+253}\right):\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-2}{z\_m}}{t}\\
\end{array}
\end{array}
\end{array}
if t < -9.6e20 or -1.8500000000000001e-190 < t < -1.80000000000000003e-190Initial program 83.1%
distribute-rgt-out--88.7%
Simplified88.7%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
if -9.6e20 < t < -1.8500000000000001e-190 or -1.80000000000000003e-190 < t < 4.60000000000000008e80Initial program 89.1%
distribute-rgt-out--91.7%
Simplified91.7%
Taylor expanded in y around inf 69.8%
*-commutative69.8%
Simplified69.8%
times-frac74.7%
Applied egg-rr74.7%
if 4.60000000000000008e80 < t < 4.69999999999999972e95Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
*-commutative99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
associate-/l*100.0%
Simplified100.0%
if 4.69999999999999972e95 < t < 3.4999999999999999e96Initial program 100.0%
distribute-rgt-out--100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r/100.0%
Simplified100.0%
if 3.4999999999999999e96 < t < 4.1999999999999999e207 or 4.70000000000000022e253 < t Initial program 90.1%
distribute-rgt-out--90.2%
Simplified90.2%
Taylor expanded in y around 0 78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in x around 0 78.0%
associate-/r*90.1%
Simplified90.1%
if 4.1999999999999999e207 < t < 4.70000000000000022e253Initial program 88.0%
distribute-rgt-out--88.0%
Simplified88.0%
Taylor expanded in x around 0 88.0%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in y around 0 76.5%
associate-*r/76.5%
*-commutative76.5%
associate-*r/76.5%
associate-/r*88.4%
associate-*r/88.4%
metadata-eval88.4%
distribute-lft-neg-in88.4%
associate-*r/88.4%
*-commutative88.4%
associate-*r/88.4%
distribute-rgt-neg-in88.4%
distribute-neg-frac88.4%
metadata-eval88.4%
Simplified88.4%
Final simplification79.0%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(let* ((t_1 (* -2.0 (/ x (* z_m t)))))
(*
z_s
(if (<= t -3.25e+21)
t_1
(if (<= t -1.85e-190)
(* (/ x z_m) (/ 2.0 y))
(if (<= t -1.8e-190)
t_1
(if (<= t 5.2e+80)
(/ (/ 2.0 y) (/ z_m x))
(if (<= t 4.7e+95)
(/ -2.0 (* z_m (/ t x)))
(if (<= t 4.8e+95)
(* x (/ 2.0 (* z_m y)))
(* -2.0 (/ (/ x t) z_m)))))))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = -2.0 * (x / (z_m * t));
double tmp;
if (t <= -3.25e+21) {
tmp = t_1;
} else if (t <= -1.85e-190) {
tmp = (x / z_m) * (2.0 / y);
} else if (t <= -1.8e-190) {
tmp = t_1;
} else if (t <= 5.2e+80) {
tmp = (2.0 / y) / (z_m / x);
} else if (t <= 4.7e+95) {
tmp = -2.0 / (z_m * (t / x));
} else if (t <= 4.8e+95) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) * (x / (z_m * t))
if (t <= (-3.25d+21)) then
tmp = t_1
else if (t <= (-1.85d-190)) then
tmp = (x / z_m) * (2.0d0 / y)
else if (t <= (-1.8d-190)) then
tmp = t_1
else if (t <= 5.2d+80) then
tmp = (2.0d0 / y) / (z_m / x)
else if (t <= 4.7d+95) then
tmp = (-2.0d0) / (z_m * (t / x))
else if (t <= 4.8d+95) then
tmp = x * (2.0d0 / (z_m * y))
else
tmp = (-2.0d0) * ((x / t) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = -2.0 * (x / (z_m * t));
double tmp;
if (t <= -3.25e+21) {
tmp = t_1;
} else if (t <= -1.85e-190) {
tmp = (x / z_m) * (2.0 / y);
} else if (t <= -1.8e-190) {
tmp = t_1;
} else if (t <= 5.2e+80) {
tmp = (2.0 / y) / (z_m / x);
} else if (t <= 4.7e+95) {
tmp = -2.0 / (z_m * (t / x));
} else if (t <= 4.8e+95) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): t_1 = -2.0 * (x / (z_m * t)) tmp = 0 if t <= -3.25e+21: tmp = t_1 elif t <= -1.85e-190: tmp = (x / z_m) * (2.0 / y) elif t <= -1.8e-190: tmp = t_1 elif t <= 5.2e+80: tmp = (2.0 / y) / (z_m / x) elif t <= 4.7e+95: tmp = -2.0 / (z_m * (t / x)) elif t <= 4.8e+95: tmp = x * (2.0 / (z_m * y)) else: tmp = -2.0 * ((x / t) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) t_1 = Float64(-2.0 * Float64(x / Float64(z_m * t))) tmp = 0.0 if (t <= -3.25e+21) tmp = t_1; elseif (t <= -1.85e-190) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); elseif (t <= -1.8e-190) tmp = t_1; elseif (t <= 5.2e+80) tmp = Float64(Float64(2.0 / y) / Float64(z_m / x)); elseif (t <= 4.7e+95) tmp = Float64(-2.0 / Float64(z_m * Float64(t / x))); elseif (t <= 4.8e+95) tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); else tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) t_1 = -2.0 * (x / (z_m * t)); tmp = 0.0; if (t <= -3.25e+21) tmp = t_1; elseif (t <= -1.85e-190) tmp = (x / z_m) * (2.0 / y); elseif (t <= -1.8e-190) tmp = t_1; elseif (t <= 5.2e+80) tmp = (2.0 / y) / (z_m / x); elseif (t <= 4.7e+95) tmp = -2.0 / (z_m * (t / x)); elseif (t <= 4.8e+95) tmp = x * (2.0 / (z_m * y)); else tmp = -2.0 * ((x / t) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[t, -3.25e+21], t$95$1, If[LessEqual[t, -1.85e-190], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.8e-190], t$95$1, If[LessEqual[t, 5.2e+80], N[(N[(2.0 / y), $MachinePrecision] / N[(z$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.7e+95], N[(-2.0 / N[(z$95$m * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+95], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]]]]]), $MachinePrecision]]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := -2 \cdot \frac{x}{z\_m \cdot t}\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.25 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-190}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+80}:\\
\;\;\;\;\frac{\frac{2}{y}}{\frac{z\_m}{x}}\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+95}:\\
\;\;\;\;\frac{-2}{z\_m \cdot \frac{t}{x}}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z\_m}\\
\end{array}
\end{array}
\end{array}
if t < -3.25e21 or -1.8500000000000001e-190 < t < -1.80000000000000003e-190Initial program 83.1%
distribute-rgt-out--88.7%
Simplified88.7%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
if -3.25e21 < t < -1.8500000000000001e-190Initial program 89.1%
distribute-rgt-out--89.1%
Simplified89.1%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
Simplified60.4%
times-frac66.3%
Applied egg-rr66.3%
if -1.80000000000000003e-190 < t < 5.19999999999999963e80Initial program 89.0%
distribute-rgt-out--92.8%
Simplified92.8%
Taylor expanded in y around inf 74.1%
*-commutative74.1%
Simplified74.1%
times-frac78.5%
Applied egg-rr78.5%
*-commutative78.5%
clear-num78.7%
un-div-inv79.2%
Applied egg-rr79.2%
if 5.19999999999999963e80 < t < 4.69999999999999972e95Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
*-commutative99.6%
Simplified99.6%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
associate-/l*100.0%
Simplified100.0%
if 4.69999999999999972e95 < t < 4.8000000000000001e95Initial program 100.0%
distribute-rgt-out--100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r/100.0%
Simplified100.0%
if 4.8000000000000001e95 < t Initial program 89.6%
distribute-rgt-out--89.7%
Simplified89.7%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in x around 0 77.7%
associate-/r*87.2%
Simplified87.2%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(let* ((t_1 (* (/ x z_m) (/ 2.0 y))) (t_2 (* -2.0 (/ x (* z_m t)))))
(*
z_s
(if (<= t -6.5e+20)
t_2
(if (<= t -1.85e-190)
t_1
(if (<= t -1.8e-190)
t_2
(if (<= t 4.8e-8) t_1 (* -2.0 (/ (/ x t) z_m)))))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = (x / z_m) * (2.0 / y);
double t_2 = -2.0 * (x / (z_m * t));
double tmp;
if (t <= -6.5e+20) {
tmp = t_2;
} else if (t <= -1.85e-190) {
tmp = t_1;
} else if (t <= -1.8e-190) {
tmp = t_2;
} else if (t <= 4.8e-8) {
tmp = t_1;
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / z_m) * (2.0d0 / y)
t_2 = (-2.0d0) * (x / (z_m * t))
if (t <= (-6.5d+20)) then
tmp = t_2
else if (t <= (-1.85d-190)) then
tmp = t_1
else if (t <= (-1.8d-190)) then
tmp = t_2
else if (t <= 4.8d-8) then
tmp = t_1
else
tmp = (-2.0d0) * ((x / t) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double t_1 = (x / z_m) * (2.0 / y);
double t_2 = -2.0 * (x / (z_m * t));
double tmp;
if (t <= -6.5e+20) {
tmp = t_2;
} else if (t <= -1.85e-190) {
tmp = t_1;
} else if (t <= -1.8e-190) {
tmp = t_2;
} else if (t <= 4.8e-8) {
tmp = t_1;
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): t_1 = (x / z_m) * (2.0 / y) t_2 = -2.0 * (x / (z_m * t)) tmp = 0 if t <= -6.5e+20: tmp = t_2 elif t <= -1.85e-190: tmp = t_1 elif t <= -1.8e-190: tmp = t_2 elif t <= 4.8e-8: tmp = t_1 else: tmp = -2.0 * ((x / t) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) t_1 = Float64(Float64(x / z_m) * Float64(2.0 / y)) t_2 = Float64(-2.0 * Float64(x / Float64(z_m * t))) tmp = 0.0 if (t <= -6.5e+20) tmp = t_2; elseif (t <= -1.85e-190) tmp = t_1; elseif (t <= -1.8e-190) tmp = t_2; elseif (t <= 4.8e-8) tmp = t_1; else tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) t_1 = (x / z_m) * (2.0 / y); t_2 = -2.0 * (x / (z_m * t)); tmp = 0.0; if (t <= -6.5e+20) tmp = t_2; elseif (t <= -1.85e-190) tmp = t_1; elseif (t <= -1.8e-190) tmp = t_2; elseif (t <= 4.8e-8) tmp = t_1; else tmp = -2.0 * ((x / t) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := Block[{t$95$1 = N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[t, -6.5e+20], t$95$2, If[LessEqual[t, -1.85e-190], t$95$1, If[LessEqual[t, -1.8e-190], t$95$2, If[LessEqual[t, 4.8e-8], t$95$1, N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := \frac{x}{z\_m} \cdot \frac{2}{y}\\
t_2 := -2 \cdot \frac{x}{z\_m \cdot t}\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-190}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z\_m}\\
\end{array}
\end{array}
\end{array}
if t < -6.5e20 or -1.8500000000000001e-190 < t < -1.80000000000000003e-190Initial program 83.1%
distribute-rgt-out--88.7%
Simplified88.7%
Taylor expanded in y around 0 81.2%
*-commutative81.2%
Simplified81.2%
if -6.5e20 < t < -1.8500000000000001e-190 or -1.80000000000000003e-190 < t < 4.79999999999999997e-8Initial program 87.4%
distribute-rgt-out--90.4%
Simplified90.4%
Taylor expanded in y around inf 70.1%
*-commutative70.1%
Simplified70.1%
times-frac75.0%
Applied egg-rr75.0%
if 4.79999999999999997e-8 < t Initial program 94.0%
distribute-rgt-out--94.0%
Simplified94.0%
Taylor expanded in y around 0 72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in x around 0 72.8%
associate-/r*78.2%
Simplified78.2%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (or (<= (* x 2.0) 5e-132) (not (<= (* x 2.0) 1e+259)))
(* 2.0 (/ (/ x z_m) (- y t)))
(* (/ x (- y t)) (/ 2.0 z_m)))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (((x * 2.0) <= 5e-132) || !((x * 2.0) <= 1e+259)) {
tmp = 2.0 * ((x / z_m) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (((x * 2.0d0) <= 5d-132) .or. (.not. ((x * 2.0d0) <= 1d+259))) then
tmp = 2.0d0 * ((x / z_m) / (y - t))
else
tmp = (x / (y - t)) * (2.0d0 / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (((x * 2.0) <= 5e-132) || !((x * 2.0) <= 1e+259)) {
tmp = 2.0 * ((x / z_m) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if ((x * 2.0) <= 5e-132) or not ((x * 2.0) <= 1e+259): tmp = 2.0 * ((x / z_m) / (y - t)) else: tmp = (x / (y - t)) * (2.0 / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if ((Float64(x * 2.0) <= 5e-132) || !(Float64(x * 2.0) <= 1e+259)) tmp = Float64(2.0 * Float64(Float64(x / z_m) / Float64(y - t))); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (((x * 2.0) <= 5e-132) || ~(((x * 2.0) <= 1e+259))) tmp = 2.0 * ((x / z_m) / (y - t)); else tmp = (x / (y - t)) * (2.0 / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[Or[LessEqual[N[(x * 2.0), $MachinePrecision], 5e-132], N[Not[LessEqual[N[(x * 2.0), $MachinePrecision], 1e+259]], $MachinePrecision]], N[(2.0 * N[(N[(x / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 5 \cdot 10^{-132} \lor \neg \left(x \cdot 2 \leq 10^{+259}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 4.9999999999999999e-132 or 9.999999999999999e258 < (*.f64 x #s(literal 2 binary64)) Initial program 90.8%
distribute-rgt-out--91.5%
Simplified91.5%
Taylor expanded in x around 0 91.4%
associate-/r*95.6%
Simplified95.6%
if 4.9999999999999999e-132 < (*.f64 x #s(literal 2 binary64)) < 9.999999999999999e258Initial program 82.4%
distribute-rgt-out--90.0%
Simplified90.0%
*-commutative90.0%
times-frac97.2%
Applied egg-rr97.2%
Final simplification96.1%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -3.7e-34)
(* -2.0 (/ x (* z_m t)))
(if (<= t -4e-131)
(* (/ 2.0 z_m) (/ x y))
(if (<= t 2.35e-27) (* x (/ 2.0 (* z_m y))) (* -2.0 (/ (/ x t) z_m)))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.7e-34) {
tmp = -2.0 * (x / (z_m * t));
} else if (t <= -4e-131) {
tmp = (2.0 / z_m) * (x / y);
} else if (t <= 2.35e-27) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.7d-34)) then
tmp = (-2.0d0) * (x / (z_m * t))
else if (t <= (-4d-131)) then
tmp = (2.0d0 / z_m) * (x / y)
else if (t <= 2.35d-27) then
tmp = x * (2.0d0 / (z_m * y))
else
tmp = (-2.0d0) * ((x / t) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -3.7e-34) {
tmp = -2.0 * (x / (z_m * t));
} else if (t <= -4e-131) {
tmp = (2.0 / z_m) * (x / y);
} else if (t <= 2.35e-27) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -3.7e-34: tmp = -2.0 * (x / (z_m * t)) elif t <= -4e-131: tmp = (2.0 / z_m) * (x / y) elif t <= 2.35e-27: tmp = x * (2.0 / (z_m * y)) else: tmp = -2.0 * ((x / t) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -3.7e-34) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); elseif (t <= -4e-131) tmp = Float64(Float64(2.0 / z_m) * Float64(x / y)); elseif (t <= 2.35e-27) tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); else tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -3.7e-34) tmp = -2.0 * (x / (z_m * t)); elseif (t <= -4e-131) tmp = (2.0 / z_m) * (x / y); elseif (t <= 2.35e-27) tmp = x * (2.0 / (z_m * y)); else tmp = -2.0 * ((x / t) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -3.7e-34], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4e-131], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.35e-27], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-34}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-131}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-27}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z\_m}\\
\end{array}
\end{array}
if t < -3.69999999999999988e-34Initial program 82.3%
distribute-rgt-out--87.2%
Simplified87.2%
Taylor expanded in y around 0 76.0%
*-commutative76.0%
Simplified76.0%
if -3.69999999999999988e-34 < t < -3.9999999999999999e-131Initial program 90.7%
distribute-rgt-out--90.7%
Simplified90.7%
*-commutative90.7%
times-frac92.6%
Applied egg-rr92.6%
Taylor expanded in y around inf 64.0%
if -3.9999999999999999e-131 < t < 2.35000000000000016e-27Initial program 87.1%
distribute-rgt-out--91.3%
Simplified91.3%
Taylor expanded in x around 0 91.3%
associate-/r*95.2%
Simplified95.2%
Taylor expanded in y around inf 75.2%
associate-*r/75.2%
*-commutative75.2%
*-commutative75.2%
associate-*r/75.1%
Simplified75.1%
if 2.35000000000000016e-27 < t Initial program 94.2%
distribute-rgt-out--94.2%
Simplified94.2%
Taylor expanded in y around 0 70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in x around 0 70.9%
associate-/r*76.1%
Simplified76.1%
Final simplification74.4%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 3.5e-59)
(/ (* x 2.0) (* z_m (- y t)))
(if (<= z_m 1.2e+135)
(* 2.0 (/ (/ x z_m) (- y t)))
(* (/ x (- y t)) (/ 2.0 z_m))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 3.5e-59) {
tmp = (x * 2.0) / (z_m * (y - t));
} else if (z_m <= 1.2e+135) {
tmp = 2.0 * ((x / z_m) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (z_m <= 3.5d-59) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else if (z_m <= 1.2d+135) then
tmp = 2.0d0 * ((x / z_m) / (y - t))
else
tmp = (x / (y - t)) * (2.0d0 / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (z_m <= 3.5e-59) {
tmp = (x * 2.0) / (z_m * (y - t));
} else if (z_m <= 1.2e+135) {
tmp = 2.0 * ((x / z_m) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if z_m <= 3.5e-59: tmp = (x * 2.0) / (z_m * (y - t)) elif z_m <= 1.2e+135: tmp = 2.0 * ((x / z_m) / (y - t)) else: tmp = (x / (y - t)) * (2.0 / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (z_m <= 3.5e-59) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); elseif (z_m <= 1.2e+135) tmp = Float64(2.0 * Float64(Float64(x / z_m) / Float64(y - t))); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (z_m <= 3.5e-59) tmp = (x * 2.0) / (z_m * (y - t)); elseif (z_m <= 1.2e+135) tmp = 2.0 * ((x / z_m) / (y - t)); else tmp = (x / (y - t)) * (2.0 / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[z$95$m, 3.5e-59], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z$95$m, 1.2e+135], N[(2.0 * N[(N[(x / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 3.5 \cdot 10^{-59}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{elif}\;z\_m \leq 1.2 \cdot 10^{+135}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}
\end{array}
if z < 3.5000000000000001e-59Initial program 89.3%
distribute-rgt-out--92.2%
Simplified92.2%
if 3.5000000000000001e-59 < z < 1.19999999999999999e135Initial program 92.2%
distribute-rgt-out--92.4%
Simplified92.4%
Taylor expanded in x around 0 92.4%
associate-/r*99.9%
Simplified99.9%
if 1.19999999999999999e135 < z Initial program 78.3%
distribute-rgt-out--83.7%
Simplified83.7%
*-commutative83.7%
times-frac97.2%
Applied egg-rr97.2%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -4.4e-34)
(* -2.0 (/ x (* z_m t)))
(if (<= t 1.15e-25) (* x (/ 2.0 (* z_m y))) (* -2.0 (/ (/ x t) z_m))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -4.4e-34) {
tmp = -2.0 * (x / (z_m * t));
} else if (t <= 1.15e-25) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.4d-34)) then
tmp = (-2.0d0) * (x / (z_m * t))
else if (t <= 1.15d-25) then
tmp = x * (2.0d0 / (z_m * y))
else
tmp = (-2.0d0) * ((x / t) / z_m)
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -4.4e-34) {
tmp = -2.0 * (x / (z_m * t));
} else if (t <= 1.15e-25) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = -2.0 * ((x / t) / z_m);
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -4.4e-34: tmp = -2.0 * (x / (z_m * t)) elif t <= 1.15e-25: tmp = x * (2.0 / (z_m * y)) else: tmp = -2.0 * ((x / t) / z_m) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -4.4e-34) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); elseif (t <= 1.15e-25) tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); else tmp = Float64(-2.0 * Float64(Float64(x / t) / z_m)); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -4.4e-34) tmp = -2.0 * (x / (z_m * t)); elseif (t <= 1.15e-25) tmp = x * (2.0 / (z_m * y)); else tmp = -2.0 * ((x / t) / z_m); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -4.4e-34], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-25], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-34}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z\_m}\\
\end{array}
\end{array}
if t < -4.3999999999999998e-34Initial program 82.3%
distribute-rgt-out--87.2%
Simplified87.2%
Taylor expanded in y around 0 76.0%
*-commutative76.0%
Simplified76.0%
if -4.3999999999999998e-34 < t < 1.15e-25Initial program 87.9%
distribute-rgt-out--91.2%
Simplified91.2%
Taylor expanded in x around 0 91.2%
associate-/r*95.0%
Simplified95.0%
Taylor expanded in y around inf 71.5%
associate-*r/71.6%
*-commutative71.6%
*-commutative71.6%
associate-*r/71.5%
Simplified71.5%
if 1.15e-25 < t Initial program 94.2%
distribute-rgt-out--94.2%
Simplified94.2%
Taylor expanded in y around 0 70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in x around 0 70.9%
associate-/r*76.1%
Simplified76.1%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m t) :precision binary64 (* z_s (* 2.0 (/ (/ x z_m) (- y t)))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (2.0 * ((x / z_m) / (y - t)));
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * (2.0d0 * ((x / z_m) / (y - t)))
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (2.0 * ((x / z_m) / (y - t)));
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (2.0 * ((x / z_m) / (y - t)))
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(2.0 * Float64(Float64(x / z_m) / Float64(y - t)))) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (2.0 * ((x / z_m) / (y - t))); end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * N[(2.0 * N[(N[(x / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(2 \cdot \frac{\frac{x}{z\_m}}{y - t}\right)
\end{array}
Initial program 88.2%
distribute-rgt-out--91.0%
Simplified91.0%
Taylor expanded in x around 0 91.0%
associate-/r*93.7%
Simplified93.7%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m t) :precision binary64 (* z_s (* -2.0 (/ (/ x t) z_m))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * ((x / t) / z_m));
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * ((-2.0d0) * ((x / t) / z_m))
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * ((x / t) / z_m));
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (-2.0 * ((x / t) / z_m))
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(-2.0 * Float64(Float64(x / t) / z_m))) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (-2.0 * ((x / t) / z_m)); end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(-2 \cdot \frac{\frac{x}{t}}{z\_m}\right)
\end{array}
Initial program 88.2%
distribute-rgt-out--91.0%
Simplified91.0%
Taylor expanded in y around 0 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in x around 0 50.1%
associate-/r*51.0%
Simplified51.0%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m t) :precision binary64 (* z_s (* -2.0 (/ x (* z_m t)))))
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * (x / (z_m * t)));
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * ((-2.0d0) * (x / (z_m * t)))
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (-2.0 * (x / (z_m * t)));
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (-2.0 * (x / (z_m * t)))
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(-2.0 * Float64(x / Float64(z_m * t)))) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (-2.0 * (x / (z_m * t))); end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(-2 \cdot \frac{x}{z\_m \cdot t}\right)
\end{array}
Initial program 88.2%
distribute-rgt-out--91.0%
Simplified91.0%
Taylor expanded in y around 0 50.1%
*-commutative50.1%
Simplified50.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
(t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
(if (< t_2 -2.559141628295061e-13)
t_1
(if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / ((y - t) * z)) * 2.0d0
t_2 = (x * 2.0d0) / ((y * z) - (t * z))
if (t_2 < (-2.559141628295061d-13)) then
tmp = t_1
else if (t_2 < 1.045027827330126d-269) then
tmp = ((x / z) * 2.0d0) / (y - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / ((y - t) * z)) * 2.0 t_2 = (x * 2.0) / ((y * z) - (t * z)) tmp = 0 if t_2 < -2.559141628295061e-13: tmp = t_1 elif t_2 < 1.045027827330126e-269: tmp = ((x / z) * 2.0) / (y - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0) t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) tmp = 0.0 if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / ((y - t) * z)) * 2.0; t_2 = (x * 2.0) / ((y * z) - (t * z)); tmp = 0.0; if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = ((x / z) * 2.0) / (y - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t\_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024107
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))