
(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}
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 4e+14)
(/ (/ x_m (* z 0.5)) (- y t))
(/ (/ x_m (- y t)) (* z 0.5)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 4e+14) {
tmp = (x_m / (z * 0.5)) / (y - t);
} else {
tmp = (x_m / (y - t)) / (z * 0.5);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 4d+14) then
tmp = (x_m / (z * 0.5d0)) / (y - t)
else
tmp = (x_m / (y - t)) / (z * 0.5d0)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 4e+14) {
tmp = (x_m / (z * 0.5)) / (y - t);
} else {
tmp = (x_m / (y - t)) / (z * 0.5);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 4e+14: tmp = (x_m / (z * 0.5)) / (y - t) else: tmp = (x_m / (y - t)) / (z * 0.5) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 4e+14) tmp = Float64(Float64(x_m / Float64(z * 0.5)) / Float64(y - t)); else tmp = Float64(Float64(x_m / Float64(y - t)) / Float64(z * 0.5)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 4e+14) tmp = (x_m / (z * 0.5)) / (y - t); else tmp = (x_m / (y - t)) / (z * 0.5); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 4e+14], N[(N[(x$95$m / N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(z * 0.5), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{x\_m}{z \cdot 0.5}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x\_m}{y - t}}{z \cdot 0.5}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 4e14Initial program 91.9%
distribute-rgt-out--94.0%
Simplified94.0%
add-sqr-sqrt34.8%
*-commutative34.8%
times-frac34.3%
Applied egg-rr34.3%
frac-times34.8%
add-sqr-sqrt94.0%
frac-times91.6%
*-commutative91.6%
clear-num91.6%
frac-times94.0%
*-un-lft-identity94.0%
div-inv94.0%
metadata-eval94.0%
Applied egg-rr94.0%
associate-/r*93.3%
Simplified93.3%
if 4e14 < (*.f64 x #s(literal 2 binary64)) Initial program 85.9%
distribute-rgt-out--87.6%
Simplified87.6%
add-sqr-sqrt87.1%
*-commutative87.1%
times-frac93.1%
Applied egg-rr93.1%
frac-times87.1%
add-sqr-sqrt87.6%
frac-times96.6%
clear-num96.6%
un-div-inv96.7%
div-inv96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Final simplification94.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* -2.0 (/ (/ x_m z) t))) (t_2 (* x_m (/ 2.0 (* z y)))))
(*
x_s
(if (<= y -5.2e-51)
t_2
(if (<= y -8.6e-75)
t_1
(if (<= y -1.4e-95)
(* (/ 2.0 z) (/ x_m y))
(if (<= y -1e-223)
(* -2.0 (/ x_m (* z t)))
(if (<= y 1450000000.0) t_1 t_2))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = -2.0 * ((x_m / z) / t);
double t_2 = x_m * (2.0 / (z * y));
double tmp;
if (y <= -5.2e-51) {
tmp = t_2;
} else if (y <= -8.6e-75) {
tmp = t_1;
} else if (y <= -1.4e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= -1e-223) {
tmp = -2.0 * (x_m / (z * t));
} else if (y <= 1450000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
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 = (-2.0d0) * ((x_m / z) / t)
t_2 = x_m * (2.0d0 / (z * y))
if (y <= (-5.2d-51)) then
tmp = t_2
else if (y <= (-8.6d-75)) then
tmp = t_1
else if (y <= (-1.4d-95)) then
tmp = (2.0d0 / z) * (x_m / y)
else if (y <= (-1d-223)) then
tmp = (-2.0d0) * (x_m / (z * t))
else if (y <= 1450000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = -2.0 * ((x_m / z) / t);
double t_2 = x_m * (2.0 / (z * y));
double tmp;
if (y <= -5.2e-51) {
tmp = t_2;
} else if (y <= -8.6e-75) {
tmp = t_1;
} else if (y <= -1.4e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= -1e-223) {
tmp = -2.0 * (x_m / (z * t));
} else if (y <= 1450000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = -2.0 * ((x_m / z) / t) t_2 = x_m * (2.0 / (z * y)) tmp = 0 if y <= -5.2e-51: tmp = t_2 elif y <= -8.6e-75: tmp = t_1 elif y <= -1.4e-95: tmp = (2.0 / z) * (x_m / y) elif y <= -1e-223: tmp = -2.0 * (x_m / (z * t)) elif y <= 1450000000.0: tmp = t_1 else: tmp = t_2 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(-2.0 * Float64(Float64(x_m / z) / t)) t_2 = Float64(x_m * Float64(2.0 / Float64(z * y))) tmp = 0.0 if (y <= -5.2e-51) tmp = t_2; elseif (y <= -8.6e-75) tmp = t_1; elseif (y <= -1.4e-95) tmp = Float64(Float64(2.0 / z) * Float64(x_m / y)); elseif (y <= -1e-223) tmp = Float64(-2.0 * Float64(x_m / Float64(z * t))); elseif (y <= 1450000000.0) tmp = t_1; else tmp = t_2; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = -2.0 * ((x_m / z) / t); t_2 = x_m * (2.0 / (z * y)); tmp = 0.0; if (y <= -5.2e-51) tmp = t_2; elseif (y <= -8.6e-75) tmp = t_1; elseif (y <= -1.4e-95) tmp = (2.0 / z) * (x_m / y); elseif (y <= -1e-223) tmp = -2.0 * (x_m / (z * t)); elseif (y <= 1450000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m * N[(2.0 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -5.2e-51], t$95$2, If[LessEqual[y, -8.6e-75], t$95$1, If[LessEqual[y, -1.4e-95], N[(N[(2.0 / z), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1e-223], N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1450000000.0], t$95$1, t$95$2]]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := -2 \cdot \frac{\frac{x\_m}{z}}{t}\\
t_2 := x\_m \cdot \frac{2}{z \cdot y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -8.6 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-95}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x\_m}{y}\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-223}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\
\mathbf{elif}\;y \leq 1450000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if y < -5.2e-51 or 1.45e9 < y Initial program 92.0%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around inf 84.3%
*-commutative84.3%
Simplified84.3%
associate-/l*84.2%
*-commutative84.2%
Applied egg-rr84.2%
if -5.2e-51 < y < -8.5999999999999998e-75 or -9.9999999999999997e-224 < y < 1.45e9Initial program 89.0%
distribute-rgt-out--90.3%
Simplified90.3%
Taylor expanded in y around 0 81.7%
*-commutative81.7%
Simplified81.7%
associate-/r*85.5%
div-inv85.4%
Applied egg-rr85.4%
associate-*r/85.5%
*-rgt-identity85.5%
Simplified85.5%
if -8.5999999999999998e-75 < y < -1.4e-95Initial program 75.5%
distribute-rgt-out--75.9%
Simplified75.9%
*-commutative75.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 87.4%
if -1.4e-95 < y < -9.9999999999999997e-224Initial program 91.5%
distribute-rgt-out--91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
*-commutative82.7%
Simplified82.7%
Final simplification84.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (* x_m (/ 2.0 (* z y)))))
(*
x_s
(if (<= y -5e-51)
t_1
(if (<= y -5.8e-75)
(/ -2.0 (* t (/ z x_m)))
(if (<= y -1.45e-95)
(* (/ 2.0 z) (/ x_m y))
(if (<= y -1.7e-220)
(* -2.0 (/ x_m (* z t)))
(if (<= y 3700000000.0) (* -2.0 (/ (/ x_m z) t)) t_1))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (2.0 / (z * y));
double tmp;
if (y <= -5e-51) {
tmp = t_1;
} else if (y <= -5.8e-75) {
tmp = -2.0 / (t * (z / x_m));
} else if (y <= -1.45e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= -1.7e-220) {
tmp = -2.0 * (x_m / (z * t));
} else if (y <= 3700000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x_m * (2.0d0 / (z * y))
if (y <= (-5d-51)) then
tmp = t_1
else if (y <= (-5.8d-75)) then
tmp = (-2.0d0) / (t * (z / x_m))
else if (y <= (-1.45d-95)) then
tmp = (2.0d0 / z) * (x_m / y)
else if (y <= (-1.7d-220)) then
tmp = (-2.0d0) * (x_m / (z * t))
else if (y <= 3700000000.0d0) then
tmp = (-2.0d0) * ((x_m / z) / t)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = x_m * (2.0 / (z * y));
double tmp;
if (y <= -5e-51) {
tmp = t_1;
} else if (y <= -5.8e-75) {
tmp = -2.0 / (t * (z / x_m));
} else if (y <= -1.45e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= -1.7e-220) {
tmp = -2.0 * (x_m / (z * t));
} else if (y <= 3700000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = x_m * (2.0 / (z * y)) tmp = 0 if y <= -5e-51: tmp = t_1 elif y <= -5.8e-75: tmp = -2.0 / (t * (z / x_m)) elif y <= -1.45e-95: tmp = (2.0 / z) * (x_m / y) elif y <= -1.7e-220: tmp = -2.0 * (x_m / (z * t)) elif y <= 3700000000.0: tmp = -2.0 * ((x_m / z) / t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(x_m * Float64(2.0 / Float64(z * y))) tmp = 0.0 if (y <= -5e-51) tmp = t_1; elseif (y <= -5.8e-75) tmp = Float64(-2.0 / Float64(t * Float64(z / x_m))); elseif (y <= -1.45e-95) tmp = Float64(Float64(2.0 / z) * Float64(x_m / y)); elseif (y <= -1.7e-220) tmp = Float64(-2.0 * Float64(x_m / Float64(z * t))); elseif (y <= 3700000000.0) tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = x_m * (2.0 / (z * y)); tmp = 0.0; if (y <= -5e-51) tmp = t_1; elseif (y <= -5.8e-75) tmp = -2.0 / (t * (z / x_m)); elseif (y <= -1.45e-95) tmp = (2.0 / z) * (x_m / y); elseif (y <= -1.7e-220) tmp = -2.0 * (x_m / (z * t)); elseif (y <= 3700000000.0) tmp = -2.0 * ((x_m / z) / t); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(2.0 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -5e-51], t$95$1, If[LessEqual[y, -5.8e-75], N[(-2.0 / N[(t * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.45e-95], N[(N[(2.0 / z), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-220], N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3700000000.0], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := x\_m \cdot \frac{2}{z \cdot y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-75}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x\_m}}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-95}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x\_m}{y}\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-220}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\
\mathbf{elif}\;y \leq 3700000000:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -5.00000000000000004e-51 or 3.7e9 < y Initial program 92.0%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around inf 84.3%
*-commutative84.3%
Simplified84.3%
associate-/l*84.2%
*-commutative84.2%
Applied egg-rr84.2%
if -5.00000000000000004e-51 < y < -5.8000000000000003e-75Initial program 78.5%
distribute-rgt-out--78.5%
Simplified78.5%
Taylor expanded in y around 0 67.7%
*-commutative67.7%
Simplified67.7%
clear-num67.8%
un-div-inv67.8%
*-commutative67.8%
Applied egg-rr67.8%
associate-/l*78.3%
Simplified78.3%
if -5.8000000000000003e-75 < y < -1.45000000000000001e-95Initial program 75.5%
distribute-rgt-out--75.9%
Simplified75.9%
*-commutative75.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 87.4%
if -1.45000000000000001e-95 < y < -1.69999999999999997e-220Initial program 91.5%
distribute-rgt-out--91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
*-commutative82.7%
Simplified82.7%
if -1.69999999999999997e-220 < y < 3.7e9Initial program 90.4%
distribute-rgt-out--91.8%
Simplified91.8%
Taylor expanded in y around 0 83.5%
*-commutative83.5%
Simplified83.5%
associate-/r*86.5%
div-inv86.4%
Applied egg-rr86.4%
associate-*r/86.5%
*-rgt-identity86.5%
Simplified86.5%
Final simplification84.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* x_m 2.0) (* z y))))
(*
x_s
(if (<= y -2.4e-52)
t_1
(if (<= y -1.8e-74)
(/ -2.0 (* t (/ z x_m)))
(if (<= y -1.45e-95)
(* (/ 2.0 z) (/ x_m y))
(if (<= y -1.16e-220)
(* -2.0 (/ x_m (* z t)))
(if (<= y 2200000000.0) (* -2.0 (/ (/ x_m z) t)) t_1))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m * 2.0) / (z * y);
double tmp;
if (y <= -2.4e-52) {
tmp = t_1;
} else if (y <= -1.8e-74) {
tmp = -2.0 / (t * (z / x_m));
} else if (y <= -1.45e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= -1.16e-220) {
tmp = -2.0 * (x_m / (z * t));
} else if (y <= 2200000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m * 2.0d0) / (z * y)
if (y <= (-2.4d-52)) then
tmp = t_1
else if (y <= (-1.8d-74)) then
tmp = (-2.0d0) / (t * (z / x_m))
else if (y <= (-1.45d-95)) then
tmp = (2.0d0 / z) * (x_m / y)
else if (y <= (-1.16d-220)) then
tmp = (-2.0d0) * (x_m / (z * t))
else if (y <= 2200000000.0d0) then
tmp = (-2.0d0) * ((x_m / z) / t)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m * 2.0) / (z * y);
double tmp;
if (y <= -2.4e-52) {
tmp = t_1;
} else if (y <= -1.8e-74) {
tmp = -2.0 / (t * (z / x_m));
} else if (y <= -1.45e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= -1.16e-220) {
tmp = -2.0 * (x_m / (z * t));
} else if (y <= 2200000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = (x_m * 2.0) / (z * y) tmp = 0 if y <= -2.4e-52: tmp = t_1 elif y <= -1.8e-74: tmp = -2.0 / (t * (z / x_m)) elif y <= -1.45e-95: tmp = (2.0 / z) * (x_m / y) elif y <= -1.16e-220: tmp = -2.0 * (x_m / (z * t)) elif y <= 2200000000.0: tmp = -2.0 * ((x_m / z) / t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m * 2.0) / Float64(z * y)) tmp = 0.0 if (y <= -2.4e-52) tmp = t_1; elseif (y <= -1.8e-74) tmp = Float64(-2.0 / Float64(t * Float64(z / x_m))); elseif (y <= -1.45e-95) tmp = Float64(Float64(2.0 / z) * Float64(x_m / y)); elseif (y <= -1.16e-220) tmp = Float64(-2.0 * Float64(x_m / Float64(z * t))); elseif (y <= 2200000000.0) tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (x_m * 2.0) / (z * y); tmp = 0.0; if (y <= -2.4e-52) tmp = t_1; elseif (y <= -1.8e-74) tmp = -2.0 / (t * (z / x_m)); elseif (y <= -1.45e-95) tmp = (2.0 / z) * (x_m / y); elseif (y <= -1.16e-220) tmp = -2.0 * (x_m / (z * t)); elseif (y <= 2200000000.0) tmp = -2.0 * ((x_m / z) / t); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.4e-52], t$95$1, If[LessEqual[y, -1.8e-74], N[(-2.0 / N[(t * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.45e-95], N[(N[(2.0 / z), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.16e-220], N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2200000000.0], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m \cdot 2}{z \cdot y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x\_m}}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-95}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x\_m}{y}\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-220}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\
\mathbf{elif}\;y \leq 2200000000:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -2.4000000000000002e-52 or 2.2e9 < y Initial program 92.0%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around inf 84.3%
*-commutative84.3%
Simplified84.3%
if -2.4000000000000002e-52 < y < -1.8000000000000001e-74Initial program 78.5%
distribute-rgt-out--78.5%
Simplified78.5%
Taylor expanded in y around 0 67.7%
*-commutative67.7%
Simplified67.7%
clear-num67.8%
un-div-inv67.8%
*-commutative67.8%
Applied egg-rr67.8%
associate-/l*78.3%
Simplified78.3%
if -1.8000000000000001e-74 < y < -1.45000000000000001e-95Initial program 75.5%
distribute-rgt-out--75.9%
Simplified75.9%
*-commutative75.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 87.4%
if -1.45000000000000001e-95 < y < -1.15999999999999998e-220Initial program 91.5%
distribute-rgt-out--91.5%
Simplified91.5%
Taylor expanded in y around 0 82.7%
*-commutative82.7%
Simplified82.7%
if -1.15999999999999998e-220 < y < 2.2e9Initial program 90.4%
distribute-rgt-out--91.8%
Simplified91.8%
Taylor expanded in y around 0 83.5%
*-commutative83.5%
Simplified83.5%
associate-/r*86.5%
div-inv86.4%
Applied egg-rr86.4%
associate-*r/86.5%
*-rgt-identity86.5%
Simplified86.5%
Final simplification84.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* x_m 2.0) (* z y))))
(*
x_s
(if (<= y -3.15e-52)
t_1
(if (<= y -2.6e-74)
(* (/ x_m t) (/ 2.0 (- z)))
(if (<= y -1.45e-95)
(* (/ 2.0 z) (/ x_m y))
(if (<= y 1450000000.0) (* -2.0 (/ (/ x_m z) t)) t_1)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m * 2.0) / (z * y);
double tmp;
if (y <= -3.15e-52) {
tmp = t_1;
} else if (y <= -2.6e-74) {
tmp = (x_m / t) * (2.0 / -z);
} else if (y <= -1.45e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= 1450000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m * 2.0d0) / (z * y)
if (y <= (-3.15d-52)) then
tmp = t_1
else if (y <= (-2.6d-74)) then
tmp = (x_m / t) * (2.0d0 / -z)
else if (y <= (-1.45d-95)) then
tmp = (2.0d0 / z) * (x_m / y)
else if (y <= 1450000000.0d0) then
tmp = (-2.0d0) * ((x_m / z) / t)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m * 2.0) / (z * y);
double tmp;
if (y <= -3.15e-52) {
tmp = t_1;
} else if (y <= -2.6e-74) {
tmp = (x_m / t) * (2.0 / -z);
} else if (y <= -1.45e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= 1450000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = (x_m * 2.0) / (z * y) tmp = 0 if y <= -3.15e-52: tmp = t_1 elif y <= -2.6e-74: tmp = (x_m / t) * (2.0 / -z) elif y <= -1.45e-95: tmp = (2.0 / z) * (x_m / y) elif y <= 1450000000.0: tmp = -2.0 * ((x_m / z) / t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m * 2.0) / Float64(z * y)) tmp = 0.0 if (y <= -3.15e-52) tmp = t_1; elseif (y <= -2.6e-74) tmp = Float64(Float64(x_m / t) * Float64(2.0 / Float64(-z))); elseif (y <= -1.45e-95) tmp = Float64(Float64(2.0 / z) * Float64(x_m / y)); elseif (y <= 1450000000.0) tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (x_m * 2.0) / (z * y); tmp = 0.0; if (y <= -3.15e-52) tmp = t_1; elseif (y <= -2.6e-74) tmp = (x_m / t) * (2.0 / -z); elseif (y <= -1.45e-95) tmp = (2.0 / z) * (x_m / y); elseif (y <= 1450000000.0) tmp = -2.0 * ((x_m / z) / t); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -3.15e-52], t$95$1, If[LessEqual[y, -2.6e-74], N[(N[(x$95$m / t), $MachinePrecision] * N[(2.0 / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.45e-95], N[(N[(2.0 / z), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1450000000.0], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m \cdot 2}{z \cdot y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-74}:\\
\;\;\;\;\frac{x\_m}{t} \cdot \frac{2}{-z}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-95}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x\_m}{y}\\
\mathbf{elif}\;y \leq 1450000000:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -3.1500000000000002e-52 or 1.45e9 < y Initial program 92.0%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around inf 84.3%
*-commutative84.3%
Simplified84.3%
if -3.1500000000000002e-52 < y < -2.6000000000000001e-74Initial program 78.5%
distribute-rgt-out--78.5%
Simplified78.5%
*-commutative78.5%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 88.8%
associate-*r/88.8%
neg-mul-188.8%
Simplified88.8%
if -2.6000000000000001e-74 < y < -1.45000000000000001e-95Initial program 75.5%
distribute-rgt-out--75.9%
Simplified75.9%
*-commutative75.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 87.4%
if -1.45000000000000001e-95 < y < 1.45e9Initial program 90.6%
distribute-rgt-out--91.7%
Simplified91.7%
Taylor expanded in y around 0 83.3%
*-commutative83.3%
Simplified83.3%
associate-/r*85.0%
div-inv84.8%
Applied egg-rr84.8%
associate-*r/85.0%
*-rgt-identity85.0%
Simplified85.0%
Final simplification84.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(let* ((t_1 (/ (* x_m 2.0) (* z y))))
(*
x_s
(if (<= y -5.1e-51)
t_1
(if (<= y -1.2e-73)
(/ (/ (- x_m) t) (* z 0.5))
(if (<= y -1.35e-95)
(* (/ 2.0 z) (/ x_m y))
(if (<= y 2400000000.0) (* -2.0 (/ (/ x_m z) t)) t_1)))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m * 2.0) / (z * y);
double tmp;
if (y <= -5.1e-51) {
tmp = t_1;
} else if (y <= -1.2e-73) {
tmp = (-x_m / t) / (z * 0.5);
} else if (y <= -1.35e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= 2400000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x_m * 2.0d0) / (z * y)
if (y <= (-5.1d-51)) then
tmp = t_1
else if (y <= (-1.2d-73)) then
tmp = (-x_m / t) / (z * 0.5d0)
else if (y <= (-1.35d-95)) then
tmp = (2.0d0 / z) * (x_m / y)
else if (y <= 2400000000.0d0) then
tmp = (-2.0d0) * ((x_m / z) / t)
else
tmp = t_1
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double t_1 = (x_m * 2.0) / (z * y);
double tmp;
if (y <= -5.1e-51) {
tmp = t_1;
} else if (y <= -1.2e-73) {
tmp = (-x_m / t) / (z * 0.5);
} else if (y <= -1.35e-95) {
tmp = (2.0 / z) * (x_m / y);
} else if (y <= 2400000000.0) {
tmp = -2.0 * ((x_m / z) / t);
} else {
tmp = t_1;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): t_1 = (x_m * 2.0) / (z * y) tmp = 0 if y <= -5.1e-51: tmp = t_1 elif y <= -1.2e-73: tmp = (-x_m / t) / (z * 0.5) elif y <= -1.35e-95: tmp = (2.0 / z) * (x_m / y) elif y <= 2400000000.0: tmp = -2.0 * ((x_m / z) / t) else: tmp = t_1 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) t_1 = Float64(Float64(x_m * 2.0) / Float64(z * y)) tmp = 0.0 if (y <= -5.1e-51) tmp = t_1; elseif (y <= -1.2e-73) tmp = Float64(Float64(Float64(-x_m) / t) / Float64(z * 0.5)); elseif (y <= -1.35e-95) tmp = Float64(Float64(2.0 / z) * Float64(x_m / y)); elseif (y <= 2400000000.0) tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t)); else tmp = t_1; end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) t_1 = (x_m * 2.0) / (z * y); tmp = 0.0; if (y <= -5.1e-51) tmp = t_1; elseif (y <= -1.2e-73) tmp = (-x_m / t) / (z * 0.5); elseif (y <= -1.35e-95) tmp = (2.0 / z) * (x_m / y); elseif (y <= 2400000000.0) tmp = -2.0 * ((x_m / z) / t); else tmp = t_1; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m * 2.0), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -5.1e-51], t$95$1, If[LessEqual[y, -1.2e-73], N[(N[((-x$95$m) / t), $MachinePrecision] / N[(z * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.35e-95], N[(N[(2.0 / z), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2400000000.0], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_1 := \frac{x\_m \cdot 2}{z \cdot y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{-x\_m}{t}}{z \cdot 0.5}\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-95}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x\_m}{y}\\
\mathbf{elif}\;y \leq 2400000000:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -5.0999999999999997e-51 or 2.4e9 < y Initial program 92.0%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around inf 84.3%
*-commutative84.3%
Simplified84.3%
if -5.0999999999999997e-51 < y < -1.20000000000000003e-73Initial program 78.5%
distribute-rgt-out--78.5%
Simplified78.5%
add-sqr-sqrt44.1%
*-commutative44.1%
times-frac44.3%
Applied egg-rr44.3%
frac-times44.1%
add-sqr-sqrt78.5%
frac-times99.7%
clear-num99.7%
un-div-inv99.7%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 88.9%
associate-*r/88.8%
neg-mul-188.8%
Simplified88.9%
if -1.20000000000000003e-73 < y < -1.35e-95Initial program 75.5%
distribute-rgt-out--75.9%
Simplified75.9%
*-commutative75.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 87.4%
if -1.35e-95 < y < 2.4e9Initial program 90.6%
distribute-rgt-out--91.7%
Simplified91.7%
Taylor expanded in y around 0 83.3%
*-commutative83.3%
Simplified83.3%
associate-/r*85.0%
div-inv84.8%
Applied egg-rr84.8%
associate-*r/85.0%
*-rgt-identity85.0%
Simplified85.0%
Final simplification84.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (or (<= y -4.7e-51) (not (<= y 1900000000.0)))
(* x_m (/ 2.0 (* z y)))
(* -2.0 (/ (/ x_m z) t)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((y <= -4.7e-51) || !(y <= 1900000000.0)) {
tmp = x_m * (2.0 / (z * y));
} else {
tmp = -2.0 * ((x_m / z) / t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4.7d-51)) .or. (.not. (y <= 1900000000.0d0))) then
tmp = x_m * (2.0d0 / (z * y))
else
tmp = (-2.0d0) * ((x_m / z) / t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((y <= -4.7e-51) || !(y <= 1900000000.0)) {
tmp = x_m * (2.0 / (z * y));
} else {
tmp = -2.0 * ((x_m / z) / t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (y <= -4.7e-51) or not (y <= 1900000000.0): tmp = x_m * (2.0 / (z * y)) else: tmp = -2.0 * ((x_m / z) / t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if ((y <= -4.7e-51) || !(y <= 1900000000.0)) tmp = Float64(x_m * Float64(2.0 / Float64(z * y))); else tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((y <= -4.7e-51) || ~((y <= 1900000000.0))) tmp = x_m * (2.0 / (z * y)); else tmp = -2.0 * ((x_m / z) / t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[y, -4.7e-51], N[Not[LessEqual[y, 1900000000.0]], $MachinePrecision]], N[(x$95$m * N[(2.0 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{-51} \lor \neg \left(y \leq 1900000000\right):\\
\;\;\;\;x\_m \cdot \frac{2}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\
\end{array}
\end{array}
if y < -4.6999999999999997e-51 or 1.9e9 < y Initial program 92.0%
distribute-rgt-out--94.7%
Simplified94.7%
Taylor expanded in y around inf 84.3%
*-commutative84.3%
Simplified84.3%
associate-/l*84.2%
*-commutative84.2%
Applied egg-rr84.2%
if -4.6999999999999997e-51 < y < 1.9e9Initial program 88.5%
distribute-rgt-out--89.5%
Simplified89.5%
Taylor expanded in y around 0 78.0%
*-commutative78.0%
Simplified78.0%
associate-/r*81.0%
div-inv80.9%
Applied egg-rr80.9%
associate-*r/81.0%
*-rgt-identity81.0%
Simplified81.0%
Final simplification82.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 5e-41)
(* 2.0 (/ (/ x_m z) (- y t)))
(* (/ x_m (- y t)) (/ 2.0 z)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-41) {
tmp = 2.0 * ((x_m / z) / (y - t));
} else {
tmp = (x_m / (y - t)) * (2.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 5d-41) then
tmp = 2.0d0 * ((x_m / z) / (y - t))
else
tmp = (x_m / (y - t)) * (2.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-41) {
tmp = 2.0 * ((x_m / z) / (y - t));
} else {
tmp = (x_m / (y - t)) * (2.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 5e-41: tmp = 2.0 * ((x_m / z) / (y - t)) else: tmp = (x_m / (y - t)) * (2.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 5e-41) tmp = Float64(2.0 * Float64(Float64(x_m / z) / Float64(y - t))); else tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 5e-41) tmp = 2.0 * ((x_m / z) / (y - t)); else tmp = (x_m / (y - t)) * (2.0 / z); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 5e-41], N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 5 \cdot 10^{-41}:\\
\;\;\;\;2 \cdot \frac{\frac{x\_m}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 4.9999999999999996e-41Initial program 91.5%
distribute-rgt-out--93.7%
Simplified93.7%
Taylor expanded in x around 0 93.7%
associate-/r*92.9%
Simplified92.9%
if 4.9999999999999996e-41 < (*.f64 x #s(literal 2 binary64)) Initial program 87.7%
distribute-rgt-out--89.2%
Simplified89.2%
*-commutative89.2%
times-frac97.0%
Applied egg-rr97.0%
Final simplification94.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
:precision binary64
(*
x_s
(if (<= (* x_m 2.0) 5e-41)
(/ (/ x_m (* z 0.5)) (- y t))
(* (/ x_m (- y t)) (/ 2.0 z)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-41) {
tmp = (x_m / (z * 0.5)) / (y - t);
} else {
tmp = (x_m / (y - t)) * (2.0 / z);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x_m * 2.0d0) <= 5d-41) then
tmp = (x_m / (z * 0.5d0)) / (y - t)
else
tmp = (x_m / (y - t)) * (2.0d0 / z)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if ((x_m * 2.0) <= 5e-41) {
tmp = (x_m / (z * 0.5)) / (y - t);
} else {
tmp = (x_m / (y - t)) * (2.0 / z);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if (x_m * 2.0) <= 5e-41: tmp = (x_m / (z * 0.5)) / (y - t) else: tmp = (x_m / (y - t)) * (2.0 / z) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (Float64(x_m * 2.0) <= 5e-41) tmp = Float64(Float64(x_m / Float64(z * 0.5)) / Float64(y - t)); else tmp = Float64(Float64(x_m / Float64(y - t)) * Float64(2.0 / z)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if ((x_m * 2.0) <= 5e-41) tmp = (x_m / (z * 0.5)) / (y - t); else tmp = (x_m / (y - t)) * (2.0 / z); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(x$95$m * 2.0), $MachinePrecision], 5e-41], N[(N[(x$95$m / N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \cdot 2 \leq 5 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{x\_m}{z \cdot 0.5}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 2 binary64)) < 4.9999999999999996e-41Initial program 91.5%
distribute-rgt-out--93.7%
Simplified93.7%
add-sqr-sqrt31.7%
*-commutative31.7%
times-frac31.1%
Applied egg-rr31.1%
frac-times31.7%
add-sqr-sqrt93.7%
frac-times91.2%
*-commutative91.2%
clear-num91.2%
frac-times93.7%
*-un-lft-identity93.7%
div-inv93.7%
metadata-eval93.7%
Applied egg-rr93.7%
associate-/r*93.0%
Simplified93.0%
if 4.9999999999999996e-41 < (*.f64 x #s(literal 2 binary64)) Initial program 87.7%
distribute-rgt-out--89.2%
Simplified89.2%
*-commutative89.2%
times-frac97.0%
Applied egg-rr97.0%
Final simplification94.1%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (if (<= z 2.5e-24) (* -2.0 (/ x_m (* z t))) (* -2.0 (/ (/ x_m z) t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= 2.5e-24) {
tmp = -2.0 * (x_m / (z * t));
} else {
tmp = -2.0 * ((x_m / z) / t);
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 2.5d-24) then
tmp = (-2.0d0) * (x_m / (z * t))
else
tmp = (-2.0d0) * ((x_m / z) / t)
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
double tmp;
if (z <= 2.5e-24) {
tmp = -2.0 * (x_m / (z * t));
} else {
tmp = -2.0 * ((x_m / z) / t);
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): tmp = 0 if z <= 2.5e-24: tmp = -2.0 * (x_m / (z * t)) else: tmp = -2.0 * ((x_m / z) / t) return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) tmp = 0.0 if (z <= 2.5e-24) tmp = Float64(-2.0 * Float64(x_m / Float64(z * t))); else tmp = Float64(-2.0 * Float64(Float64(x_m / z) / t)); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z, t) tmp = 0.0; if (z <= 2.5e-24) tmp = -2.0 * (x_m / (z * t)); else tmp = -2.0 * ((x_m / z) / t); end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, 2.5e-24], N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x$95$m / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{-24}:\\
\;\;\;\;-2 \cdot \frac{x\_m}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x\_m}{z}}{t}\\
\end{array}
\end{array}
if z < 2.4999999999999999e-24Initial program 91.2%
distribute-rgt-out--92.3%
Simplified92.3%
Taylor expanded in y around 0 47.9%
*-commutative47.9%
Simplified47.9%
if 2.4999999999999999e-24 < z Initial program 88.0%
distribute-rgt-out--93.2%
Simplified93.2%
Taylor expanded in y around 0 46.2%
*-commutative46.2%
Simplified46.2%
associate-/r*64.2%
div-inv64.1%
Applied egg-rr64.1%
associate-*r/64.2%
*-rgt-identity64.2%
Simplified64.2%
Final simplification51.6%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* 2.0 (/ (/ x_m z) (- y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (2.0 * ((x_m / z) / (y - t)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * (2.0d0 * ((x_m / z) / (y - t)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (2.0 * ((x_m / z) / (y - t)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (2.0 * ((x_m / z) / (y - t)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(2.0 * Float64(Float64(x_m / z) / Float64(y - t)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * (2.0 * ((x_m / z) / (y - t))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(2.0 * N[(N[(x$95$m / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(2 \cdot \frac{\frac{x\_m}{z}}{y - t}\right)
\end{array}
Initial program 90.5%
distribute-rgt-out--92.5%
Simplified92.5%
Taylor expanded in x around 0 92.5%
associate-/r*92.2%
Simplified92.2%
Final simplification92.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* -2.0 (/ x_m (* z t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (-2.0 * (x_m / (z * t)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x_s * ((-2.0d0) * (x_m / (z * t)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
return x_s * (-2.0 * (x_m / (z * t)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m, y, z, t): return x_s * (-2.0 * (x_m / (z * t)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m, y, z, t) return Float64(x_s * Float64(-2.0 * Float64(x_m / Float64(z * t)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z, t) tmp = x_s * (-2.0 * (x_m / (z * t))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(-2.0 * N[(x$95$m / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(-2 \cdot \frac{x\_m}{z \cdot t}\right)
\end{array}
Initial program 90.5%
distribute-rgt-out--92.5%
Simplified92.5%
Taylor expanded in y around 0 47.6%
*-commutative47.6%
Simplified47.6%
Final simplification47.6%
(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 2024078
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:alt
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))