
(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 5e+69)
(/ (* x 2.0) (* z_m (- y t)))
(* 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) {
double tmp;
if (z_m <= 5e+69) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = 2.0 * ((x / z_m) / (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 <= 5d+69) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = 2.0d0 * ((x / z_m) / (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 <= 5e+69) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = 2.0 * ((x / 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): tmp = 0 if z_m <= 5e+69: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = 2.0 * ((x / 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) tmp = 0.0 if (z_m <= 5e+69) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / 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) tmp = 0.0; if (z_m <= 5e+69) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = 2.0 * ((x / 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_] := N[(z$95$s * If[LessEqual[z$95$m, 5e+69], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;z\_m \leq 5 \cdot 10^{+69}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z\_m}}{y - t}\\
\end{array}
\end{array}
if z < 5.00000000000000036e69Initial program 93.4%
distribute-rgt-out--93.9%
Simplified93.9%
if 5.00000000000000036e69 < z Initial program 75.1%
distribute-rgt-out--85.4%
Simplified85.4%
Taylor expanded in x around 0 85.4%
associate-/r*92.7%
Simplified92.7%
Final simplification93.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
(if (or (<= t -1.65e-80) (not (<= t 4.8e-45)))
(* -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 ((t <= -1.65e-80) || !(t <= 4.8e-45)) {
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 ((t <= (-1.65d-80)) .or. (.not. (t <= 4.8d-45))) 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 ((t <= -1.65e-80) || !(t <= 4.8e-45)) {
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 (t <= -1.65e-80) or not (t <= 4.8e-45): 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 ((t <= -1.65e-80) || !(t <= 4.8e-45)) 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 ((t <= -1.65e-80) || ~((t <= 4.8e-45))) 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[Or[LessEqual[t, -1.65e-80], N[Not[LessEqual[t, 4.8e-45]], $MachinePrecision]], 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}\;t \leq -1.65 \cdot 10^{-80} \lor \neg \left(t \leq 4.8 \cdot 10^{-45}\right):\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\end{array}
\end{array}
if t < -1.65e-80 or 4.7999999999999998e-45 < t Initial program 86.8%
distribute-rgt-out--90.2%
Simplified90.2%
Taylor expanded in y around 0 73.7%
if -1.65e-80 < t < 4.7999999999999998e-45Initial program 95.9%
distribute-rgt-out--95.9%
Simplified95.9%
Taylor expanded in y around inf 80.7%
associate-*r/80.7%
*-commutative80.7%
associate-/r*76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in x around 0 80.7%
associate-*r/80.7%
*-commutative80.7%
*-commutative80.7%
associate-*r/80.1%
Simplified80.1%
Final simplification76.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.15e+24) (not (<= y 7e-59)))
(* 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.15e+24) || !(y <= 7e-59)) {
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.15d+24)) .or. (.not. (y <= 7d-59))) 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.15e+24) || !(y <= 7e-59)) {
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.15e+24) or not (y <= 7e-59): 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.15e+24) || !(y <= 7e-59)) tmp = Float64(x * Float64(Float64(2.0 / 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.15e+24) || ~((y <= 7e-59))) 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.15e+24], N[Not[LessEqual[y, 7e-59]], $MachinePrecision]], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z$95$m), $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.15 \cdot 10^{+24} \lor \neg \left(y \leq 7 \cdot 10^{-59}\right):\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if y < -1.15e24 or 7.0000000000000002e-59 < y Initial program 86.2%
distribute-rgt-out--90.4%
Simplified90.4%
clear-num89.8%
inv-pow89.8%
associate-/l*84.6%
Applied egg-rr84.6%
unpow-184.6%
associate-*r/89.8%
clear-num90.4%
frac-times94.1%
associate-*l/86.0%
associate-/l*91.5%
Applied egg-rr91.5%
Taylor expanded in y around inf 77.5%
if -1.15e24 < y < 7.0000000000000002e-59Initial program 94.6%
distribute-rgt-out--94.6%
Simplified94.6%
Taylor expanded in y around 0 76.0%
Final simplification76.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
(if (or (<= y -1.05e+25) (not (<= y 1.25e-57)))
(* (/ x z_m) (/ 2.0 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.05e+25) || !(y <= 1.25e-57)) {
tmp = (x / z_m) * (2.0 / 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.05d+25)) .or. (.not. (y <= 1.25d-57))) then
tmp = (x / z_m) * (2.0d0 / 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.05e+25) || !(y <= 1.25e-57)) {
tmp = (x / z_m) * (2.0 / 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.05e+25) or not (y <= 1.25e-57): tmp = (x / z_m) * (2.0 / 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.05e+25) || !(y <= 1.25e-57)) tmp = Float64(Float64(x / z_m) * Float64(2.0 / 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.05e+25) || ~((y <= 1.25e-57))) tmp = (x / z_m) * (2.0 / 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.05e+25], N[Not[LessEqual[y, 1.25e-57]], $MachinePrecision]], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / 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.05 \cdot 10^{+25} \lor \neg \left(y \leq 1.25 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if y < -1.05e25 or 1.25e-57 < y Initial program 86.2%
distribute-rgt-out--90.4%
Simplified90.4%
times-frac94.1%
Applied egg-rr94.1%
Taylor expanded in y around inf 82.0%
if -1.05e25 < y < 1.25e-57Initial program 94.6%
distribute-rgt-out--94.6%
Simplified94.6%
Taylor expanded in y around 0 76.0%
Final simplification78.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 (<= y -8.2e+20)
(* (/ x z_m) (/ 2.0 y))
(if (<= y 6e-60) (* -2.0 (/ x (* z_m t))) (/ 2.0 (* y (/ z_m x)))))))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 <= -8.2e+20) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 6e-60) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = 2.0 / (y * (z_m / x));
}
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 <= (-8.2d+20)) then
tmp = (x / z_m) * (2.0d0 / y)
else if (y <= 6d-60) then
tmp = (-2.0d0) * (x / (z_m * t))
else
tmp = 2.0d0 / (y * (z_m / x))
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 <= -8.2e+20) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 6e-60) {
tmp = -2.0 * (x / (z_m * t));
} else {
tmp = 2.0 / (y * (z_m / x));
}
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 <= -8.2e+20: tmp = (x / z_m) * (2.0 / y) elif y <= 6e-60: tmp = -2.0 * (x / (z_m * t)) else: tmp = 2.0 / (y * (z_m / x)) 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 <= -8.2e+20) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); elseif (y <= 6e-60) tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); else tmp = Float64(2.0 / Float64(y * Float64(z_m / x))); 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 <= -8.2e+20) tmp = (x / z_m) * (2.0 / y); elseif (y <= 6e-60) tmp = -2.0 * (x / (z_m * t)); else tmp = 2.0 / (y * (z_m / x)); 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, -8.2e+20], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-60], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(y * N[(z$95$m / x), $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 -8.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-60}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{y \cdot \frac{z\_m}{x}}\\
\end{array}
\end{array}
if y < -8.2e20Initial program 85.8%
distribute-rgt-out--87.9%
Simplified87.9%
times-frac91.8%
Applied egg-rr91.8%
Taylor expanded in y around inf 82.0%
if -8.2e20 < y < 6.00000000000000038e-60Initial program 94.6%
distribute-rgt-out--94.6%
Simplified94.6%
Taylor expanded in y around 0 76.0%
if 6.00000000000000038e-60 < y Initial program 86.4%
distribute-rgt-out--92.0%
Simplified92.0%
times-frac95.6%
Applied egg-rr95.6%
clear-num95.6%
frac-times96.0%
metadata-eval96.0%
Applied egg-rr96.0%
Taylor expanded in y around inf 78.2%
associate-*r/82.1%
Simplified82.1%
Final simplification78.9%
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 (<= y -2.1e-76)
(* (/ x z_m) (/ 2.0 y))
(if (<= y 3.2e-55) (/ (/ (* x -2.0) t) z_m) (/ 2.0 (* y (/ z_m x)))))))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.1e-76) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 3.2e-55) {
tmp = ((x * -2.0) / t) / z_m;
} else {
tmp = 2.0 / (y * (z_m / x));
}
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.1d-76)) then
tmp = (x / z_m) * (2.0d0 / y)
else if (y <= 3.2d-55) then
tmp = ((x * (-2.0d0)) / t) / z_m
else
tmp = 2.0d0 / (y * (z_m / x))
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.1e-76) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 3.2e-55) {
tmp = ((x * -2.0) / t) / z_m;
} else {
tmp = 2.0 / (y * (z_m / x));
}
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.1e-76: tmp = (x / z_m) * (2.0 / y) elif y <= 3.2e-55: tmp = ((x * -2.0) / t) / z_m else: tmp = 2.0 / (y * (z_m / x)) 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.1e-76) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); elseif (y <= 3.2e-55) tmp = Float64(Float64(Float64(x * -2.0) / t) / z_m); else tmp = Float64(2.0 / Float64(y * Float64(z_m / x))); 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.1e-76) tmp = (x / z_m) * (2.0 / y); elseif (y <= 3.2e-55) tmp = ((x * -2.0) / t) / z_m; else tmp = 2.0 / (y * (z_m / x)); 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.1e-76], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-55], N[(N[(N[(x * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], N[(2.0 / N[(y * N[(z$95$m / x), $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.1 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{y \cdot \frac{z\_m}{x}}\\
\end{array}
\end{array}
if y < -2.09999999999999992e-76Initial program 89.9%
distribute-rgt-out--91.4%
Simplified91.4%
times-frac92.7%
Applied egg-rr92.7%
Taylor expanded in y around inf 76.2%
if -2.09999999999999992e-76 < y < 3.2000000000000001e-55Initial program 93.8%
distribute-rgt-out--93.8%
Simplified93.8%
Taylor expanded in y around 0 78.3%
associate-*r/78.3%
*-commutative78.3%
associate-/r*78.5%
Simplified78.5%
if 3.2000000000000001e-55 < y Initial program 86.4%
distribute-rgt-out--92.0%
Simplified92.0%
times-frac95.6%
Applied egg-rr95.6%
clear-num95.6%
frac-times96.0%
metadata-eval96.0%
Applied egg-rr96.0%
Taylor expanded in y around inf 78.2%
associate-*r/82.1%
Simplified82.1%
Final simplification78.9%
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 (<= y -4e-77)
(* (/ x z_m) (/ 2.0 y))
(if (<= y 1.7e-56) (/ (/ (* x -2.0) t) z_m) (/ (/ (/ x z_m) y) 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 <= -4e-77) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 1.7e-56) {
tmp = ((x * -2.0) / t) / z_m;
} else {
tmp = ((x / z_m) / y) / 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 <= (-4d-77)) then
tmp = (x / z_m) * (2.0d0 / y)
else if (y <= 1.7d-56) then
tmp = ((x * (-2.0d0)) / t) / z_m
else
tmp = ((x / z_m) / y) / 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 <= -4e-77) {
tmp = (x / z_m) * (2.0 / y);
} else if (y <= 1.7e-56) {
tmp = ((x * -2.0) / t) / z_m;
} else {
tmp = ((x / z_m) / y) / 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 <= -4e-77: tmp = (x / z_m) * (2.0 / y) elif y <= 1.7e-56: tmp = ((x * -2.0) / t) / z_m else: tmp = ((x / z_m) / y) / 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 <= -4e-77) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); elseif (y <= 1.7e-56) tmp = Float64(Float64(Float64(x * -2.0) / t) / z_m); else tmp = Float64(Float64(Float64(x / z_m) / y) / 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 <= -4e-77) tmp = (x / z_m) * (2.0 / y); elseif (y <= 1.7e-56) tmp = ((x * -2.0) / t) / z_m; else tmp = ((x / z_m) / y) / 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[y, -4e-77], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-56], N[(N[(N[(x * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(N[(x / z$95$m), $MachinePrecision] / y), $MachinePrecision] / 0.5), $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 -4 \cdot 10^{-77}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-56}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{z\_m}}{y}}{0.5}\\
\end{array}
\end{array}
if y < -3.9999999999999997e-77Initial program 89.9%
distribute-rgt-out--91.4%
Simplified91.4%
times-frac92.7%
Applied egg-rr92.7%
Taylor expanded in y around inf 76.2%
if -3.9999999999999997e-77 < y < 1.69999999999999991e-56Initial program 93.8%
distribute-rgt-out--93.8%
Simplified93.8%
Taylor expanded in y around 0 78.3%
associate-*r/78.3%
*-commutative78.3%
associate-/r*78.5%
Simplified78.5%
if 1.69999999999999991e-56 < y Initial program 86.4%
distribute-rgt-out--92.0%
Simplified92.0%
Taylor expanded in y around inf 78.3%
*-commutative78.3%
Simplified78.3%
*-un-lft-identity78.3%
*-commutative78.3%
associate-/r*82.2%
associate-*r/82.0%
clear-num82.0%
un-div-inv82.2%
div-inv82.2%
metadata-eval82.2%
Applied egg-rr82.2%
*-rgt-identity82.2%
associate-/l/78.3%
associate-/r*71.3%
associate-/r*71.3%
associate-/r*78.3%
associate-/l/82.2%
Simplified82.2%
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
(*
z_s
(if (<= z_m 5.2e+71)
(* x (/ (/ 2.0 z_m) (- y t)))
(* 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) {
double tmp;
if (z_m <= 5.2e+71) {
tmp = x * ((2.0 / z_m) / (y - t));
} else {
tmp = 2.0 * ((x / z_m) / (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 <= 5.2d+71) then
tmp = x * ((2.0d0 / z_m) / (y - t))
else
tmp = 2.0d0 * ((x / z_m) / (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 <= 5.2e+71) {
tmp = x * ((2.0 / z_m) / (y - t));
} else {
tmp = 2.0 * ((x / 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): tmp = 0 if z_m <= 5.2e+71: tmp = x * ((2.0 / z_m) / (y - t)) else: tmp = 2.0 * ((x / 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) tmp = 0.0 if (z_m <= 5.2e+71) tmp = Float64(x * Float64(Float64(2.0 / z_m) / Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / 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) tmp = 0.0; if (z_m <= 5.2e+71) tmp = x * ((2.0 / z_m) / (y - t)); else tmp = 2.0 * ((x / 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_] := N[(z$95$s * If[LessEqual[z$95$m, 5.2e+71], N[(x * N[(N[(2.0 / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;z\_m \leq 5.2 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \frac{\frac{2}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z\_m}}{y - t}\\
\end{array}
\end{array}
if z < 5.19999999999999983e71Initial program 93.4%
distribute-rgt-out--93.9%
Simplified93.9%
times-frac92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 93.9%
associate-*r/93.9%
*-commutative93.9%
associate-*r/93.5%
associate-/r*94.2%
Simplified94.2%
if 5.19999999999999983e71 < z Initial program 75.1%
distribute-rgt-out--85.4%
Simplified85.4%
Taylor expanded in x around 0 85.4%
associate-/r*92.7%
Simplified92.7%
Final simplification94.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 3.1e+71) (* -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 <= 3.1e+71) {
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 <= 3.1d+71) 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 <= 3.1e+71) {
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 <= 3.1e+71: 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 <= 3.1e+71) 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 <= 3.1e+71) 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, 3.1e+71], 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 3.1 \cdot 10^{+71}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\
\end{array}
\end{array}
if z < 3.10000000000000018e71Initial program 93.4%
distribute-rgt-out--93.9%
Simplified93.9%
Taylor expanded in y around 0 55.3%
if 3.10000000000000018e71 < z Initial program 75.1%
distribute-rgt-out--85.4%
Simplified85.4%
Taylor expanded in y around 0 48.4%
associate-/l/51.0%
Simplified51.0%
Final simplification54.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 (* 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 90.6%
distribute-rgt-out--92.6%
Simplified92.6%
Taylor expanded in x around 0 92.6%
associate-/r*92.7%
Simplified92.7%
Final simplification92.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 (* 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 90.6%
distribute-rgt-out--92.6%
Simplified92.6%
Taylor expanded in y around 0 54.2%
Final simplification54.2%
(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 2024067
(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))))