
(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 (- (* y z) (* z t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+195)))
(* 2.0 (/ (/ x z) (- y t)))
(/ (* 2.0 x) (* z (- y t))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+195)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * x) / (z * (y - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+195)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * x) / (z * (y - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - (z * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+195): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (2.0 * x) / (z * (y - t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - Float64(z * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+195)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(2.0 * x) / Float64(z * Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) - (z * t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+195))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (2.0 * x) / (z * (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+195]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 4 \cdot 10^{+195}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -inf.0 or 3.99999999999999991e195 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 65.6%
associate-*l/65.6%
*-commutative65.6%
distribute-rgt-out--70.1%
associate-/r*99.9%
Simplified99.9%
if -inf.0 < (-.f64 (*.f64 y z) (*.f64 t z)) < 3.99999999999999991e195Initial program 97.1%
distribute-rgt-out--98.7%
Simplified98.7%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (/ 2.0 y) z))) (t_2 (* x (/ (/ -2.0 t) z))))
(if (<= t -280000000.0)
t_2
(if (<= t -1.4e-69)
t_1
(if (<= t -1.45e-98)
(* x (/ -2.0 (* z t)))
(if (<= t 2.4e-67) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((2.0 / y) / z);
double t_2 = x * ((-2.0 / t) / z);
double tmp;
if (t <= -280000000.0) {
tmp = t_2;
} else if (t <= -1.4e-69) {
tmp = t_1;
} else if (t <= -1.45e-98) {
tmp = x * (-2.0 / (z * t));
} else if (t <= 2.4e-67) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * ((2.0d0 / y) / z)
t_2 = x * (((-2.0d0) / t) / z)
if (t <= (-280000000.0d0)) then
tmp = t_2
else if (t <= (-1.4d-69)) then
tmp = t_1
else if (t <= (-1.45d-98)) then
tmp = x * ((-2.0d0) / (z * t))
else if (t <= 2.4d-67) then
tmp = t_1
else
tmp = t_2
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 t_2 = x * ((-2.0 / t) / z);
double tmp;
if (t <= -280000000.0) {
tmp = t_2;
} else if (t <= -1.4e-69) {
tmp = t_1;
} else if (t <= -1.45e-98) {
tmp = x * (-2.0 / (z * t));
} else if (t <= 2.4e-67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((2.0 / y) / z) t_2 = x * ((-2.0 / t) / z) tmp = 0 if t <= -280000000.0: tmp = t_2 elif t <= -1.4e-69: tmp = t_1 elif t <= -1.45e-98: tmp = x * (-2.0 / (z * t)) elif t <= 2.4e-67: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(2.0 / y) / z)) t_2 = Float64(x * Float64(Float64(-2.0 / t) / z)) tmp = 0.0 if (t <= -280000000.0) tmp = t_2; elseif (t <= -1.4e-69) tmp = t_1; elseif (t <= -1.45e-98) tmp = Float64(x * Float64(-2.0 / Float64(z * t))); elseif (t <= 2.4e-67) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((2.0 / y) / z); t_2 = x * ((-2.0 / t) / z); tmp = 0.0; if (t <= -280000000.0) tmp = t_2; elseif (t <= -1.4e-69) tmp = t_1; elseif (t <= -1.45e-98) tmp = x * (-2.0 / (z * t)); elseif (t <= 2.4e-67) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -280000000.0], t$95$2, If[LessEqual[t, -1.4e-69], t$95$1, If[LessEqual[t, -1.45e-98], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-67], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{2}{y}}{z}\\
t_2 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -280000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.8e8 or 2.4e-67 < t Initial program 86.9%
associate-*r/86.9%
distribute-rgt-out--88.9%
associate-/l/89.4%
sub-neg89.4%
+-commutative89.4%
neg-sub089.4%
associate-+l-89.4%
sub0-neg89.4%
neg-mul-189.4%
associate-/r*89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in t around inf 76.2%
if -2.8e8 < t < -1.3999999999999999e-69 or -1.45e-98 < t < 2.4e-67Initial program 91.3%
associate-*r/91.2%
distribute-rgt-out--94.1%
associate-/l/95.3%
sub-neg95.3%
+-commutative95.3%
neg-sub095.3%
associate-+l-95.3%
sub0-neg95.3%
neg-mul-195.3%
associate-/r*95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in t around 0 80.7%
if -1.3999999999999999e-69 < t < -1.45e-98Initial program 99.5%
associate-*r/99.1%
distribute-rgt-out--99.3%
associate-/l/98.8%
sub-neg98.8%
+-commutative98.8%
neg-sub098.8%
associate-+l-98.8%
sub0-neg98.8%
neg-mul-198.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 71.2%
Final simplification77.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (/ -2.0 t) z))))
(if (<= t -280000000.0)
t_1
(if (<= t -2.6e-68)
(* (/ x z) (/ 2.0 y))
(if (<= t -8.5e-98)
(* x (/ -2.0 (* z t)))
(if (<= t 3.2e-61) (* x (/ (/ 2.0 y) z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((-2.0 / t) / z);
double tmp;
if (t <= -280000000.0) {
tmp = t_1;
} else if (t <= -2.6e-68) {
tmp = (x / z) * (2.0 / y);
} else if (t <= -8.5e-98) {
tmp = x * (-2.0 / (z * t));
} else if (t <= 3.2e-61) {
tmp = x * ((2.0 / y) / z);
} 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) :: tmp
t_1 = x * (((-2.0d0) / t) / z)
if (t <= (-280000000.0d0)) then
tmp = t_1
else if (t <= (-2.6d-68)) then
tmp = (x / z) * (2.0d0 / y)
else if (t <= (-8.5d-98)) then
tmp = x * ((-2.0d0) / (z * t))
else if (t <= 3.2d-61) then
tmp = x * ((2.0d0 / y) / z)
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 * ((-2.0 / t) / z);
double tmp;
if (t <= -280000000.0) {
tmp = t_1;
} else if (t <= -2.6e-68) {
tmp = (x / z) * (2.0 / y);
} else if (t <= -8.5e-98) {
tmp = x * (-2.0 / (z * t));
} else if (t <= 3.2e-61) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((-2.0 / t) / z) tmp = 0 if t <= -280000000.0: tmp = t_1 elif t <= -2.6e-68: tmp = (x / z) * (2.0 / y) elif t <= -8.5e-98: tmp = x * (-2.0 / (z * t)) elif t <= 3.2e-61: tmp = x * ((2.0 / y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-2.0 / t) / z)) tmp = 0.0 if (t <= -280000000.0) tmp = t_1; elseif (t <= -2.6e-68) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); elseif (t <= -8.5e-98) tmp = Float64(x * Float64(-2.0 / Float64(z * t))); elseif (t <= 3.2e-61) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((-2.0 / t) / z); tmp = 0.0; if (t <= -280000000.0) tmp = t_1; elseif (t <= -2.6e-68) tmp = (x / z) * (2.0 / y); elseif (t <= -8.5e-98) tmp = x * (-2.0 / (z * t)); elseif (t <= 3.2e-61) tmp = x * ((2.0 / y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -280000000.0], t$95$1, If[LessEqual[t, -2.6e-68], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.5e-98], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-61], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -280000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.8e8 or 3.2000000000000001e-61 < t Initial program 86.9%
associate-*r/86.9%
distribute-rgt-out--88.9%
associate-/l/89.4%
sub-neg89.4%
+-commutative89.4%
neg-sub089.4%
associate-+l-89.4%
sub0-neg89.4%
neg-mul-189.4%
associate-/r*89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in t around inf 76.2%
if -2.8e8 < t < -2.5999999999999998e-68Initial program 82.5%
associate-*r/82.4%
distribute-rgt-out--82.4%
associate-/l/89.7%
sub-neg89.7%
+-commutative89.7%
neg-sub089.7%
associate-+l-89.7%
sub0-neg89.7%
neg-mul-189.7%
associate-/r*89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in t around 0 73.4%
associate-*r/73.4%
times-frac82.6%
Simplified82.6%
if -2.5999999999999998e-68 < t < -8.4999999999999997e-98Initial program 99.5%
associate-*r/99.1%
distribute-rgt-out--99.3%
associate-/l/98.8%
sub-neg98.8%
+-commutative98.8%
neg-sub098.8%
associate-+l-98.8%
sub0-neg98.8%
neg-mul-198.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 71.2%
if -8.4999999999999997e-98 < t < 3.2000000000000001e-61Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--95.6%
associate-/l/96.0%
sub-neg96.0%
+-commutative96.0%
neg-sub096.0%
associate-+l-96.0%
sub0-neg96.0%
neg-mul-196.0%
associate-/r*96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in t around 0 80.8%
Final simplification77.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (/ -2.0 t) z))))
(if (<= t -450000000.0)
t_1
(if (<= t -7e-71)
(* (/ 2.0 z) (/ x y))
(if (<= t -7.6e-98)
(* x (/ -2.0 (* z t)))
(if (<= t 4.6e-59) (* x (/ (/ 2.0 y) z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((-2.0 / t) / z);
double tmp;
if (t <= -450000000.0) {
tmp = t_1;
} else if (t <= -7e-71) {
tmp = (2.0 / z) * (x / y);
} else if (t <= -7.6e-98) {
tmp = x * (-2.0 / (z * t));
} else if (t <= 4.6e-59) {
tmp = x * ((2.0 / y) / z);
} 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) :: tmp
t_1 = x * (((-2.0d0) / t) / z)
if (t <= (-450000000.0d0)) then
tmp = t_1
else if (t <= (-7d-71)) then
tmp = (2.0d0 / z) * (x / y)
else if (t <= (-7.6d-98)) then
tmp = x * ((-2.0d0) / (z * t))
else if (t <= 4.6d-59) then
tmp = x * ((2.0d0 / y) / z)
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 * ((-2.0 / t) / z);
double tmp;
if (t <= -450000000.0) {
tmp = t_1;
} else if (t <= -7e-71) {
tmp = (2.0 / z) * (x / y);
} else if (t <= -7.6e-98) {
tmp = x * (-2.0 / (z * t));
} else if (t <= 4.6e-59) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((-2.0 / t) / z) tmp = 0 if t <= -450000000.0: tmp = t_1 elif t <= -7e-71: tmp = (2.0 / z) * (x / y) elif t <= -7.6e-98: tmp = x * (-2.0 / (z * t)) elif t <= 4.6e-59: tmp = x * ((2.0 / y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-2.0 / t) / z)) tmp = 0.0 if (t <= -450000000.0) tmp = t_1; elseif (t <= -7e-71) tmp = Float64(Float64(2.0 / z) * Float64(x / y)); elseif (t <= -7.6e-98) tmp = Float64(x * Float64(-2.0 / Float64(z * t))); elseif (t <= 4.6e-59) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((-2.0 / t) / z); tmp = 0.0; if (t <= -450000000.0) tmp = t_1; elseif (t <= -7e-71) tmp = (2.0 / z) * (x / y); elseif (t <= -7.6e-98) tmp = x * (-2.0 / (z * t)); elseif (t <= 4.6e-59) tmp = x * ((2.0 / y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -450000000.0], t$95$1, If[LessEqual[t, -7e-71], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.6e-98], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-59], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -450000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-71}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{elif}\;t \leq -7.6 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-59}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.5e8 or 4.59999999999999959e-59 < t Initial program 86.9%
associate-*r/86.9%
distribute-rgt-out--88.9%
associate-/l/89.4%
sub-neg89.4%
+-commutative89.4%
neg-sub089.4%
associate-+l-89.4%
sub0-neg89.4%
neg-mul-189.4%
associate-/r*89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in t around inf 76.2%
if -4.5e8 < t < -6.9999999999999998e-71Initial program 82.5%
distribute-rgt-out--82.5%
Simplified82.5%
*-commutative82.5%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.6%
if -6.9999999999999998e-71 < t < -7.6000000000000006e-98Initial program 99.5%
associate-*r/99.1%
distribute-rgt-out--99.3%
associate-/l/98.8%
sub-neg98.8%
+-commutative98.8%
neg-sub098.8%
associate-+l-98.8%
sub0-neg98.8%
neg-mul-198.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 71.2%
if -7.6000000000000006e-98 < t < 4.59999999999999959e-59Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--95.6%
associate-/l/96.0%
sub-neg96.0%
+-commutative96.0%
neg-sub096.0%
associate-+l-96.0%
sub0-neg96.0%
neg-mul-196.0%
associate-/r*96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in t around 0 80.8%
Final simplification78.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (/ -2.0 t) z))))
(if (<= t -10200000000.0)
t_1
(if (<= t -1.7e-71)
(* (/ 2.0 z) (/ x y))
(if (<= t -7.6e-98)
(* -2.0 (/ x (* z t)))
(if (<= t 2.8e-70) (* x (/ (/ 2.0 y) z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((-2.0 / t) / z);
double tmp;
if (t <= -10200000000.0) {
tmp = t_1;
} else if (t <= -1.7e-71) {
tmp = (2.0 / z) * (x / y);
} else if (t <= -7.6e-98) {
tmp = -2.0 * (x / (z * t));
} else if (t <= 2.8e-70) {
tmp = x * ((2.0 / y) / z);
} 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) :: tmp
t_1 = x * (((-2.0d0) / t) / z)
if (t <= (-10200000000.0d0)) then
tmp = t_1
else if (t <= (-1.7d-71)) then
tmp = (2.0d0 / z) * (x / y)
else if (t <= (-7.6d-98)) then
tmp = (-2.0d0) * (x / (z * t))
else if (t <= 2.8d-70) then
tmp = x * ((2.0d0 / y) / z)
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 * ((-2.0 / t) / z);
double tmp;
if (t <= -10200000000.0) {
tmp = t_1;
} else if (t <= -1.7e-71) {
tmp = (2.0 / z) * (x / y);
} else if (t <= -7.6e-98) {
tmp = -2.0 * (x / (z * t));
} else if (t <= 2.8e-70) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((-2.0 / t) / z) tmp = 0 if t <= -10200000000.0: tmp = t_1 elif t <= -1.7e-71: tmp = (2.0 / z) * (x / y) elif t <= -7.6e-98: tmp = -2.0 * (x / (z * t)) elif t <= 2.8e-70: tmp = x * ((2.0 / y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-2.0 / t) / z)) tmp = 0.0 if (t <= -10200000000.0) tmp = t_1; elseif (t <= -1.7e-71) tmp = Float64(Float64(2.0 / z) * Float64(x / y)); elseif (t <= -7.6e-98) tmp = Float64(-2.0 * Float64(x / Float64(z * t))); elseif (t <= 2.8e-70) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((-2.0 / t) / z); tmp = 0.0; if (t <= -10200000000.0) tmp = t_1; elseif (t <= -1.7e-71) tmp = (2.0 / z) * (x / y); elseif (t <= -7.6e-98) tmp = -2.0 * (x / (z * t)); elseif (t <= 2.8e-70) tmp = x * ((2.0 / y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -10200000000.0], t$95$1, If[LessEqual[t, -1.7e-71], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.6e-98], N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-70], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{if}\;t \leq -10200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-71}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{elif}\;t \leq -7.6 \cdot 10^{-98}:\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-70}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.02e10 or 2.7999999999999999e-70 < t Initial program 86.9%
associate-*r/86.9%
distribute-rgt-out--88.9%
associate-/l/89.4%
sub-neg89.4%
+-commutative89.4%
neg-sub089.4%
associate-+l-89.4%
sub0-neg89.4%
neg-mul-189.4%
associate-/r*89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in t around inf 76.2%
if -1.02e10 < t < -1.70000000000000002e-71Initial program 82.5%
distribute-rgt-out--82.5%
Simplified82.5%
*-commutative82.5%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.6%
if -1.70000000000000002e-71 < t < -7.6000000000000006e-98Initial program 99.5%
associate-*r/99.1%
distribute-rgt-out--99.3%
associate-/l/98.8%
sub-neg98.8%
+-commutative98.8%
neg-sub098.8%
associate-+l-98.8%
sub0-neg98.8%
neg-mul-198.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 71.6%
*-commutative71.6%
Simplified71.6%
if -7.6000000000000006e-98 < t < 2.7999999999999999e-70Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--95.6%
associate-/l/96.0%
sub-neg96.0%
+-commutative96.0%
neg-sub096.0%
associate-+l-96.0%
sub0-neg96.0%
neg-mul-196.0%
associate-/r*96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in t around 0 80.8%
Final simplification78.3%
(FPCore (x y z t)
:precision binary64
(if (<= t -280000000.0)
(* x (/ (/ -2.0 t) z))
(if (<= t -1.08e-63)
(* (/ 2.0 z) (/ x y))
(if (<= t -1.65e-99)
(* -2.0 (/ x (* z t)))
(if (<= t 2.65e-117) (* x (/ (/ 2.0 y) z)) (* -2.0 (/ (/ x z) t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -280000000.0) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= -1.08e-63) {
tmp = (2.0 / z) * (x / y);
} else if (t <= -1.65e-99) {
tmp = -2.0 * (x / (z * t));
} else if (t <= 2.65e-117) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = -2.0 * ((x / z) / 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 (t <= (-280000000.0d0)) then
tmp = x * (((-2.0d0) / t) / z)
else if (t <= (-1.08d-63)) then
tmp = (2.0d0 / z) * (x / y)
else if (t <= (-1.65d-99)) then
tmp = (-2.0d0) * (x / (z * t))
else if (t <= 2.65d-117) then
tmp = x * ((2.0d0 / y) / z)
else
tmp = (-2.0d0) * ((x / z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -280000000.0) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= -1.08e-63) {
tmp = (2.0 / z) * (x / y);
} else if (t <= -1.65e-99) {
tmp = -2.0 * (x / (z * t));
} else if (t <= 2.65e-117) {
tmp = x * ((2.0 / y) / z);
} else {
tmp = -2.0 * ((x / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -280000000.0: tmp = x * ((-2.0 / t) / z) elif t <= -1.08e-63: tmp = (2.0 / z) * (x / y) elif t <= -1.65e-99: tmp = -2.0 * (x / (z * t)) elif t <= 2.65e-117: tmp = x * ((2.0 / y) / z) else: tmp = -2.0 * ((x / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -280000000.0) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); elseif (t <= -1.08e-63) tmp = Float64(Float64(2.0 / z) * Float64(x / y)); elseif (t <= -1.65e-99) tmp = Float64(-2.0 * Float64(x / Float64(z * t))); elseif (t <= 2.65e-117) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); else tmp = Float64(-2.0 * Float64(Float64(x / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -280000000.0) tmp = x * ((-2.0 / t) / z); elseif (t <= -1.08e-63) tmp = (2.0 / z) * (x / y); elseif (t <= -1.65e-99) tmp = -2.0 * (x / (z * t)); elseif (t <= 2.65e-117) tmp = x * ((2.0 / y) / z); else tmp = -2.0 * ((x / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -280000000.0], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.08e-63], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.65e-99], N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e-117], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -280000000:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{elif}\;t \leq -1.08 \cdot 10^{-63}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-99}:\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-117}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if t < -2.8e8Initial program 92.5%
associate-*r/92.5%
distribute-rgt-out--94.2%
associate-/l/95.4%
sub-neg95.4%
+-commutative95.4%
neg-sub095.4%
associate-+l-95.4%
sub0-neg95.4%
neg-mul-195.4%
associate-/r*95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in t around inf 80.6%
if -2.8e8 < t < -1.07999999999999994e-63Initial program 82.5%
distribute-rgt-out--82.5%
Simplified82.5%
*-commutative82.5%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 90.6%
if -1.07999999999999994e-63 < t < -1.64999999999999993e-99Initial program 99.5%
associate-*r/99.1%
distribute-rgt-out--99.3%
associate-/l/98.8%
sub-neg98.8%
+-commutative98.8%
neg-sub098.8%
associate-+l-98.8%
sub0-neg98.8%
neg-mul-198.8%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 71.6%
*-commutative71.6%
Simplified71.6%
if -1.64999999999999993e-99 < t < 2.64999999999999993e-117Initial program 93.0%
associate-*r/92.9%
distribute-rgt-out--96.4%
associate-/l/96.8%
sub-neg96.8%
+-commutative96.8%
neg-sub096.8%
associate-+l-96.8%
sub0-neg96.8%
neg-mul-196.8%
associate-/r*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in t around 0 82.8%
if 2.64999999999999993e-117 < t Initial program 83.5%
associate-*r/83.4%
distribute-rgt-out--85.6%
associate-/l/85.6%
sub-neg85.6%
+-commutative85.6%
neg-sub085.6%
associate-+l-85.6%
sub0-neg85.6%
neg-mul-185.6%
associate-/r*85.6%
metadata-eval85.6%
Simplified85.6%
Taylor expanded in t around inf 71.2%
*-commutative71.2%
*-commutative71.2%
associate-/r*77.9%
Simplified77.9%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= (* 2.0 x) 2e-19) (* 2.0 (/ (/ x z) (- y t))) (* (/ x (- y t)) (/ 2.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((2.0 * x) <= 2e-19) {
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) :: tmp
if ((2.0d0 * x) <= 2d-19) 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 tmp;
if ((2.0 * x) <= 2e-19) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (x / (y - t)) * (2.0 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (2.0 * x) <= 2e-19: tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (x / (y - t)) * (2.0 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(2.0 * x) <= 2e-19) 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) tmp = 0.0; if ((2.0 * x) <= 2e-19) 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_] := If[LessEqual[N[(2.0 * x), $MachinePrecision], 2e-19], 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}
\mathbf{if}\;2 \cdot x \leq 2 \cdot 10^{-19}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (*.f64 x 2) < 2e-19Initial program 91.4%
associate-*l/91.4%
*-commutative91.4%
distribute-rgt-out--93.6%
associate-/r*95.6%
Simplified95.6%
if 2e-19 < (*.f64 x 2) Initial program 83.9%
distribute-rgt-out--86.6%
Simplified86.6%
*-commutative86.6%
times-frac97.1%
Applied egg-rr97.1%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (if (<= t 4.8e-114) (* 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 (t <= 4.8e-114) {
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 (t <= 4.8d-114) 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 (t <= 4.8e-114) {
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 t <= 4.8e-114: 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 (t <= 4.8e-114) 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 (t <= 4.8e-114) 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[t, 4.8e-114], 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}\;t \leq 4.8 \cdot 10^{-114}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t - y}}{z}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if t < 4.8000000000000002e-114Initial program 92.5%
associate-*r/92.4%
distribute-rgt-out--94.8%
associate-/l/96.0%
sub-neg96.0%
+-commutative96.0%
neg-sub096.0%
associate-+l-96.0%
sub0-neg96.0%
neg-mul-196.0%
associate-/r*96.0%
metadata-eval96.0%
Simplified96.0%
if 4.8000000000000002e-114 < t Initial program 83.5%
associate-*l/83.5%
*-commutative83.5%
distribute-rgt-out--85.7%
associate-/r*93.9%
Simplified93.9%
Final simplification95.2%
(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 89.1%
associate-*l/89.1%
*-commutative89.1%
distribute-rgt-out--91.5%
associate-/r*92.8%
Simplified92.8%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (* x (/ -2.0 (* z t))))
double code(double x, double y, double z, double t) {
return x * (-2.0 / (z * 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 = x * ((-2.0d0) / (z * t))
end function
public static double code(double x, double y, double z, double t) {
return x * (-2.0 / (z * t));
}
def code(x, y, z, t): return x * (-2.0 / (z * t))
function code(x, y, z, t) return Float64(x * Float64(-2.0 / Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x * (-2.0 / (z * t)); end
code[x_, y_, z_, t_] := N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{-2}{z \cdot t}
\end{array}
Initial program 89.1%
associate-*r/89.0%
distribute-rgt-out--91.4%
associate-/l/92.1%
sub-neg92.1%
+-commutative92.1%
neg-sub092.1%
associate-+l-92.1%
sub0-neg92.1%
neg-mul-192.1%
associate-/r*92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in t around inf 55.6%
Final simplification55.6%
(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 89.1%
associate-*r/89.0%
distribute-rgt-out--91.4%
associate-/l/92.1%
sub-neg92.1%
+-commutative92.1%
neg-sub092.1%
associate-+l-92.1%
sub0-neg92.1%
neg-mul-192.1%
associate-/r*92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in t around inf 55.9%
Final simplification55.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 2023230
(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))))