
(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 10 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
(let* ((t_1 (- (* y z_m) (* z_m t))))
(*
z_s
(if (<= t_1 (- INFINITY))
(* (/ x z_m) (/ 2.0 (- y t)))
(if (<= t_1 1e+274) (/ (* x 2.0) t_1) (/ (* x (/ 2.0 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) {
double t_1 = (y * z_m) - (z_m * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / z_m) * (2.0 / (y - t));
} else if (t_1 <= 1e+274) {
tmp = (x * 2.0) / t_1;
} else {
tmp = (x * (2.0 / z_m)) / (y - t);
}
return z_s * tmp;
}
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 = (y * z_m) - (z_m * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / z_m) * (2.0 / (y - t));
} else if (t_1 <= 1e+274) {
tmp = (x * 2.0) / t_1;
} else {
tmp = (x * (2.0 / z_m)) / (y - 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 = (y * z_m) - (z_m * t) tmp = 0 if t_1 <= -math.inf: tmp = (x / z_m) * (2.0 / (y - t)) elif t_1 <= 1e+274: tmp = (x * 2.0) / t_1 else: tmp = (x * (2.0 / z_m)) / (y - 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(y * z_m) - Float64(z_m * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / z_m) * Float64(2.0 / Float64(y - t))); elseif (t_1 <= 1e+274) tmp = Float64(Float64(x * 2.0) / t_1); else tmp = Float64(Float64(x * Float64(2.0 / z_m)) / Float64(y - 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 = (y * z_m) - (z_m * t); tmp = 0.0; if (t_1 <= -Inf) tmp = (x / z_m) * (2.0 / (y - t)); elseif (t_1 <= 1e+274) tmp = (x * 2.0) / t_1; else tmp = (x * (2.0 / z_m)) / (y - 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[(y * z$95$m), $MachinePrecision] - N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+274], N[(N[(x * 2.0), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(x * N[(2.0 / z$95$m), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
\begin{array}{l}
t_1 := y \cdot z\_m - z\_m \cdot t\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y - t}\\
\mathbf{elif}\;t\_1 \leq 10^{+274}:\\
\;\;\;\;\frac{x \cdot 2}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{z\_m}}{y - t}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -inf.0Initial program 58.4%
distribute-rgt-out--58.4%
Simplified58.4%
times-frac99.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (*.f64 y z) (*.f64 t z)) < 9.99999999999999921e273Initial program 98.3%
if 9.99999999999999921e273 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 64.4%
distribute-rgt-out--79.2%
Simplified79.2%
distribute-rgt-out--64.4%
associate-/l*64.4%
*-commutative64.4%
distribute-rgt-out--79.2%
Applied egg-rr79.2%
associate-*l/79.2%
frac-times99.8%
frac-2neg99.8%
associate-*r/99.9%
sub-neg99.9%
distribute-neg-in99.9%
add-sqr-sqrt40.7%
sqrt-unprod79.1%
sqr-neg79.1%
sqrt-unprod45.2%
add-sqr-sqrt75.2%
add-sqr-sqrt30.1%
sqrt-unprod82.4%
sqr-neg82.4%
sqrt-unprod59.2%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
frac-2neg99.9%
div-inv99.8%
distribute-rgt-neg-out99.8%
remove-double-neg99.8%
distribute-neg-in99.8%
add-sqr-sqrt44.4%
sqrt-unprod92.8%
sqr-neg92.8%
sqrt-unprod51.8%
add-sqr-sqrt92.7%
sub-neg92.7%
add-sqr-sqrt40.9%
sqrt-unprod96.3%
sqr-neg96.3%
sqrt-unprod55.4%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
associate-*r/99.9%
*-rgt-identity99.9%
*-commutative99.9%
Simplified99.9%
Final simplification98.6%
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 (<= y -3.5e-52) (not (<= y 1.15e+15)))
(* x (/ (/ 2.0 z_m) y))
(/ x (* (* z_m t) -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 ((y <= -3.5e-52) || !(y <= 1.15e+15)) {
tmp = x * ((2.0 / z_m) / y);
} else {
tmp = x / ((z_m * t) * -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 ((y <= (-3.5d-52)) .or. (.not. (y <= 1.15d+15))) then
tmp = x * ((2.0d0 / z_m) / y)
else
tmp = x / ((z_m * t) * (-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 ((y <= -3.5e-52) || !(y <= 1.15e+15)) {
tmp = x * ((2.0 / z_m) / y);
} else {
tmp = x / ((z_m * t) * -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 (y <= -3.5e-52) or not (y <= 1.15e+15): tmp = x * ((2.0 / z_m) / y) else: tmp = x / ((z_m * t) * -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 ((y <= -3.5e-52) || !(y <= 1.15e+15)) tmp = Float64(x * Float64(Float64(2.0 / z_m) / y)); else tmp = Float64(x / Float64(Float64(z_m * t) * -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 ((y <= -3.5e-52) || ~((y <= 1.15e+15))) tmp = x * ((2.0 / z_m) / y); else tmp = x / ((z_m * t) * -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[Or[LessEqual[y, -3.5e-52], N[Not[LessEqual[y, 1.15e+15]], $MachinePrecision]], N[(x * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(z$95$m * t), $MachinePrecision] * -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}\;y \leq -3.5 \cdot 10^{-52} \lor \neg \left(y \leq 1.15 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot \frac{\frac{2}{z\_m}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(z\_m \cdot t\right) \cdot -0.5}\\
\end{array}
\end{array}
if y < -3.5e-52 or 1.15e15 < y Initial program 91.5%
distribute-rgt-out--94.8%
Simplified94.8%
distribute-rgt-out--91.5%
associate-/l*91.4%
*-commutative91.4%
distribute-rgt-out--94.7%
Applied egg-rr94.7%
Taylor expanded in y around inf 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in z around 0 81.8%
associate-/l/83.0%
Simplified83.0%
if -3.5e-52 < y < 1.15e15Initial program 91.5%
distribute-rgt-out--92.2%
Simplified92.2%
Taylor expanded in y around 0 72.5%
associate-*r*72.5%
neg-mul-172.5%
*-commutative72.5%
Simplified72.5%
distribute-rgt-neg-out72.5%
distribute-frac-neg272.5%
distribute-frac-neg72.5%
*-commutative72.5%
distribute-lft-neg-in72.5%
metadata-eval72.5%
times-frac70.9%
Applied egg-rr70.9%
clear-num70.9%
frac-2neg70.9%
frac-times72.5%
*-un-lft-identity72.5%
add-sqr-sqrt42.3%
sqrt-unprod35.8%
sqr-neg35.8%
sqrt-unprod8.2%
add-sqr-sqrt15.5%
clear-num15.5%
add-sqr-sqrt8.6%
sqrt-unprod30.4%
frac-times30.4%
metadata-eval30.4%
metadata-eval30.4%
frac-times30.4%
sqrt-unprod31.4%
add-sqr-sqrt72.4%
clear-num72.5%
div-inv72.5%
metadata-eval72.5%
Applied egg-rr72.5%
*-commutative72.5%
distribute-lft-neg-out72.5%
associate-*r*72.5%
*-commutative72.5%
distribute-rgt-neg-in72.5%
metadata-eval72.5%
Simplified72.5%
Final simplification77.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 (or (<= y -1.2e-51) (not (<= y 6.2e+14)))
(* x (/ (/ 2.0 z_m) y))
(* -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) {
double tmp;
if ((y <= -1.2e-51) || !(y <= 6.2e+14)) {
tmp = x * ((2.0 / z_m) / y);
} else {
tmp = -2.0 * (x / (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) :: tmp
if ((y <= (-1.2d-51)) .or. (.not. (y <= 6.2d+14))) then
tmp = x * ((2.0d0 / z_m) / y)
else
tmp = (-2.0d0) * (x / (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 tmp;
if ((y <= -1.2e-51) || !(y <= 6.2e+14)) {
tmp = x * ((2.0 / z_m) / y);
} else {
tmp = -2.0 * (x / (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): tmp = 0 if (y <= -1.2e-51) or not (y <= 6.2e+14): tmp = x * ((2.0 / z_m) / y) else: tmp = -2.0 * (x / (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) tmp = 0.0 if ((y <= -1.2e-51) || !(y <= 6.2e+14)) tmp = Float64(x * Float64(Float64(2.0 / z_m) / y)); else tmp = Float64(-2.0 * Float64(x / Float64(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) tmp = 0.0; if ((y <= -1.2e-51) || ~((y <= 6.2e+14))) tmp = x * ((2.0 / z_m) / y); else tmp = -2.0 * (x / (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_] := N[(z$95$s * If[Or[LessEqual[y, -1.2e-51], N[Not[LessEqual[y, 6.2e+14]], $MachinePrecision]], N[(x * N[(N[(2.0 / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-51} \lor \neg \left(y \leq 6.2 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \frac{\frac{2}{z\_m}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if y < -1.2e-51 or 6.2e14 < y Initial program 91.5%
distribute-rgt-out--94.8%
Simplified94.8%
distribute-rgt-out--91.5%
associate-/l*91.4%
*-commutative91.4%
distribute-rgt-out--94.7%
Applied egg-rr94.7%
Taylor expanded in y around inf 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in z around 0 81.8%
associate-/l/83.0%
Simplified83.0%
if -1.2e-51 < y < 6.2e14Initial program 91.5%
distribute-rgt-out--92.2%
Simplified92.2%
Taylor expanded in y around 0 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification77.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 (or (<= y -1.04e-51) (not (<= y 6.4e+14)))
(* x (/ 2.0 (* y z_m)))
(* -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) {
double tmp;
if ((y <= -1.04e-51) || !(y <= 6.4e+14)) {
tmp = x * (2.0 / (y * z_m));
} else {
tmp = -2.0 * (x / (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) :: tmp
if ((y <= (-1.04d-51)) .or. (.not. (y <= 6.4d+14))) then
tmp = x * (2.0d0 / (y * z_m))
else
tmp = (-2.0d0) * (x / (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 tmp;
if ((y <= -1.04e-51) || !(y <= 6.4e+14)) {
tmp = x * (2.0 / (y * z_m));
} else {
tmp = -2.0 * (x / (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): tmp = 0 if (y <= -1.04e-51) or not (y <= 6.4e+14): tmp = x * (2.0 / (y * z_m)) else: tmp = -2.0 * (x / (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) tmp = 0.0 if ((y <= -1.04e-51) || !(y <= 6.4e+14)) tmp = Float64(x * Float64(2.0 / Float64(y * z_m))); else tmp = Float64(-2.0 * Float64(x / Float64(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) tmp = 0.0; if ((y <= -1.04e-51) || ~((y <= 6.4e+14))) tmp = x * (2.0 / (y * z_m)); else tmp = -2.0 * (x / (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_] := N[(z$95$s * If[Or[LessEqual[y, -1.04e-51], N[Not[LessEqual[y, 6.4e+14]], $MachinePrecision]], N[(x * N[(2.0 / N[(y * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;y \leq -1.04 \cdot 10^{-51} \lor \neg \left(y \leq 6.4 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \frac{2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if y < -1.0399999999999999e-51 or 6.4e14 < y Initial program 91.5%
distribute-rgt-out--94.8%
Simplified94.8%
distribute-rgt-out--91.5%
associate-/l*91.4%
*-commutative91.4%
distribute-rgt-out--94.7%
Applied egg-rr94.7%
Taylor expanded in y around inf 81.8%
*-commutative81.8%
Simplified81.8%
if -1.0399999999999999e-51 < y < 6.4e14Initial program 91.5%
distribute-rgt-out--92.2%
Simplified92.2%
Taylor expanded in y around 0 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification76.8%
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 (<= (* x 2.0) 1e-9)
(/ (* x 2.0) (* z_m (- y t)))
(* (/ 2.0 z_m) (/ x (- 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) {
double tmp;
if ((x * 2.0) <= 1e-9) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (2.0 / z_m) * (x / (y - 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) :: tmp
if ((x * 2.0d0) <= 1d-9) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = (2.0d0 / z_m) * (x / (y - 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 tmp;
if ((x * 2.0) <= 1e-9) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (2.0 / z_m) * (x / (y - 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): tmp = 0 if (x * 2.0) <= 1e-9: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = (2.0 / z_m) * (x / (y - t)) 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) <= 1e-9) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(2.0 / z_m) * Float64(x / Float64(y - 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) tmp = 0.0; if ((x * 2.0) <= 1e-9) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = (2.0 / z_m) * (x / (y - 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_] := N[(z$95$s * If[LessEqual[N[(x * 2.0), $MachinePrecision], 1e-9], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / 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 \begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 10^{-9}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 1.00000000000000006e-9Initial program 91.2%
distribute-rgt-out--93.3%
Simplified93.3%
if 1.00000000000000006e-9 < (*.f64 x #s(literal 2 binary64)) Initial program 92.3%
distribute-rgt-out--93.9%
Simplified93.9%
*-commutative93.9%
times-frac92.3%
Applied egg-rr92.3%
Final simplification93.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
(if (<= (* x 2.0) 1e-9)
(* x (/ 2.0 (* z_m (- y t))))
(* (/ 2.0 z_m) (/ x (- 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) {
double tmp;
if ((x * 2.0) <= 1e-9) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (2.0 / z_m) * (x / (y - 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) :: tmp
if ((x * 2.0d0) <= 1d-9) then
tmp = x * (2.0d0 / (z_m * (y - t)))
else
tmp = (2.0d0 / z_m) * (x / (y - 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 tmp;
if ((x * 2.0) <= 1e-9) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (2.0 / z_m) * (x / (y - 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): tmp = 0 if (x * 2.0) <= 1e-9: tmp = x * (2.0 / (z_m * (y - t))) else: tmp = (2.0 / z_m) * (x / (y - t)) 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) <= 1e-9) tmp = Float64(x * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(2.0 / z_m) * Float64(x / Float64(y - 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) tmp = 0.0; if ((x * 2.0) <= 1e-9) tmp = x * (2.0 / (z_m * (y - t))); else tmp = (2.0 / z_m) * (x / (y - 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_] := N[(z$95$s * If[LessEqual[N[(x * 2.0), $MachinePrecision], 1e-9], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / 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 \begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 10^{-9}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 1.00000000000000006e-9Initial program 91.2%
distribute-rgt-out--93.3%
Simplified93.3%
distribute-rgt-out--91.2%
associate-/l*91.1%
*-commutative91.1%
distribute-rgt-out--93.2%
Applied egg-rr93.2%
if 1.00000000000000006e-9 < (*.f64 x #s(literal 2 binary64)) Initial program 92.3%
distribute-rgt-out--93.9%
Simplified93.9%
*-commutative93.9%
times-frac92.3%
Applied egg-rr92.3%
Final simplification93.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
(if (<= z_m 2e+21)
(* x (/ 2.0 (* z_m (- y t))))
(* (/ x z_m) (/ 2.0 (- 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) {
double tmp;
if (z_m <= 2e+21) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (x / z_m) * (2.0 / (y - 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) :: tmp
if (z_m <= 2d+21) then
tmp = x * (2.0d0 / (z_m * (y - t)))
else
tmp = (x / z_m) * (2.0d0 / (y - 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 tmp;
if (z_m <= 2e+21) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (x / z_m) * (2.0 / (y - 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): tmp = 0 if z_m <= 2e+21: tmp = x * (2.0 / (z_m * (y - t))) else: tmp = (x / z_m) * (2.0 / (y - t)) 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 <= 2e+21) tmp = Float64(x * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(x / z_m) * Float64(2.0 / Float64(y - 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) tmp = 0.0; if (z_m <= 2e+21) tmp = x * (2.0 / (z_m * (y - t))); else tmp = (x / z_m) * (2.0 / (y - 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_] := N[(z$95$s * If[LessEqual[z$95$m, 2e+21], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / 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 \begin{array}{l}
\mathbf{if}\;z\_m \leq 2 \cdot 10^{+21}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y - t}\\
\end{array}
\end{array}
if z < 2e21Initial program 93.6%
distribute-rgt-out--96.0%
Simplified96.0%
distribute-rgt-out--93.6%
associate-/l*93.5%
*-commutative93.5%
distribute-rgt-out--95.9%
Applied egg-rr95.9%
if 2e21 < z Initial program 83.2%
distribute-rgt-out--83.2%
Simplified83.2%
times-frac92.5%
Applied egg-rr92.5%
Final simplification95.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 (<= z_m 1.8e+21) (* -2.0 (/ x (* z_m t))) (* -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) {
double tmp;
if (z_m <= 1.8e+21) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = -2.0 * ((x / 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) :: tmp
if (z_m <= 1.8d+21) then
tmp = (-2.0d0) * (x / (z_m * t))
else
tmp = (-2.0d0) * ((x / 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 tmp;
if (z_m <= 1.8e+21) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = -2.0 * ((x / 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): tmp = 0 if z_m <= 1.8e+21: tmp = -2.0 * (x / (z_m * t)) else: tmp = -2.0 * ((x / 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) tmp = 0.0 if (z_m <= 1.8e+21) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); else tmp = Float64(-2.0 * Float64(Float64(x / 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) tmp = 0.0; if (z_m <= 1.8e+21) tmp = -2.0 * (x / (z_m * t)); else tmp = -2.0 * ((x / 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_] := N[(z$95$s * If[LessEqual[z$95$m, 1.8e+21], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / z$95$m), $MachinePrecision] / t), $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 1.8 \cdot 10^{+21}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\
\end{array}
\end{array}
if z < 1.8e21Initial program 93.6%
distribute-rgt-out--96.0%
Simplified96.0%
Taylor expanded in y around 0 56.5%
*-commutative56.5%
Simplified56.5%
if 1.8e21 < z Initial program 83.2%
distribute-rgt-out--83.2%
Simplified83.2%
Taylor expanded in y around 0 38.9%
*-commutative38.9%
associate-/r*51.8%
Simplified51.8%
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 (* x (/ 2.0 (* 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 * (x * (2.0 / (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 * (x * (2.0d0 / (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 * (x * (2.0 / (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 * (x * (2.0 / (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(x * Float64(2.0 / Float64(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 * (x * (2.0 / (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[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\right)
\end{array}
Initial program 91.5%
distribute-rgt-out--93.4%
Simplified93.4%
distribute-rgt-out--91.5%
associate-/l*91.4%
*-commutative91.4%
distribute-rgt-out--93.4%
Applied egg-rr93.4%
Final simplification93.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 (* -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 91.5%
distribute-rgt-out--93.4%
Simplified93.4%
Taylor expanded in y around 0 53.0%
*-commutative53.0%
Simplified53.0%
(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 2024128
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (* x 2) (- (* y z) (* t z))) -2559141628295061/10000000000000000000000000000) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 522513913665063/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2))))
(/ (* x 2.0) (- (* y z) (* t z))))