
(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 14 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 (<= (- (* y z_m) (* z_m t)) 1e+179)
(/ (* x 2.0) (* z_m (- y t)))
(* (/ 1.0 (- y t)) (* x (/ 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 (((y * z_m) - (z_m * t)) <= 1e+179) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (1.0 / (y - t)) * (x * (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 (((y * z_m) - (z_m * t)) <= 1d+179) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = (1.0d0 / (y - t)) * (x * (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 (((y * z_m) - (z_m * t)) <= 1e+179) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (1.0 / (y - t)) * (x * (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 ((y * z_m) - (z_m * t)) <= 1e+179: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = (1.0 / (y - t)) * (x * (2.0 / z_m)) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (Float64(Float64(y * z_m) - Float64(z_m * t)) <= 1e+179) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(1.0 / Float64(y - t)) * Float64(x * 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 (((y * z_m) - (z_m * t)) <= 1e+179) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = (1.0 / (y - t)) * (x * (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[N[(N[(y * z$95$m), $MachinePrecision] - N[(z$95$m * t), $MachinePrecision]), $MachinePrecision], 1e+179], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(x * N[(2.0 / z$95$m), $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 \cdot z\_m - z\_m \cdot t \leq 10^{+179}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y - t} \cdot \left(x \cdot \frac{2}{z\_m}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < 9.9999999999999998e178Initial program 94.5%
distribute-rgt-out--95.5%
Simplified95.5%
if 9.9999999999999998e178 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 74.3%
distribute-rgt-out--83.0%
Simplified83.0%
*-un-lft-identity83.0%
*-commutative83.0%
times-frac99.7%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification96.3%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -5e-22)
(/ (/ (* x -2.0) t) z_m)
(if (<= t 1.45e-62) (/ (* 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 (t <= -5e-22) {
tmp = ((x * -2.0) / t) / z_m;
} else if (t <= 1.45e-62) {
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 (t <= (-5d-22)) then
tmp = ((x * (-2.0d0)) / t) / z_m
else if (t <= 1.45d-62) 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 (t <= -5e-22) {
tmp = ((x * -2.0) / t) / z_m;
} else if (t <= 1.45e-62) {
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 t <= -5e-22: tmp = ((x * -2.0) / t) / z_m elif t <= 1.45e-62: 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 (t <= -5e-22) tmp = Float64(Float64(Float64(x * -2.0) / t) / z_m); elseif (t <= 1.45e-62) tmp = Float64(Float64(x * 2.0) / Float64(y * z_m)); else tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -5e-22) tmp = ((x * -2.0) / t) / z_m; elseif (t <= 1.45e-62) 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[LessEqual[t, -5e-22], N[(N[(N[(x * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], If[LessEqual[t, 1.45e-62], N[(N[(x * 2.0), $MachinePrecision] / N[(y * 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}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z\_m}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-62}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22Initial program 88.2%
distribute-rgt-out--89.6%
Simplified89.6%
Taylor expanded in y around 0 76.2%
*-commutative76.2%
Simplified76.2%
associate-*r/76.2%
*-commutative76.2%
associate-/r*82.3%
*-commutative82.3%
Applied egg-rr82.3%
if -4.99999999999999954e-22 < t < 1.44999999999999993e-62Initial program 91.7%
distribute-rgt-out--93.6%
Simplified93.6%
Taylor expanded in y around inf 85.0%
*-commutative85.0%
Simplified85.0%
if 1.44999999999999993e-62 < t Initial program 91.7%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.7%
Final simplification81.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 (<= t -5e-22)
(/ -2.0 (* t (/ z_m x)))
(if (<= t 5e-69) (/ (* 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 (t <= -5e-22) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= 5e-69) {
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 (t <= (-5d-22)) then
tmp = (-2.0d0) / (t * (z_m / x))
else if (t <= 5d-69) 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 (t <= -5e-22) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= 5e-69) {
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 t <= -5e-22: tmp = -2.0 / (t * (z_m / x)) elif t <= 5e-69: 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 (t <= -5e-22) tmp = Float64(-2.0 / Float64(t * Float64(z_m / x))); elseif (t <= 5e-69) tmp = Float64(Float64(x * 2.0) / Float64(y * z_m)); else tmp = Float64(-2.0 * Float64(x / Float64(z_m * t))); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (t <= -5e-22) tmp = -2.0 / (t * (z_m / x)); elseif (t <= 5e-69) 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[LessEqual[t, -5e-22], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-69], N[(N[(x * 2.0), $MachinePrecision] / N[(y * 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}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z\_m}{x}}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22Initial program 88.2%
distribute-rgt-out--89.6%
Simplified89.6%
Taylor expanded in y around 0 76.2%
*-commutative76.2%
Simplified76.2%
clear-num76.1%
un-div-inv76.1%
*-commutative76.1%
associate-/l*78.2%
Applied egg-rr78.2%
if -4.99999999999999954e-22 < t < 5.00000000000000033e-69Initial program 91.7%
distribute-rgt-out--93.6%
Simplified93.6%
Taylor expanded in y around inf 85.0%
*-commutative85.0%
Simplified85.0%
if 5.00000000000000033e-69 < t Initial program 91.7%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.7%
Final simplification80.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 (<= t -5e-22)
(/ -2.0 (* t (/ z_m x)))
(if (<= t 4.6e-64) (* 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 (t <= -5e-22) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= 4.6e-64) {
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 (t <= (-5d-22)) then
tmp = (-2.0d0) / (t * (z_m / x))
else if (t <= 4.6d-64) 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 (t <= -5e-22) {
tmp = -2.0 / (t * (z_m / x));
} else if (t <= 4.6e-64) {
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 t <= -5e-22: tmp = -2.0 / (t * (z_m / x)) elif t <= 4.6e-64: 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 (t <= -5e-22) tmp = Float64(-2.0 / Float64(t * Float64(z_m / x))); elseif (t <= 4.6e-64) 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 (t <= -5e-22) tmp = -2.0 / (t * (z_m / x)); elseif (t <= 4.6e-64) 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[LessEqual[t, -5e-22], N[(-2.0 / N[(t * N[(z$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-64], 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}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z\_m}{x}}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-64}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22Initial program 88.2%
distribute-rgt-out--89.6%
Simplified89.6%
Taylor expanded in y around 0 76.2%
*-commutative76.2%
Simplified76.2%
clear-num76.1%
un-div-inv76.1%
*-commutative76.1%
associate-/l*78.2%
Applied egg-rr78.2%
if -4.99999999999999954e-22 < t < 4.6000000000000003e-64Initial program 91.7%
distribute-rgt-out--93.6%
Simplified93.6%
*-commutative93.6%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 85.0%
*-commutative85.0%
associate-/r*78.9%
Simplified78.9%
clear-num78.0%
un-div-inv78.0%
div-inv77.9%
clear-num78.0%
Applied egg-rr78.0%
associate-/r*78.8%
associate-/r/84.9%
Applied egg-rr84.9%
if 4.6000000000000003e-64 < t Initial program 91.7%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.7%
Final simplification80.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 (<= t -5e-22)
(* -2.0 (/ (/ x z_m) t))
(if (<= t 1.5e-62) (* 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 (t <= -5e-22) {
tmp = -2.0 * ((x / z_m) / t);
} else if (t <= 1.5e-62) {
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 (t <= (-5d-22)) then
tmp = (-2.0d0) * ((x / z_m) / t)
else if (t <= 1.5d-62) 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 (t <= -5e-22) {
tmp = -2.0 * ((x / z_m) / t);
} else if (t <= 1.5e-62) {
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 t <= -5e-22: tmp = -2.0 * ((x / z_m) / t) elif t <= 1.5e-62: 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 (t <= -5e-22) tmp = Float64(-2.0 * Float64(Float64(x / z_m) / t)); elseif (t <= 1.5e-62) 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 (t <= -5e-22) tmp = -2.0 * ((x / z_m) / t); elseif (t <= 1.5e-62) 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[LessEqual[t, -5e-22], N[(-2.0 * N[(N[(x / z$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-62], 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}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22Initial program 88.2%
distribute-rgt-out--89.6%
Simplified89.6%
Taylor expanded in y around 0 76.2%
*-commutative76.2%
associate-/r*77.0%
Simplified77.0%
if -4.99999999999999954e-22 < t < 1.5000000000000001e-62Initial program 91.7%
distribute-rgt-out--93.6%
Simplified93.6%
*-commutative93.6%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 85.0%
*-commutative85.0%
associate-/r*78.9%
Simplified78.9%
clear-num78.0%
un-div-inv78.0%
div-inv77.9%
clear-num78.0%
Applied egg-rr78.0%
associate-/r*78.8%
associate-/r/84.9%
Applied egg-rr84.9%
if 1.5000000000000001e-62 < t Initial program 91.7%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.7%
Final simplification80.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 (<= t -5e-22)
(* -2.0 (/ (/ x z_m) t))
(if (<= t 2.9e-64) (* (/ 2.0 z_m) (/ x 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 (t <= -5e-22) {
tmp = -2.0 * ((x / z_m) / t);
} else if (t <= 2.9e-64) {
tmp = (2.0 / z_m) * (x / 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 (t <= (-5d-22)) then
tmp = (-2.0d0) * ((x / z_m) / t)
else if (t <= 2.9d-64) then
tmp = (2.0d0 / z_m) * (x / 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 (t <= -5e-22) {
tmp = -2.0 * ((x / z_m) / t);
} else if (t <= 2.9e-64) {
tmp = (2.0 / z_m) * (x / 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 t <= -5e-22: tmp = -2.0 * ((x / z_m) / t) elif t <= 2.9e-64: tmp = (2.0 / z_m) * (x / 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 (t <= -5e-22) tmp = Float64(-2.0 * Float64(Float64(x / z_m) / t)); elseif (t <= 2.9e-64) tmp = Float64(Float64(2.0 / z_m) * Float64(x / 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 (t <= -5e-22) tmp = -2.0 * ((x / z_m) / t); elseif (t <= 2.9e-64) tmp = (2.0 / z_m) * (x / 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[LessEqual[t, -5e-22], N[(-2.0 * N[(N[(x / z$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-64], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / 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}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-64}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22Initial program 88.2%
distribute-rgt-out--89.6%
Simplified89.6%
Taylor expanded in y around 0 76.2%
*-commutative76.2%
associate-/r*77.0%
Simplified77.0%
if -4.99999999999999954e-22 < t < 2.8999999999999999e-64Initial program 91.7%
distribute-rgt-out--93.6%
Simplified93.6%
*-commutative93.6%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 82.7%
if 2.8999999999999999e-64 < t Initial program 91.7%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.7%
Final simplification79.5%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -5e-22)
(* -2.0 (/ (/ x z_m) t))
(if (<= t 1.35e-68) (* 2.0 (/ (/ x 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 (t <= -5e-22) {
tmp = -2.0 * ((x / z_m) / t);
} else if (t <= 1.35e-68) {
tmp = 2.0 * ((x / 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 (t <= (-5d-22)) then
tmp = (-2.0d0) * ((x / z_m) / t)
else if (t <= 1.35d-68) then
tmp = 2.0d0 * ((x / 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 (t <= -5e-22) {
tmp = -2.0 * ((x / z_m) / t);
} else if (t <= 1.35e-68) {
tmp = 2.0 * ((x / 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 t <= -5e-22: tmp = -2.0 * ((x / z_m) / t) elif t <= 1.35e-68: tmp = 2.0 * ((x / 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 (t <= -5e-22) tmp = Float64(-2.0 * Float64(Float64(x / z_m) / t)); elseif (t <= 1.35e-68) tmp = Float64(2.0 * Float64(Float64(x / 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 (t <= -5e-22) tmp = -2.0 * ((x / z_m) / t); elseif (t <= 1.35e-68) tmp = 2.0 * ((x / 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[LessEqual[t, -5e-22], N[(-2.0 * N[(N[(x / z$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-68], N[(2.0 * N[(N[(x / z$95$m), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(x / N[(z$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-22}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-68}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z\_m}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999954e-22Initial program 88.2%
distribute-rgt-out--89.6%
Simplified89.6%
Taylor expanded in y around 0 76.2%
*-commutative76.2%
associate-/r*77.0%
Simplified77.0%
if -4.99999999999999954e-22 < t < 1.3500000000000001e-68Initial program 91.7%
distribute-rgt-out--93.6%
Simplified93.6%
*-commutative93.6%
times-frac92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 85.0%
*-commutative85.0%
associate-/r*78.9%
Simplified78.9%
if 1.3500000000000001e-68 < t Initial program 91.7%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in y around 0 77.7%
*-commutative77.7%
Simplified77.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 (<= (* x 2.0) 2e-243)
(* 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 ((x * 2.0) <= 2e-243) {
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 ((x * 2.0d0) <= 2d-243) 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 ((x * 2.0) <= 2e-243) {
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 (x * 2.0) <= 2e-243: 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 (Float64(x * 2.0) <= 2e-243) tmp = Float64(x * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(2.0 / Float64(Float64(y - t) / 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 ((x * 2.0) <= 2e-243) 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[N[(x * 2.0), $MachinePrecision], 2e-243], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(y - t), $MachinePrecision] / x), $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}\;x \cdot 2 \leq 2 \cdot 10^{-243}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{y - t}{x}}}{z\_m}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 1.99999999999999999e-243Initial program 90.8%
distribute-rgt-out--93.5%
Simplified93.5%
distribute-rgt-out--90.8%
associate-/l*90.8%
*-commutative90.8%
distribute-rgt-out--93.5%
Applied egg-rr93.5%
if 1.99999999999999999e-243 < (*.f64 x #s(literal 2 binary64)) Initial program 90.5%
distribute-rgt-out--92.6%
Simplified92.6%
*-commutative92.6%
times-frac96.7%
Applied egg-rr96.7%
associate-*r/96.9%
clear-num96.8%
associate-*l/96.8%
metadata-eval96.8%
Applied egg-rr96.8%
Final simplification94.8%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= (* x 2.0) 4e-235)
(/ (* x 2.0) (* z_m (- y t)))
(* (/ 2.0 z_m) (/ x (- y t))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((x * 2.0) <= 4e-235) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (2.0 / z_m) * (x / (y - t));
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if ((x * 2.0d0) <= 4d-235) then
tmp = (x * 2.0d0) / (z_m * (y - t))
else
tmp = (2.0d0 / z_m) * (x / (y - t))
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((x * 2.0) <= 4e-235) {
tmp = (x * 2.0) / (z_m * (y - t));
} else {
tmp = (2.0 / z_m) * (x / (y - t));
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if (x * 2.0) <= 4e-235: tmp = (x * 2.0) / (z_m * (y - t)) else: tmp = (2.0 / z_m) * (x / (y - t)) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (Float64(x * 2.0) <= 4e-235) tmp = Float64(Float64(x * 2.0) / Float64(z_m * Float64(y - t))); else tmp = Float64(Float64(2.0 / z_m) * Float64(x / Float64(y - t))); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if ((x * 2.0) <= 4e-235) tmp = (x * 2.0) / (z_m * (y - t)); else tmp = (2.0 / z_m) * (x / (y - t)); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[N[(x * 2.0), $MachinePrecision], 4e-235], N[(N[(x * 2.0), $MachinePrecision] / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 4 \cdot 10^{-235}:\\
\;\;\;\;\frac{x \cdot 2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 3.9999999999999998e-235Initial program 91.0%
distribute-rgt-out--93.6%
Simplified93.6%
if 3.9999999999999998e-235 < (*.f64 x #s(literal 2 binary64)) Initial program 90.3%
distribute-rgt-out--92.5%
Simplified92.5%
*-commutative92.5%
times-frac96.7%
Applied egg-rr96.7%
Final simplification94.8%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= (* x 2.0) 2e-243)
(* x (/ 2.0 (* z_m (- y t))))
(* (/ 2.0 z_m) (/ x (- y t))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((x * 2.0) <= 2e-243) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (2.0 / z_m) * (x / (y - t));
}
return z_s * tmp;
}
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, x, y, z_m, t)
real(8), intent (in) :: z_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z_m
real(8), intent (in) :: t
real(8) :: tmp
if ((x * 2.0d0) <= 2d-243) then
tmp = x * (2.0d0 / (z_m * (y - t)))
else
tmp = (2.0d0 / z_m) * (x / (y - t))
end if
code = z_s * tmp
end function
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if ((x * 2.0) <= 2e-243) {
tmp = x * (2.0 / (z_m * (y - t)));
} else {
tmp = (2.0 / z_m) * (x / (y - t));
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if (x * 2.0) <= 2e-243: tmp = x * (2.0 / (z_m * (y - t))) else: tmp = (2.0 / z_m) * (x / (y - t)) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (Float64(x * 2.0) <= 2e-243) tmp = Float64(x * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(2.0 / z_m) * Float64(x / Float64(y - t))); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if ((x * 2.0) <= 2e-243) tmp = x * (2.0 / (z_m * (y - t))); else tmp = (2.0 / z_m) * (x / (y - t)); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[N[(x * 2.0), $MachinePrecision], 2e-243], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z$95$m), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 2 \cdot 10^{-243}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z\_m} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 1.99999999999999999e-243Initial program 90.8%
distribute-rgt-out--93.5%
Simplified93.5%
distribute-rgt-out--90.8%
associate-/l*90.8%
*-commutative90.8%
distribute-rgt-out--93.5%
Applied egg-rr93.5%
if 1.99999999999999999e-243 < (*.f64 x #s(literal 2 binary64)) Initial program 90.5%
distribute-rgt-out--92.6%
Simplified92.6%
*-commutative92.6%
times-frac96.7%
Applied egg-rr96.7%
Final simplification94.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 (<= z_m 3.5e+172)
(* 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.5e+172) {
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.5d+172) 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.5e+172) {
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.5e+172: 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.5e+172) tmp = Float64(x * Float64(2.0 / Float64(z_m * Float64(y - t)))); else tmp = Float64(Float64(x / z_m) * Float64(2.0 / Float64(y - t))); end return Float64(z_s * tmp) end
z\_m = abs(z); z\_s = sign(z) * abs(1.0); function tmp_2 = code(z_s, x, y, z_m, t) tmp = 0.0; if (z_m <= 3.5e+172) 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.5e+172], N[(x * N[(2.0 / N[(z$95$m * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z$95$m), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
z\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 3.5 \cdot 10^{+172}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z\_m} \cdot \frac{2}{y - t}\\
\end{array}
\end{array}
if z < 3.49999999999999977e172Initial program 91.5%
distribute-rgt-out--93.7%
Simplified93.7%
distribute-rgt-out--91.5%
associate-/l*91.2%
*-commutative91.2%
distribute-rgt-out--93.4%
Applied egg-rr93.4%
if 3.49999999999999977e172 < z Initial program 82.1%
distribute-rgt-out--86.7%
Simplified86.7%
times-frac95.4%
Applied egg-rr95.4%
Final simplification93.6%
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x y z_m t)
:precision binary64
(*
z_s
(if (<= t -8.4e+155)
(/ (/ (* x -2.0) t) z_m)
(* x (/ 2.0 (* z_m (- y t)))))))z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x, double y, double z_m, double t) {
double tmp;
if (t <= -8.4e+155) {
tmp = ((x * -2.0) / t) / z_m;
} else {
tmp = x * (2.0 / (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 (t <= (-8.4d+155)) then
tmp = ((x * (-2.0d0)) / t) / z_m
else
tmp = x * (2.0d0 / (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 (t <= -8.4e+155) {
tmp = ((x * -2.0) / t) / z_m;
} else {
tmp = x * (2.0 / (z_m * (y - t)));
}
return z_s * tmp;
}
z\_m = math.fabs(z) z\_s = math.copysign(1.0, z) def code(z_s, x, y, z_m, t): tmp = 0 if t <= -8.4e+155: tmp = ((x * -2.0) / t) / z_m else: tmp = x * (2.0 / (z_m * (y - t))) return z_s * tmp
z\_m = abs(z) z\_s = copysign(1.0, z) function code(z_s, x, y, z_m, t) tmp = 0.0 if (t <= -8.4e+155) tmp = Float64(Float64(Float64(x * -2.0) / t) / z_m); else tmp = Float64(x * Float64(2.0 / Float64(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 (t <= -8.4e+155) tmp = ((x * -2.0) / t) / z_m; else tmp = x * (2.0 / (z_m * (y - t))); end tmp_2 = z_s * tmp; end
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x_, y_, z$95$m_, t_] := N[(z$95$s * If[LessEqual[t, -8.4e+155], N[(N[(N[(x * -2.0), $MachinePrecision] / t), $MachinePrecision] / z$95$m), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{+155}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t}}{z\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z\_m \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if t < -8.4e155Initial program 78.1%
distribute-rgt-out--78.1%
Simplified78.1%
Taylor expanded in y around 0 78.2%
*-commutative78.2%
Simplified78.2%
associate-*r/78.2%
*-commutative78.2%
associate-/r*93.2%
*-commutative93.2%
Applied egg-rr93.2%
if -8.4e155 < t Initial program 92.3%
distribute-rgt-out--95.1%
Simplified95.1%
distribute-rgt-out--92.3%
associate-/l*92.0%
*-commutative92.0%
distribute-rgt-out--94.7%
Applied egg-rr94.7%
Final simplification94.6%
z\_m = (fabs.f64 z) z\_s = (copysign.f64 #s(literal 1 binary64) z) (FPCore (z_s x y z_m t) :precision binary64 (* z_s (if (<= y 1.22e-133) (* -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 (y <= 1.22e-133) {
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 (y <= 1.22d-133) 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 (y <= 1.22e-133) {
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 y <= 1.22e-133: 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 (y <= 1.22e-133) 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 (y <= 1.22e-133) 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[y, 1.22e-133], 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}\;y \leq 1.22 \cdot 10^{-133}:\\
\;\;\;\;-2 \cdot \frac{x}{z\_m \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z\_m}}{t}\\
\end{array}
\end{array}
if y < 1.2199999999999999e-133Initial program 94.2%
distribute-rgt-out--96.1%
Simplified96.1%
Taylor expanded in y around 0 64.1%
*-commutative64.1%
Simplified64.1%
if 1.2199999999999999e-133 < y Initial program 85.1%
distribute-rgt-out--88.3%
Simplified88.3%
Taylor expanded in y around 0 38.4%
*-commutative38.4%
associate-/r*46.9%
Simplified46.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 (* -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.7%
distribute-rgt-out--93.1%
Simplified93.1%
Taylor expanded in y around 0 54.3%
*-commutative54.3%
Simplified54.3%
(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 2024170
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (* x 2) (- (* y z) (* t z))) -2559141628295061/10000000000000000000000000000) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 522513913665063/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2))))
(/ (* x 2.0) (- (* y z) (* t z))))