
(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 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 1.22e+101)
(/ (* x 2.0) (* z_m (- y t)))
(/ (/ (* x 2.0) (- y 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 (z_m <= 1.22e+101) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = ((x * 2.0) / (y - 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 (z_m <= 1.22d+101) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = ((x * 2.0d0) / (y - 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 (z_m <= 1.22e+101) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = ((x * 2.0) / (y - 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 z_m <= 1.22e+101: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = ((x * 2.0) / (y - 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 (z_m <= 1.22e+101) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(Float64(x * 2.0) / Float64(y - 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 (z_m <= 1.22e+101) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = ((x * 2.0) / (y - 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[z$95$m, 1.22e+101], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $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.22 \cdot 10^{+101}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{y - t}}{z\_m}\\
\end{array}
\end{array}
if z < 1.22e101Initial program 91.0%
distribute-rgt-out--93.9%
Simplified93.9%
if 1.22e101 < z Initial program 79.5%
distribute-rgt-out--84.1%
associate-/l/97.9%
Simplified97.9%
Final simplification94.6%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (or (<= y -0.48) (not (<= y 7.5e-12)))
(* 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 <= -0.48) || !(y <= 7.5e-12)) {
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 <= (-0.48d0)) .or. (.not. (y <= 7.5d-12))) 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 <= -0.48) || !(y <= 7.5e-12)) {
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 <= -0.48) or not (y <= 7.5e-12): 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 <= -0.48) || !(y <= 7.5e-12)) tmp = Float64(x * Float64(2.0 / Float64(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 <= -0.48) || ~((y <= 7.5e-12))) 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, -0.48], N[Not[LessEqual[y, 7.5e-12]], $MachinePrecision]], N[(x * N[(2.0 / N[(z$95$m * y), $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 -0.48 \lor \neg \left(y \leq 7.5 \cdot 10^{-12}\right):\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if y < -0.47999999999999998 or 7.5e-12 < y Initial program 83.9%
associate-/l*83.9%
distribute-rgt-out--89.3%
Simplified89.3%
Taylor expanded in y around inf 79.8%
*-commutative79.8%
Simplified79.8%
if -0.47999999999999998 < y < 7.5e-12Initial program 94.3%
distribute-rgt-out--95.1%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in y around 0 80.1%
*-commutative80.1%
Simplified80.1%
Final simplification79.9%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= y -2.05)
(* (/ 2.0 z_m) (/ x y))
(if (<= y 1.26e-14) (* -2.0 (/ x (* z_m t))) (* x (/ 2.0 (* z_m y)))))))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 <= -2.05) {
tmp = (2.0 / z_m) * (x / y);
} else if (y <= 1.26e-14) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = x * (2.0 / (z_m * y));
}
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 <= (-2.05d0)) then
tmp = (2.0d0 / z_m) * (x / y)
else if (y <= 1.26d-14) then
tmp = (-2.0d0) * (x / (z_m * t))
else
tmp = x * (2.0d0 / (z_m * y))
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 <= -2.05) {
tmp = (2.0 / z_m) * (x / y);
} else if (y <= 1.26e-14) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = x * (2.0 / (z_m * y));
}
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 <= -2.05: tmp = (2.0 / z_m) * (x / y) elif y <= 1.26e-14: tmp = -2.0 * (x / (z_m * t)) else: tmp = x * (2.0 / (z_m * y)) 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 <= -2.05) tmp = Float64(Float64(2.0 / z_m) * Float64(x / y)); elseif (y <= 1.26e-14) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); else tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); 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 <= -2.05) tmp = (2.0 / z_m) * (x / y); elseif (y <= 1.26e-14) tmp = -2.0 * (x / (z_m * t)); else tmp = x * (2.0 / (z_m * y)); 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[y, -2.05], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e-14], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z$95$m * y), $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 -2.05:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-14}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\end{array}
\end{array}
if y < -2.0499999999999998Initial program 82.1%
distribute-rgt-out--88.4%
associate-/r*93.7%
Simplified93.7%
associate-/l/88.4%
times-frac91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 74.7%
if -2.0499999999999998 < y < 1.25999999999999996e-14Initial program 94.3%
distribute-rgt-out--95.1%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in y around 0 80.1%
*-commutative80.1%
Simplified80.1%
if 1.25999999999999996e-14 < y Initial program 85.6%
associate-/l*85.6%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around inf 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification80.2%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= y -115.0)
(* (/ x z_m) (/ 2.0 y))
(if (<= y 3.8e-12) (* -2.0 (/ x (* z_m t))) (* x (/ 2.0 (* z_m y)))))))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 <= -115.0) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 3.8e-12) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = x * (2.0 / (z_m * y));
}
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 <= (-115.0d0)) then
tmp = (x / z_m) * (2.0d0 / y)
else if (y <= 3.8d-12) then
tmp = (-2.0d0) * (x / (z_m * t))
else
tmp = x * (2.0d0 / (z_m * y))
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 <= -115.0) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 3.8e-12) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = x * (2.0 / (z_m * y));
}
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 <= -115.0: tmp = (x / z_m) * (2.0 / y) elif y <= 3.8e-12: tmp = -2.0 * (x / (z_m * t)) else: tmp = x * (2.0 / (z_m * y)) 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 <= -115.0) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); elseif (y <= 3.8e-12) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); else tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); 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 <= -115.0) tmp = (x / z_m) * (2.0 / y); elseif (y <= 3.8e-12) tmp = -2.0 * (x / (z_m * t)); else tmp = x * (2.0 / (z_m * y)); 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[y, -115.0], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-12], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z$95$m * y), $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 -115:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\end{array}
\end{array}
if y < -115Initial program 82.1%
distribute-rgt-out--88.4%
associate-/r*93.7%
Simplified93.7%
associate-/r*88.4%
times-frac95.2%
Applied egg-rr95.2%
Taylor expanded in y around inf 78.8%
if -115 < y < 3.79999999999999996e-12Initial program 94.3%
distribute-rgt-out--95.1%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in y around 0 80.1%
*-commutative80.1%
Simplified80.1%
if 3.79999999999999996e-12 < y Initial program 85.6%
associate-/l*85.6%
distribute-rgt-out--90.1%
Simplified90.1%
Taylor expanded in y around inf 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification81.3%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= y -2.5)
(* (/ x z_m) (/ 2.0 y))
(if (<= y 1.02e-17) (* -2.0 (/ x (* z_m t))) (/ (* x 2.0) (* z_m y))))))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 <= -2.5) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 1.02e-17) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = (x * 2.0) / (z_m * y);
}
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 <= (-2.5d0)) then
tmp = (x / z_m) * (2.0d0 / y)
else if (y <= 1.02d-17) then
tmp = (-2.0d0) * (x / (z_m * t))
else
tmp = (x * 2.0d0) / (z_m * y)
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 <= -2.5) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 1.02e-17) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = (x * 2.0) / (z_m * y);
}
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 <= -2.5: tmp = (x / z_m) * (2.0 / y) elif y <= 1.02e-17: tmp = -2.0 * (x / (z_m * t)) else: tmp = (x * 2.0) / (z_m * y) 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 <= -2.5) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); elseif (y <= 1.02e-17) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); else tmp = Float64(Float64(x * 2.0) / Float64(z_m * y)); 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 <= -2.5) tmp = (x / z_m) * (2.0 / y); elseif (y <= 1.02e-17) tmp = -2.0 * (x / (z_m * t)); else tmp = (x * 2.0) / (z_m * y); 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[y, -2.5], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-17], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * y), $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 -2.5:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-17}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot y}\\
\end{array}
\end{array}
if y < -2.5Initial program 82.1%
distribute-rgt-out--88.4%
associate-/r*93.7%
Simplified93.7%
associate-/r*88.4%
times-frac95.2%
Applied egg-rr95.2%
Taylor expanded in y around inf 78.8%
if -2.5 < y < 1.01999999999999997e-17Initial program 94.3%
distribute-rgt-out--95.1%
associate-/r*91.5%
Simplified91.5%
Taylor expanded in y around 0 80.1%
*-commutative80.1%
Simplified80.1%
if 1.01999999999999997e-17 < y Initial program 85.6%
distribute-rgt-out--90.2%
Simplified90.2%
Taylor expanded in y around inf 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification81.3%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 1.6e+147)
(* x (/ 2.0 (* z_m (- y t))))
(* (/ 2.0 (- y t)) (/ x 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 <= 1.6e+147) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (2.0 / (y - t)) * (x / 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 <= 1.6d+147) then
tmp = x * (2.0d0 / (z_m * (y - t)))
else
tmp = (2.0d0 / (y - t)) * (x / 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 <= 1.6e+147) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (2.0 / (y - t)) * (x / 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 <= 1.6e+147: tmp = x * (2.0 / (z_m * (y - t))) else: tmp = (2.0 / (y - t)) * (x / 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 <= 1.6e+147) tmp = Float64(x * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(2.0 / Float64(y - t)) * Float64(x / 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 <= 1.6e+147) tmp = x * (2.0 / (z_m * (y - t))); else tmp = (2.0 / (y - t)) * (x / 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, 1.6e+147], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(x / 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 1.6 \cdot 10^{+147}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{y - t} \cdot \frac{x}{z\_m}\\
\end{array}
\end{array}
if z < 1.59999999999999989e147Initial program 91.2%
associate-/l*91.1%
distribute-rgt-out--94.0%
Simplified94.0%
if 1.59999999999999989e147 < z Initial program 77.1%
distribute-rgt-out--82.2%
associate-/r*97.7%
Simplified97.7%
associate-/r*82.2%
times-frac97.6%
Applied egg-rr97.6%
Final simplification94.5%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 4.3e+103)
(* x (/ 2.0 (* 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 <= 4.3e+103) {
tmp = x * (2.0 / (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 <= 4.3d+103) then
tmp = x * (2.0d0 / (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 <= 4.3e+103) {
tmp = x * (2.0 / (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 <= 4.3e+103: tmp = x * (2.0 / (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 <= 4.3e+103) tmp = Float64(x * Float64(2.0 / Float64(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 <= 4.3e+103) tmp = x * (2.0 / (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, 4.3e+103], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $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 4.3 \cdot 10^{+103}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}
\end{array}
if z < 4.29999999999999969e103Initial program 91.0%
associate-/l*90.9%
distribute-rgt-out--93.8%
Simplified93.8%
if 4.29999999999999969e103 < z Initial program 79.5%
distribute-rgt-out--84.1%
associate-/r*94.0%
Simplified94.0%
associate-/l/84.1%
times-frac97.8%
Applied egg-rr97.8%
Final simplification94.5%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 2.4e+102)
(/ (* x 2.0) (* 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 <= 2.4e+102) {
tmp = (x * 2.0) / (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 <= 2.4d+102) then
tmp = (x * 2.0d0) / (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 <= 2.4e+102) {
tmp = (x * 2.0) / (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 <= 2.4e+102: tmp = (x * 2.0) / (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 <= 2.4e+102) tmp = Float64(Float64(x * 2.0) / Float64(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 <= 2.4e+102) tmp = (x * 2.0) / (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, 2.4e+102], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * 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 2.4 \cdot 10^{+102}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z\_m}\\
\end{array}
\end{array}
if z < 2.39999999999999994e102Initial program 91.0%
distribute-rgt-out--93.9%
Simplified93.9%
if 2.39999999999999994e102 < z Initial program 79.5%
distribute-rgt-out--84.1%
associate-/r*94.0%
Simplified94.0%
associate-/l/84.1%
times-frac97.8%
Applied egg-rr97.8%
Final simplification94.6%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= z_m 1.25e+101)
(/ (* x 2.0) (* z_m (- y t)))
(/ (* x (/ 2.0 (- y 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 (z_m <= 1.25e+101) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (x * (2.0 / (y - 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 (z_m <= 1.25d+101) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = (x * (2.0d0 / (y - 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 (z_m <= 1.25e+101) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (x * (2.0 / (y - 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 z_m <= 1.25e+101: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = (x * (2.0 / (y - 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 (z_m <= 1.25e+101) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(x * Float64(2.0 / Float64(y - 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 (z_m <= 1.25e+101) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = (x * (2.0 / (y - 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[z$95$m, 1.25e+101], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $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.25 \cdot 10^{+101}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z\_m}\\
\end{array}
\end{array}
if z < 1.24999999999999997e101Initial program 91.0%
distribute-rgt-out--93.9%
Simplified93.9%
if 1.24999999999999997e101 < z Initial program 79.5%
distribute-rgt-out--84.1%
associate-/l/97.9%
Simplified97.9%
associate-/l*98.0%
*-commutative98.0%
Applied egg-rr98.0%
Final simplification94.6%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 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 89.0%
associate-/l*88.9%
distribute-rgt-out--92.1%
Simplified92.1%
Final simplification92.1%
z_m = (fabs.f64 z) z_s = (copysign.f64 1 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 89.0%
distribute-rgt-out--92.1%
associate-/r*92.4%
Simplified92.4%
Taylor expanded in y around 0 54.9%
*-commutative54.9%
Simplified54.9%
Final simplification54.9%
(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 2024046
(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))))