
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x 2.0) (- (* y z) (* z t)))))
(if (<= t_1 -1e-241)
(/ (* x 2.0) (* z (- y t)))
(if (<= t_1 1e+76)
(* 2.0 (/ (/ x z) (- y t)))
(* (/ x (- y t)) (/ 2.0 z))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 2.0) / ((y * z) - (z * t));
double tmp;
if (t_1 <= -1e-241) {
tmp = (x * 2.0) / (z * (y - t));
} else if (t_1 <= 1e+76) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z);
}
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) :: tmp
t_1 = (x * 2.0d0) / ((y * z) - (z * t))
if (t_1 <= (-1d-241)) then
tmp = (x * 2.0d0) / (z * (y - t))
else if (t_1 <= 1d+76) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = (x / (y - t)) * (2.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 2.0) / ((y * z) - (z * t));
double tmp;
if (t_1 <= -1e-241) {
tmp = (x * 2.0) / (z * (y - t));
} else if (t_1 <= 1e+76) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 2.0) / ((y * z) - (z * t)) tmp = 0 if t_1 <= -1e-241: tmp = (x * 2.0) / (z * (y - t)) elif t_1 <= 1e+76: tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (x / (y - t)) * (2.0 / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(z * t))) tmp = 0.0 if (t_1 <= -1e-241) tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); elseif (t_1 <= 1e+76) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 2.0) / ((y * z) - (z * t)); tmp = 0.0; if (t_1 <= -1e-241) tmp = (x * 2.0) / (z * (y - t)); elseif (t_1 <= 1e+76) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (x / (y - t)) * (2.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-241], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+76], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot 2}{y \cdot z - z \cdot t}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-241}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t_1 \leq 10^{+76}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -9.9999999999999997e-242Initial program 98.5%
distribute-rgt-out--99.6%
Simplified99.6%
if -9.9999999999999997e-242 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 1e76Initial program 88.1%
associate-*l/88.1%
*-commutative88.1%
distribute-rgt-out--88.1%
associate-/r*99.8%
Simplified99.8%
if 1e76 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 80.0%
distribute-rgt-out--89.3%
Simplified89.3%
*-commutative89.3%
times-frac95.4%
Applied egg-rr95.4%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e+66)
(* x (/ (/ 2.0 y) z))
(if (<= y -1.7e-238)
(* (/ x t) (/ -2.0 z))
(if (<= y 5.2e-181)
(* -2.0 (/ (/ x z) t))
(if (<= y 0.00165) (* -2.0 (/ x (* z t))) (* (/ x z) (/ 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+66) {
tmp = x * ((2.0 / y) / z);
} else if (y <= -1.7e-238) {
tmp = (x / t) * (-2.0 / z);
} else if (y <= 5.2e-181) {
tmp = -2.0 * ((x / z) / t);
} else if (y <= 0.00165) {
tmp = -2.0 * (x / (z * t));
} else {
tmp = (x / z) * (2.0 / y);
}
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) :: tmp
if (y <= (-1.05d+66)) then
tmp = x * ((2.0d0 / y) / z)
else if (y <= (-1.7d-238)) then
tmp = (x / t) * ((-2.0d0) / z)
else if (y <= 5.2d-181) then
tmp = (-2.0d0) * ((x / z) / t)
else if (y <= 0.00165d0) then
tmp = (-2.0d0) * (x / (z * t))
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+66) {
tmp = x * ((2.0 / y) / z);
} else if (y <= -1.7e-238) {
tmp = (x / t) * (-2.0 / z);
} else if (y <= 5.2e-181) {
tmp = -2.0 * ((x / z) / t);
} else if (y <= 0.00165) {
tmp = -2.0 * (x / (z * t));
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e+66: tmp = x * ((2.0 / y) / z) elif y <= -1.7e-238: tmp = (x / t) * (-2.0 / z) elif y <= 5.2e-181: tmp = -2.0 * ((x / z) / t) elif y <= 0.00165: tmp = -2.0 * (x / (z * t)) else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e+66) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); elseif (y <= -1.7e-238) tmp = Float64(Float64(x / t) * Float64(-2.0 / z)); elseif (y <= 5.2e-181) tmp = Float64(-2.0 * Float64(Float64(x / z) / t)); elseif (y <= 0.00165) tmp = Float64(-2.0 * Float64(x / Float64(z * t))); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e+66) tmp = x * ((2.0 / y) / z); elseif (y <= -1.7e-238) tmp = (x / t) * (-2.0 / z); elseif (y <= 5.2e-181) tmp = -2.0 * ((x / z) / t); elseif (y <= 0.00165) tmp = -2.0 * (x / (z * t)); else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e+66], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-238], N[(N[(x / t), $MachinePrecision] * N[(-2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-181], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00165], N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+66}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-238}:\\
\;\;\;\;\frac{x}{t} \cdot \frac{-2}{z}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-181}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\mathbf{elif}\;y \leq 0.00165:\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -1.05000000000000003e66Initial program 93.8%
associate-*r/93.7%
distribute-rgt-out--93.8%
associate-/l/93.9%
sub-neg93.9%
+-commutative93.9%
neg-sub093.9%
associate-+l-93.9%
sub0-neg93.9%
neg-mul-193.9%
associate-/r*93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in t around 0 84.3%
if -1.05000000000000003e66 < y < -1.69999999999999992e-238Initial program 89.4%
associate-*r/89.3%
distribute-rgt-out--89.3%
associate-/l/90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
neg-mul-190.0%
associate-/r*90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in t around inf 66.9%
*-commutative66.9%
*-commutative66.9%
associate-/r*65.4%
Simplified65.4%
*-commutative65.4%
clear-num65.4%
un-div-inv65.4%
div-inv66.8%
clear-num68.2%
Applied egg-rr68.2%
associate-*r/66.8%
*-commutative66.8%
associate-/l*66.9%
*-commutative66.9%
*-commutative66.9%
times-frac72.8%
Applied egg-rr72.8%
if -1.69999999999999992e-238 < y < 5.19999999999999998e-181Initial program 87.8%
associate-*r/87.9%
distribute-rgt-out--90.5%
associate-/l/90.5%
sub-neg90.5%
+-commutative90.5%
neg-sub090.5%
associate-+l-90.5%
sub0-neg90.5%
neg-mul-190.5%
associate-/r*90.5%
metadata-eval90.5%
Simplified90.5%
Taylor expanded in t around inf 83.5%
*-commutative83.5%
*-commutative83.5%
associate-/r*89.8%
Simplified89.8%
if 5.19999999999999998e-181 < y < 0.00165Initial program 91.5%
associate-*r/91.4%
distribute-rgt-out--96.9%
associate-/l/97.1%
sub-neg97.1%
+-commutative97.1%
neg-sub097.1%
associate-+l-97.1%
sub0-neg97.1%
neg-mul-197.1%
associate-/r*97.1%
metadata-eval97.1%
Simplified97.1%
Taylor expanded in t around inf 78.2%
*-commutative78.2%
Simplified78.2%
if 0.00165 < y Initial program 89.9%
associate-*r/89.7%
distribute-rgt-out--92.7%
associate-/l/92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
associate-/r*92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in t around 0 77.3%
associate-*r/77.3%
times-frac79.8%
Simplified79.8%
Final simplification80.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (/ 2.0 y) z))))
(if (<= y -1.3e+66)
t_1
(if (<= y -9.5e+21)
(/ -2.0 (* t (/ z x)))
(if (<= y -3.7e-11)
t_1
(if (<= y 0.00145) (* x (/ (/ -2.0 t) z)) (* (/ x z) (/ 2.0 y))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 / y) / z);
double tmp;
if (y <= -1.3e+66) {
tmp = t_1;
} else if (y <= -9.5e+21) {
tmp = -2.0 / (t * (z / x));
} else if (y <= -3.7e-11) {
tmp = t_1;
} else if (y <= 0.00145) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = (x / z) * (2.0 / y);
}
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) :: tmp
t_1 = x * ((2.0d0 / y) / z)
if (y <= (-1.3d+66)) then
tmp = t_1
else if (y <= (-9.5d+21)) then
tmp = (-2.0d0) / (t * (z / x))
else if (y <= (-3.7d-11)) then
tmp = t_1
else if (y <= 0.00145d0) then
tmp = x * (((-2.0d0) / t) / z)
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 / y) / z);
double tmp;
if (y <= -1.3e+66) {
tmp = t_1;
} else if (y <= -9.5e+21) {
tmp = -2.0 / (t * (z / x));
} else if (y <= -3.7e-11) {
tmp = t_1;
} else if (y <= 0.00145) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((2.0 / y) / z) tmp = 0 if y <= -1.3e+66: tmp = t_1 elif y <= -9.5e+21: tmp = -2.0 / (t * (z / x)) elif y <= -3.7e-11: tmp = t_1 elif y <= 0.00145: tmp = x * ((-2.0 / t) / z) else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(2.0 / y) / z)) tmp = 0.0 if (y <= -1.3e+66) tmp = t_1; elseif (y <= -9.5e+21) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (y <= -3.7e-11) tmp = t_1; elseif (y <= 0.00145) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((2.0 / y) / z); tmp = 0.0; if (y <= -1.3e+66) tmp = t_1; elseif (y <= -9.5e+21) tmp = -2.0 / (t * (z / x)); elseif (y <= -3.7e-11) tmp = t_1; elseif (y <= 0.00145) tmp = x * ((-2.0 / t) / z); else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+66], t$95$1, If[LessEqual[y, -9.5e+21], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.7e-11], t$95$1, If[LessEqual[y, 0.00145], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.00145:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -1.30000000000000006e66 or -9.500000000000001e21 < y < -3.7000000000000001e-11Initial program 94.4%
associate-*r/94.3%
distribute-rgt-out--94.5%
associate-/l/94.6%
sub-neg94.6%
+-commutative94.6%
neg-sub094.6%
associate-+l-94.6%
sub0-neg94.6%
neg-mul-194.6%
associate-/r*94.6%
metadata-eval94.6%
Simplified94.6%
Taylor expanded in t around 0 84.4%
if -1.30000000000000006e66 < y < -9.500000000000001e21Initial program 70.5%
associate-*r/70.6%
distribute-rgt-out--70.9%
associate-/l/70.9%
sub-neg70.9%
+-commutative70.9%
neg-sub070.9%
associate-+l-70.9%
sub0-neg70.9%
neg-mul-170.9%
associate-/r*70.9%
metadata-eval70.9%
Simplified70.9%
Taylor expanded in t around inf 48.9%
*-commutative48.9%
*-commutative48.9%
associate-/r*70.2%
Simplified70.2%
*-commutative70.2%
clear-num70.1%
un-div-inv70.1%
div-inv77.4%
clear-num77.4%
Applied egg-rr77.4%
if -3.7000000000000001e-11 < y < 0.00145Initial program 91.0%
associate-*r/90.9%
distribute-rgt-out--93.4%
associate-/l/93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
neg-mul-193.8%
associate-/r*93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in t around inf 79.5%
if 0.00145 < y Initial program 89.9%
associate-*r/89.7%
distribute-rgt-out--92.7%
associate-/l/92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
associate-/r*92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in t around 0 77.3%
associate-*r/77.3%
times-frac79.8%
Simplified79.8%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.7e+57) (not (<= z 9.5e+105))) (* 2.0 (/ (/ x z) (- y t))) (* x (/ (/ -2.0 (- t y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.7e+57) || !(z <= 9.5e+105)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * ((-2.0 / (t - y)) / z);
}
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) :: tmp
if ((z <= (-5.7d+57)) .or. (.not. (z <= 9.5d+105))) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = x * (((-2.0d0) / (t - y)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.7e+57) || !(z <= 9.5e+105)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * ((-2.0 / (t - y)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.7e+57) or not (z <= 9.5e+105): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = x * ((-2.0 / (t - y)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.7e+57) || !(z <= 9.5e+105)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(x * Float64(Float64(-2.0 / Float64(t - y)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.7e+57) || ~((z <= 9.5e+105))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = x * ((-2.0 / (t - y)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.7e+57], N[Not[LessEqual[z, 9.5e+105]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+57} \lor \neg \left(z \leq 9.5 \cdot 10^{+105}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t - y}}{z}\\
\end{array}
\end{array}
if z < -5.6999999999999998e57 or 9.4999999999999995e105 < z Initial program 78.0%
associate-*l/78.0%
*-commutative78.0%
distribute-rgt-out--80.6%
associate-/r*97.8%
Simplified97.8%
if -5.6999999999999998e57 < z < 9.4999999999999995e105Initial program 96.3%
associate-*r/96.1%
distribute-rgt-out--97.9%
associate-/l/98.0%
sub-neg98.0%
+-commutative98.0%
neg-sub098.0%
associate-+l-98.0%
sub0-neg98.0%
neg-mul-198.0%
associate-/r*98.0%
metadata-eval98.0%
Simplified98.0%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.8e+57)
(/ 2.0 (* (- y t) (/ z x)))
(if (<= z 3.5e+104)
(* x (/ (/ -2.0 (- t y)) z))
(* 2.0 (/ (/ x z) (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+57) {
tmp = 2.0 / ((y - t) * (z / x));
} else if (z <= 3.5e+104) {
tmp = x * ((-2.0 / (t - y)) / z);
} else {
tmp = 2.0 * ((x / z) / (y - t));
}
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) :: tmp
if (z <= (-2.8d+57)) then
tmp = 2.0d0 / ((y - t) * (z / x))
else if (z <= 3.5d+104) then
tmp = x * (((-2.0d0) / (t - y)) / z)
else
tmp = 2.0d0 * ((x / z) / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+57) {
tmp = 2.0 / ((y - t) * (z / x));
} else if (z <= 3.5e+104) {
tmp = x * ((-2.0 / (t - y)) / z);
} else {
tmp = 2.0 * ((x / z) / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e+57: tmp = 2.0 / ((y - t) * (z / x)) elif z <= 3.5e+104: tmp = x * ((-2.0 / (t - y)) / z) else: tmp = 2.0 * ((x / z) / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e+57) tmp = Float64(2.0 / Float64(Float64(y - t) * Float64(z / x))); elseif (z <= 3.5e+104) tmp = Float64(x * Float64(Float64(-2.0 / Float64(t - y)) / z)); else tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e+57) tmp = 2.0 / ((y - t) * (z / x)); elseif (z <= 3.5e+104) tmp = x * ((-2.0 / (t - y)) / z); else tmp = 2.0 * ((x / z) / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e+57], N[(2.0 / N[(N[(y - t), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+104], N[(x * N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{2}{\left(y - t\right) \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t - y}}{z}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if z < -2.8e57Initial program 82.3%
distribute-rgt-out--84.6%
times-frac99.7%
Simplified99.7%
clear-num99.5%
frac-times99.8%
metadata-eval99.8%
Applied egg-rr99.8%
if -2.8e57 < z < 3.5000000000000002e104Initial program 96.3%
associate-*r/96.1%
distribute-rgt-out--97.9%
associate-/l/98.0%
sub-neg98.0%
+-commutative98.0%
neg-sub098.0%
associate-+l-98.0%
sub0-neg98.0%
neg-mul-198.0%
associate-/r*98.0%
metadata-eval98.0%
Simplified98.0%
if 3.5000000000000002e104 < z Initial program 73.2%
associate-*l/73.2%
*-commutative73.2%
distribute-rgt-out--76.1%
associate-/r*95.6%
Simplified95.6%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.6e-11) (not (<= y 0.00047))) (* x (/ (/ 2.0 y) z)) (* x (/ (/ -2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.6e-11) || !(y <= 0.00047)) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = x * ((-2.0 / t) / z);
}
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) :: tmp
if ((y <= (-5.6d-11)) .or. (.not. (y <= 0.00047d0))) then
tmp = x * ((2.0d0 / y) / z)
else
tmp = x * (((-2.0d0) / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.6e-11) || !(y <= 0.00047)) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.6e-11) or not (y <= 0.00047): tmp = x * ((2.0 / y) / z) else: tmp = x * ((-2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.6e-11) || !(y <= 0.00047)) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); else tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.6e-11) || ~((y <= 0.00047))) tmp = x * ((2.0 / y) / z); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.6e-11], N[Not[LessEqual[y, 0.00047]], $MachinePrecision]], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-11} \lor \neg \left(y \leq 0.00047\right):\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if y < -5.6e-11 or 4.69999999999999986e-4 < y Initial program 89.9%
associate-*r/89.7%
distribute-rgt-out--91.3%
associate-/l/91.4%
sub-neg91.4%
+-commutative91.4%
neg-sub091.4%
associate-+l-91.4%
sub0-neg91.4%
neg-mul-191.4%
associate-/r*91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in t around 0 76.6%
if -5.6e-11 < y < 4.69999999999999986e-4Initial program 91.0%
associate-*r/90.9%
distribute-rgt-out--93.4%
associate-/l/93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
neg-mul-193.8%
associate-/r*93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in t around inf 79.5%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e-10) (* x (/ (/ 2.0 y) z)) (if (<= y 0.00175) (* x (/ (/ -2.0 t) z)) (* (/ x z) (/ 2.0 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-10) {
tmp = x * ((2.0 / y) / z);
} else if (y <= 0.00175) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = (x / z) * (2.0 / y);
}
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) :: tmp
if (y <= (-2.5d-10)) then
tmp = x * ((2.0d0 / y) / z)
else if (y <= 0.00175d0) then
tmp = x * (((-2.0d0) / t) / z)
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-10) {
tmp = x * ((2.0 / y) / z);
} else if (y <= 0.00175) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-10: tmp = x * ((2.0 / y) / z) elif y <= 0.00175: tmp = x * ((-2.0 / t) / z) else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-10) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); elseif (y <= 0.00175) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.5e-10) tmp = x * ((2.0 / y) / z); elseif (y <= 0.00175) tmp = x * ((-2.0 / t) / z); else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-10], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00175], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{elif}\;y \leq 0.00175:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -2.50000000000000016e-10Initial program 89.8%
associate-*r/89.7%
distribute-rgt-out--89.9%
associate-/l/90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
neg-mul-190.0%
associate-/r*90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in t around 0 76.0%
if -2.50000000000000016e-10 < y < 0.00175000000000000004Initial program 91.0%
associate-*r/90.9%
distribute-rgt-out--93.4%
associate-/l/93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
neg-mul-193.8%
associate-/r*93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in t around inf 79.5%
if 0.00175000000000000004 < y Initial program 89.9%
associate-*r/89.7%
distribute-rgt-out--92.7%
associate-/l/92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
associate-/r*92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in t around 0 77.3%
associate-*r/77.3%
times-frac79.8%
Simplified79.8%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (<= t -7.5e+25) (* x (/ (/ -2.0 t) z)) (if (<= t 2.3e+22) (* (/ x z) (/ 2.0 y)) (/ (* x (/ -2.0 t)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.5e+25) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 2.3e+22) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = (x * (-2.0 / t)) / z;
}
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) :: tmp
if (t <= (-7.5d+25)) then
tmp = x * (((-2.0d0) / t) / z)
else if (t <= 2.3d+22) then
tmp = (x / z) * (2.0d0 / y)
else
tmp = (x * ((-2.0d0) / t)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.5e+25) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 2.3e+22) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = (x * (-2.0 / t)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7.5e+25: tmp = x * ((-2.0 / t) / z) elif t <= 2.3e+22: tmp = (x / z) * (2.0 / y) else: tmp = (x * (-2.0 / t)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7.5e+25) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); elseif (t <= 2.3e+22) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); else tmp = Float64(Float64(x * Float64(-2.0 / t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -7.5e+25) tmp = x * ((-2.0 / t) / z); elseif (t <= 2.3e+22) tmp = (x / z) * (2.0 / y); else tmp = (x * (-2.0 / t)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.5e+25], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+22], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+25}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-2}{t}}{z}\\
\end{array}
\end{array}
if t < -7.49999999999999993e25Initial program 91.6%
associate-*r/91.5%
distribute-rgt-out--91.7%
associate-/l/91.9%
sub-neg91.9%
+-commutative91.9%
neg-sub091.9%
associate-+l-91.9%
sub0-neg91.9%
neg-mul-191.9%
associate-/r*91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in t around inf 77.5%
if -7.49999999999999993e25 < t < 2.3000000000000002e22Initial program 91.5%
associate-*r/91.4%
distribute-rgt-out--93.6%
associate-/l/93.7%
sub-neg93.7%
+-commutative93.7%
neg-sub093.7%
associate-+l-93.7%
sub0-neg93.7%
neg-mul-193.7%
associate-/r*93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in t around 0 74.8%
associate-*r/74.8%
times-frac75.4%
Simplified75.4%
if 2.3000000000000002e22 < t Initial program 86.2%
associate-*r/86.1%
distribute-rgt-out--89.7%
associate-/l/90.4%
sub-neg90.4%
+-commutative90.4%
neg-sub090.4%
associate-+l-90.4%
sub0-neg90.4%
neg-mul-190.4%
associate-/r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in t around inf 80.2%
*-commutative80.2%
associate-*l/82.5%
Applied egg-rr82.5%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (<= t -5e+25) (* x (/ (/ -2.0 t) z)) (if (<= t 62000000000.0) (/ (/ 2.0 y) (/ z x)) (/ (* x (/ -2.0 t)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5e+25) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 62000000000.0) {
tmp = (2.0 / y) / (z / x);
} else {
tmp = (x * (-2.0 / t)) / z;
}
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) :: tmp
if (t <= (-5d+25)) then
tmp = x * (((-2.0d0) / t) / z)
else if (t <= 62000000000.0d0) then
tmp = (2.0d0 / y) / (z / x)
else
tmp = (x * ((-2.0d0) / t)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5e+25) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 62000000000.0) {
tmp = (2.0 / y) / (z / x);
} else {
tmp = (x * (-2.0 / t)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5e+25: tmp = x * ((-2.0 / t) / z) elif t <= 62000000000.0: tmp = (2.0 / y) / (z / x) else: tmp = (x * (-2.0 / t)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5e+25) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); elseif (t <= 62000000000.0) tmp = Float64(Float64(2.0 / y) / Float64(z / x)); else tmp = Float64(Float64(x * Float64(-2.0 / t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5e+25) tmp = x * ((-2.0 / t) / z); elseif (t <= 62000000000.0) tmp = (2.0 / y) / (z / x); else tmp = (x * (-2.0 / t)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5e+25], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 62000000000.0], N[(N[(2.0 / y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+25}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{elif}\;t \leq 62000000000:\\
\;\;\;\;\frac{\frac{2}{y}}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-2}{t}}{z}\\
\end{array}
\end{array}
if t < -5.00000000000000024e25Initial program 91.6%
associate-*r/91.5%
distribute-rgt-out--91.7%
associate-/l/91.9%
sub-neg91.9%
+-commutative91.9%
neg-sub091.9%
associate-+l-91.9%
sub0-neg91.9%
neg-mul-191.9%
associate-/r*91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in t around inf 77.5%
if -5.00000000000000024e25 < t < 6.2e10Initial program 91.5%
associate-*r/91.4%
distribute-rgt-out--93.6%
associate-/l/93.7%
sub-neg93.7%
+-commutative93.7%
neg-sub093.7%
associate-+l-93.7%
sub0-neg93.7%
neg-mul-193.7%
associate-/r*93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in t around 0 74.8%
associate-*r/74.8%
times-frac75.4%
Simplified75.4%
clear-num75.3%
un-div-inv76.4%
Applied egg-rr76.4%
if 6.2e10 < t Initial program 86.2%
associate-*r/86.1%
distribute-rgt-out--89.7%
associate-/l/90.4%
sub-neg90.4%
+-commutative90.4%
neg-sub090.4%
associate-+l-90.4%
sub0-neg90.4%
neg-mul-190.4%
associate-/r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in t around inf 80.2%
*-commutative80.2%
associate-*l/82.5%
Applied egg-rr82.5%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (* 2.0 (/ (/ x z) (- y t))))
double code(double x, double y, double z, double t) {
return 2.0 * ((x / z) / (y - t));
}
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 = 2.0d0 * ((x / z) / (y - t))
end function
public static double code(double x, double y, double z, double t) {
return 2.0 * ((x / z) / (y - t));
}
def code(x, y, z, t): return 2.0 * ((x / z) / (y - t))
function code(x, y, z, t) return Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))) end
function tmp = code(x, y, z, t) tmp = 2.0 * ((x / z) / (y - t)); end
code[x_, y_, z_, t_] := N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\frac{x}{z}}{y - t}
\end{array}
Initial program 90.4%
associate-*l/90.4%
*-commutative90.4%
distribute-rgt-out--92.4%
associate-/r*91.7%
Simplified91.7%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (* x (/ (/ -2.0 t) z)))
double code(double x, double y, double z, double t) {
return x * ((-2.0 / 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) / t) / z)
end function
public static double code(double x, double y, double z, double t) {
return x * ((-2.0 / t) / z);
}
def code(x, y, z, t): return x * ((-2.0 / t) / z)
function code(x, y, z, t) return Float64(x * Float64(Float64(-2.0 / t) / z)) end
function tmp = code(x, y, z, t) tmp = x * ((-2.0 / t) / z); end
code[x_, y_, z_, t_] := N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{-2}{t}}{z}
\end{array}
Initial program 90.4%
associate-*r/90.3%
distribute-rgt-out--92.3%
associate-/l/92.5%
sub-neg92.5%
+-commutative92.5%
neg-sub092.5%
associate-+l-92.5%
sub0-neg92.5%
neg-mul-192.5%
associate-/r*92.5%
metadata-eval92.5%
Simplified92.5%
Taylor expanded in t around inf 53.9%
Final simplification53.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
(t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
(if (< t_2 -2.559141628295061e-13)
t_1
(if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / ((y - t) * z)) * 2.0d0
t_2 = (x * 2.0d0) / ((y * z) - (t * z))
if (t_2 < (-2.559141628295061d-13)) then
tmp = t_1
else if (t_2 < 1.045027827330126d-269) then
tmp = ((x / z) * 2.0d0) / (y - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / ((y - t) * z)) * 2.0 t_2 = (x * 2.0) / ((y * z) - (t * z)) tmp = 0 if t_2 < -2.559141628295061e-13: tmp = t_1 elif t_2 < 1.045027827330126e-269: tmp = ((x / z) * 2.0) / (y - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0) t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) tmp = 0.0 if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / ((y - t) * z)) * 2.0; t_2 = (x * 2.0) / ((y * z) - (t * z)); tmp = 0.0; if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = ((x / z) * 2.0) / (y - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023196
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))