
(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 12 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 3.6e+35)
(/ (* 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 <= 3.6e+35) {
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 <= 3.6d+35) 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 <= 3.6e+35) {
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 <= 3.6e+35: 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 <= 3.6e+35) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(x / Float64(z_m / 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 <= 3.6e+35) 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, 3.6e+35], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z$95$m / 2.0), $MachinePrecision]), $MachinePrecision] / N[(y - 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.6 \cdot 10^{+35}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z\_m}{2}}}{y - t}\\
\end{array}
\end{array}
if z < 3.6e35Initial program 92.7%
distribute-rgt-out--96.0%
Simplified96.0%
if 3.6e35 < z Initial program 79.0%
distribute-rgt-out--83.2%
*-commutative83.2%
times-frac96.8%
associate-*l/96.9%
associate-*r/96.8%
Simplified96.8%
associate-/l/83.1%
distribute-rgt-out--78.9%
associate-*r/79.0%
*-commutative79.0%
distribute-rgt-out--83.2%
associate-/r*98.7%
associate-/l*98.7%
Applied egg-rr98.7%
Final simplification96.7%
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 (<= t -5.7e-12) (not (<= t 480000.0)))
(* (/ x t) (/ -2.0 z_m))
(* 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 <= -5.7e-12) || !(t <= 480000.0)) {
tmp = (x / t) * (-2.0 / z_m);
} 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 <= (-5.7d-12)) .or. (.not. (t <= 480000.0d0))) then
tmp = (x / t) * ((-2.0d0) / z_m)
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 <= -5.7e-12) || !(t <= 480000.0)) {
tmp = (x / t) * (-2.0 / z_m);
} 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 <= -5.7e-12) or not (t <= 480000.0): tmp = (x / t) * (-2.0 / z_m) 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 <= -5.7e-12) || !(t <= 480000.0)) tmp = Float64(Float64(x / t) * Float64(-2.0 / z_m)); 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 <= -5.7e-12) || ~((t <= 480000.0))) tmp = (x / t) * (-2.0 / z_m); 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, -5.7e-12], N[Not[LessEqual[t, 480000.0]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z$95$m), $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 -5.7 \cdot 10^{-12} \lor \neg \left(t \leq 480000\right):\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\end{array}
\end{array}
if t < -5.7000000000000003e-12 or 4.8e5 < t Initial program 86.6%
distribute-rgt-out--91.0%
*-commutative91.0%
times-frac93.6%
associate-*l/93.7%
associate-*r/93.7%
Simplified93.7%
Taylor expanded in y around 0 77.3%
associate-*r/77.3%
*-commutative77.3%
times-frac81.3%
Simplified81.3%
if -5.7000000000000003e-12 < t < 4.8e5Initial program 92.4%
distribute-rgt-out--94.9%
*-commutative94.9%
times-frac92.1%
associate-*l/92.1%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in x around 0 94.9%
associate-*r/94.9%
*-commutative94.9%
*-commutative94.9%
associate-*r/94.9%
associate-/r*94.8%
*-lft-identity94.8%
associate-*l/94.8%
associate-*r/94.8%
associate-*l/94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in y around inf 79.8%
*-commutative79.8%
Simplified79.8%
Final simplification80.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 (<= t -5.4e-12)
(* (/ x t) (/ -2.0 z_m))
(if (<= t 3600000.0) (* x (/ 2.0 (* z_m y))) (* (/ x z_m) (/ -2.0 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 (t <= -5.4e-12) {
tmp = (x / t) * (-2.0 / z_m);
} else if (t <= 3600000.0) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = (x / z_m) * (-2.0 / 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 (t <= (-5.4d-12)) then
tmp = (x / t) * ((-2.0d0) / z_m)
else if (t <= 3600000.0d0) then
tmp = x * (2.0d0 / (z_m * y))
else
tmp = (x / z_m) * ((-2.0d0) / 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 (t <= -5.4e-12) {
tmp = (x / t) * (-2.0 / z_m);
} else if (t <= 3600000.0) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = (x / z_m) * (-2.0 / 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 t <= -5.4e-12: tmp = (x / t) * (-2.0 / z_m) elif t <= 3600000.0: tmp = x * (2.0 / (z_m * y)) else: tmp = (x / z_m) * (-2.0 / 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 (t <= -5.4e-12) tmp = Float64(Float64(x / t) * Float64(-2.0 / z_m)); elseif (t <= 3600000.0) tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); else tmp = Float64(Float64(x / z_m) * Float64(-2.0 / 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 (t <= -5.4e-12) tmp = (x / t) * (-2.0 / z_m); elseif (t <= 3600000.0) tmp = x * (2.0 / (z_m * y)); else tmp = (x / z_m) * (-2.0 / 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[t, -5.4e-12], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3600000.0], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / 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}\;t \leq -5.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{elif}\;t \leq 3600000:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -5.39999999999999961e-12Initial program 91.8%
distribute-rgt-out--91.9%
*-commutative91.9%
times-frac95.8%
associate-*l/95.9%
associate-*r/95.9%
Simplified95.9%
Taylor expanded in y around 0 77.3%
associate-*r/77.4%
*-commutative77.4%
times-frac83.7%
Simplified83.7%
if -5.39999999999999961e-12 < t < 3.6e6Initial program 92.4%
distribute-rgt-out--94.9%
*-commutative94.9%
times-frac92.1%
associate-*l/92.1%
associate-*r/92.1%
Simplified92.1%
Taylor expanded in x around 0 94.9%
associate-*r/94.9%
*-commutative94.9%
*-commutative94.9%
associate-*r/94.9%
associate-/r*94.8%
*-lft-identity94.8%
associate-*l/94.8%
associate-*r/94.8%
associate-*l/94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in y around inf 79.8%
*-commutative79.8%
Simplified79.8%
if 3.6e6 < t Initial program 80.9%
distribute-rgt-out--89.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in y around 0 84.9%
Final simplification82.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 (<= t -1.6e-18)
(* (/ x t) (/ -2.0 z_m))
(if (<= t 2400000.0) (* (/ x z_m) (/ 2.0 y)) (* (/ x z_m) (/ -2.0 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 (t <= -1.6e-18) {
tmp = (x / t) * (-2.0 / z_m);
} else if (t <= 2400000.0) {
tmp = (x / z_m) * (2.0 / y);
} else {
tmp = (x / z_m) * (-2.0 / 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 (t <= (-1.6d-18)) then
tmp = (x / t) * ((-2.0d0) / z_m)
else if (t <= 2400000.0d0) then
tmp = (x / z_m) * (2.0d0 / y)
else
tmp = (x / z_m) * ((-2.0d0) / 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 (t <= -1.6e-18) {
tmp = (x / t) * (-2.0 / z_m);
} else if (t <= 2400000.0) {
tmp = (x / z_m) * (2.0 / y);
} else {
tmp = (x / z_m) * (-2.0 / 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 t <= -1.6e-18: tmp = (x / t) * (-2.0 / z_m) elif t <= 2400000.0: tmp = (x / z_m) * (2.0 / y) else: tmp = (x / z_m) * (-2.0 / 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 (t <= -1.6e-18) tmp = Float64(Float64(x / t) * Float64(-2.0 / z_m)); elseif (t <= 2400000.0) tmp = Float64(Float64(x / z_m) * Float64(2.0 / y)); else tmp = Float64(Float64(x / z_m) * Float64(-2.0 / 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 (t <= -1.6e-18) tmp = (x / t) * (-2.0 / z_m); elseif (t <= 2400000.0) tmp = (x / z_m) * (2.0 / y); else tmp = (x / z_m) * (-2.0 / 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[t, -1.6e-18], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2400000.0], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / 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}\;t \leq -1.6 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{elif}\;t \leq 2400000:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -1.6e-18Initial program 91.8%
distribute-rgt-out--91.9%
*-commutative91.9%
times-frac95.8%
associate-*l/95.9%
associate-*r/95.9%
Simplified95.9%
Taylor expanded in y around 0 77.3%
associate-*r/77.4%
*-commutative77.4%
times-frac83.7%
Simplified83.7%
if -1.6e-18 < t < 2.4e6Initial program 92.4%
distribute-rgt-out--94.9%
times-frac96.4%
Simplified96.4%
Taylor expanded in y around inf 83.2%
if 2.4e6 < t Initial program 80.9%
distribute-rgt-out--89.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in y around 0 84.9%
Final simplification83.8%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -5.5e-30)
(* (/ x t) (/ -2.0 z_m))
(if (<= t 550000.0) (/ 2.0 (/ y (/ x z_m))) (* (/ x z_m) (/ -2.0 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 (t <= -5.5e-30) {
tmp = (x / t) * (-2.0 / z_m);
} else if (t <= 550000.0) {
tmp = 2.0 / (y / (x / z_m));
} else {
tmp = (x / z_m) * (-2.0 / 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 (t <= (-5.5d-30)) then
tmp = (x / t) * ((-2.0d0) / z_m)
else if (t <= 550000.0d0) then
tmp = 2.0d0 / (y / (x / z_m))
else
tmp = (x / z_m) * ((-2.0d0) / 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 (t <= -5.5e-30) {
tmp = (x / t) * (-2.0 / z_m);
} else if (t <= 550000.0) {
tmp = 2.0 / (y / (x / z_m));
} else {
tmp = (x / z_m) * (-2.0 / 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 t <= -5.5e-30: tmp = (x / t) * (-2.0 / z_m) elif t <= 550000.0: tmp = 2.0 / (y / (x / z_m)) else: tmp = (x / z_m) * (-2.0 / 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 (t <= -5.5e-30) tmp = Float64(Float64(x / t) * Float64(-2.0 / z_m)); elseif (t <= 550000.0) tmp = Float64(2.0 / Float64(y / Float64(x / z_m))); else tmp = Float64(Float64(x / z_m) * Float64(-2.0 / 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 (t <= -5.5e-30) tmp = (x / t) * (-2.0 / z_m); elseif (t <= 550000.0) tmp = 2.0 / (y / (x / z_m)); else tmp = (x / z_m) * (-2.0 / 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[t, -5.5e-30], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 550000.0], N[(2.0 / N[(y / N[(x / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / 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}\;t \leq -5.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z\_m}\\
\mathbf{elif}\;t \leq 550000:\\
\;\;\;\;\frac{2}{\frac{y}{\frac{x}{z\_m}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -5.49999999999999976e-30Initial program 92.1%
distribute-rgt-out--92.2%
*-commutative92.2%
times-frac95.4%
associate-*l/95.5%
associate-*r/95.5%
Simplified95.5%
Taylor expanded in y around 0 76.7%
associate-*r/76.7%
*-commutative76.7%
times-frac82.9%
Simplified82.9%
if -5.49999999999999976e-30 < t < 5.5e5Initial program 92.2%
distribute-rgt-out--94.8%
*-commutative94.8%
times-frac92.3%
associate-*l/92.3%
associate-*r/92.3%
Simplified92.3%
Taylor expanded in y around inf 78.7%
clear-num78.7%
un-div-inv78.7%
div-inv78.6%
clear-num78.7%
Applied egg-rr78.7%
associate-*r/80.3%
*-commutative80.3%
associate-/l*83.7%
Applied egg-rr83.7%
if 5.5e5 < t Initial program 80.9%
distribute-rgt-out--89.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in y around 0 84.9%
Final simplification83.8%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -4.5e-30)
(/ (/ (* x -2.0) t) z_m)
(if (<= t 600000.0) (/ 2.0 (/ y (/ x z_m))) (* (/ x z_m) (/ -2.0 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 (t <= -4.5e-30) {
tmp = ((x * -2.0) / t) / z_m;
} else if (t <= 600000.0) {
tmp = 2.0 / (y / (x / z_m));
} else {
tmp = (x / z_m) * (-2.0 / 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 (t <= (-4.5d-30)) then
tmp = ((x * (-2.0d0)) / t) / z_m
else if (t <= 600000.0d0) then
tmp = 2.0d0 / (y / (x / z_m))
else
tmp = (x / z_m) * ((-2.0d0) / 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 (t <= -4.5e-30) {
tmp = ((x * -2.0) / t) / z_m;
} else if (t <= 600000.0) {
tmp = 2.0 / (y / (x / z_m));
} else {
tmp = (x / z_m) * (-2.0 / 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 t <= -4.5e-30: tmp = ((x * -2.0) / t) / z_m elif t <= 600000.0: tmp = 2.0 / (y / (x / z_m)) else: tmp = (x / z_m) * (-2.0 / 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 (t <= -4.5e-30) tmp = Float64(Float64(Float64(x * -2.0) / t) / z_m); elseif (t <= 600000.0) tmp = Float64(2.0 / Float64(y / Float64(x / z_m))); else tmp = Float64(Float64(x / z_m) * Float64(-2.0 / 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 (t <= -4.5e-30) tmp = ((x * -2.0) / t) / z_m; elseif (t <= 600000.0) tmp = 2.0 / (y / (x / z_m)); else tmp = (x / z_m) * (-2.0 / 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[t, -4.5e-30], N[(N[(N[(x * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], If[LessEqual[t, 600000.0], N[(2.0 / N[(y / N[(x / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(-2.0 / 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}\;t \leq -4.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z\_m}\\
\mathbf{elif}\;t \leq 600000:\\
\;\;\;\;\frac{2}{\frac{y}{\frac{x}{z\_m}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if t < -4.49999999999999967e-30Initial program 92.1%
distribute-rgt-out--92.2%
times-frac92.0%
Simplified92.0%
Taylor expanded in y around 0 76.6%
associate-*l/83.0%
associate-*r/83.0%
Applied egg-rr83.0%
if -4.49999999999999967e-30 < t < 6e5Initial program 92.2%
distribute-rgt-out--94.8%
*-commutative94.8%
times-frac92.3%
associate-*l/92.3%
associate-*r/92.3%
Simplified92.3%
Taylor expanded in y around inf 78.7%
clear-num78.7%
un-div-inv78.7%
div-inv78.6%
clear-num78.7%
Applied egg-rr78.7%
associate-*r/80.3%
*-commutative80.3%
associate-/l*83.7%
Applied egg-rr83.7%
if 6e5 < t Initial program 80.9%
distribute-rgt-out--89.9%
times-frac98.3%
Simplified98.3%
Taylor expanded in y around 0 84.9%
Final simplification83.8%
z_m = (fabs.f64 z)
z_s = (copysign.f64 1 z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= (* x 2.0) 1000000.0)
(* x (/ (/ 2.0 z_m) (- y t)))
(* 2.0 (/ (/ x (- 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 ((x * 2.0) <= 1000000.0) {
tmp = x * ((2.0 / z_m) / (y - t));
} else {
tmp = 2.0 * ((x / (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 ((x * 2.0d0) <= 1000000.0d0) then
tmp = x * ((2.0d0 / z_m) / (y - t))
else
tmp = 2.0d0 * ((x / (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 ((x * 2.0) <= 1000000.0) {
tmp = x * ((2.0 / z_m) / (y - t));
} else {
tmp = 2.0 * ((x / (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 (x * 2.0) <= 1000000.0: tmp = x * ((2.0 / z_m) / (y - t)) else: tmp = 2.0 * ((x / (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 (Float64(x * 2.0) <= 1000000.0) tmp = Float64(x * Float64(Float64(2.0 / z_m) / Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / 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 ((x * 2.0) <= 1000000.0) tmp = x * ((2.0 / z_m) / (y - t)); else tmp = 2.0 * ((x / (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[N[(x * 2.0), $MachinePrecision], 1000000.0], N[(x * N[(N[(2.0 / z$95$m), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 1000000:\\
\;\;\;\;x \cdot \frac{\frac{2}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y - t}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 x 2) < 1e6Initial program 94.0%
distribute-rgt-out--98.3%
*-commutative98.3%
times-frac91.5%
associate-*l/91.6%
associate-*r/91.6%
Simplified91.6%
Taylor expanded in x around 0 98.3%
associate-*r/98.3%
*-commutative98.3%
*-commutative98.3%
associate-*r/98.2%
associate-/r*98.2%
*-lft-identity98.2%
associate-*l/98.2%
associate-*r/98.2%
associate-*l/98.2%
metadata-eval98.2%
Simplified98.2%
if 1e6 < (*.f64 x 2) Initial program 76.0%
distribute-rgt-out--77.5%
*-commutative77.5%
times-frac96.8%
associate-*l/96.9%
associate-*r/96.9%
Simplified96.9%
Final simplification97.8%
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.1e+35)
(* 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 <= 2.1e+35) {
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 <= 2.1d+35) 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 <= 2.1e+35) {
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 <= 2.1e+35: 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 <= 2.1e+35) tmp = Float64(x * Float64(Float64(2.0 / 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 <= 2.1e+35) 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, 2.1e+35], N[(x * N[(N[(2.0 / z$95$m), $MachinePrecision] / N[(y - t), $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.1 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \frac{\frac{2}{z\_m}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y - t}\\
\end{array}
\end{array}
if z < 2.0999999999999999e35Initial program 92.7%
distribute-rgt-out--96.0%
*-commutative96.0%
times-frac91.6%
associate-*l/91.6%
associate-*r/91.6%
Simplified91.6%
Taylor expanded in x around 0 96.0%
associate-*r/96.0%
*-commutative96.0%
*-commutative96.0%
associate-*r/95.9%
associate-/r*95.9%
*-lft-identity95.9%
associate-*l/95.9%
associate-*r/95.9%
associate-*l/95.9%
metadata-eval95.9%
Simplified95.9%
if 2.0999999999999999e35 < z Initial program 79.0%
distribute-rgt-out--83.2%
times-frac98.7%
Simplified98.7%
Final simplification96.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 2e+35)
(/ (* 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+35) {
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+35) 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+35) {
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+35: 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+35) tmp = Float64(Float64(x * 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+35) 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+35], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $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^{+35}:\\
\;\;\;\;\frac{x \cdot 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 < 1.9999999999999999e35Initial program 92.7%
distribute-rgt-out--96.0%
Simplified96.0%
if 1.9999999999999999e35 < z Initial program 79.0%
distribute-rgt-out--83.2%
times-frac98.7%
Simplified98.7%
Final simplification96.7%
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 8e-84) (* x (/ 2.0 (* z_m y))) (* 2.0 (/ (/ x y) 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 <= 8e-84) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = 2.0 * ((x / y) / 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 <= 8d-84) then
tmp = x * (2.0d0 / (z_m * y))
else
tmp = 2.0d0 * ((x / y) / 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 <= 8e-84) {
tmp = x * (2.0 / (z_m * y));
} else {
tmp = 2.0 * ((x / y) / 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 <= 8e-84: tmp = x * (2.0 / (z_m * y)) else: tmp = 2.0 * ((x / y) / 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 <= 8e-84) tmp = Float64(x * Float64(2.0 / Float64(z_m * y))); else tmp = Float64(2.0 * Float64(Float64(x / y) / 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 <= 8e-84) tmp = x * (2.0 / (z_m * y)); else tmp = 2.0 * ((x / y) / 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, 8e-84], N[(x * N[(2.0 / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 8 \cdot 10^{-84}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot y}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y}}{z\_m}\\
\end{array}
\end{array}
if z < 8.0000000000000003e-84Initial program 91.6%
distribute-rgt-out--95.4%
*-commutative95.4%
times-frac90.3%
associate-*l/90.4%
associate-*r/90.4%
Simplified90.4%
Taylor expanded in x around 0 95.4%
associate-*r/95.4%
*-commutative95.4%
*-commutative95.4%
associate-*r/95.3%
associate-/r*95.3%
*-lft-identity95.3%
associate-*l/95.3%
associate-*r/95.3%
associate-*l/95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
Simplified55.9%
if 8.0000000000000003e-84 < z Initial program 85.0%
distribute-rgt-out--88.0%
*-commutative88.0%
times-frac97.6%
associate-*l/97.7%
associate-*r/97.7%
Simplified97.7%
Taylor expanded in y around inf 51.9%
Final simplification54.5%
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 (- 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) {
return z_s * (2.0 * ((x / (y - t)) / z_m));
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * (2.0d0 * ((x / (y - t)) / z_m))
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (2.0 * ((x / (y - t)) / z_m));
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (2.0 * ((x / (y - t)) / z_m))
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(2.0 * Float64(Float64(x / Float64(y - t)) / z_m))) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (2.0 * ((x / (y - t)) / z_m)); end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * N[(2.0 * N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(2 \cdot \frac{\frac{x}{y - t}}{z\_m}\right)
\end{array}
Initial program 89.2%
distribute-rgt-out--92.8%
*-commutative92.8%
times-frac92.9%
associate-*l/93.0%
associate-*r/93.0%
Simplified93.0%
Final simplification93.0%
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 y) z_m))))
z_m = fabs(z);
z_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (2.0 * ((x / y) / z_m));
}
z_m = abs(z)
z_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
code = z_s * (2.0d0 * ((x / y) / z_m))
end function
z_m = Math.abs(z);
z_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
return z_s * (2.0 * ((x / y) / z_m));
}
z_m = math.fabs(z) z_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): return z_s * (2.0 * ((x / y) / z_m))
z_m = abs(z) z_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) return Float64(z_s * Float64(2.0 * Float64(Float64(x / y) / z_m))) end
z_m = abs(z); z_s = sign(z) * abs(1.0); function tmp = code(z_s, x, y, z_m, t) tmp = z_s * (2.0 * ((x / y) / z_m)); end
z_m = N[Abs[z], $MachinePrecision]
z_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * N[(2.0 * N[(N[(x / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
z_m = \left|z\right|
\\
z_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \left(2 \cdot \frac{\frac{x}{y}}{z\_m}\right)
\end{array}
Initial program 89.2%
distribute-rgt-out--92.8%
*-commutative92.8%
times-frac92.9%
associate-*l/93.0%
associate-*r/93.0%
Simplified93.0%
Taylor expanded in y around inf 52.8%
Final simplification52.8%
(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 2024034
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(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))))