
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y z) (* z t))))
(if (<= t_1 -1e+215)
(* (/ x z) (/ 2.0 (- y t)))
(if (<= t_1 5e+96)
(/ (* x 2.0) (* z (- y t)))
(/ (/ (* x -2.0) (- t y)) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if (t_1 <= -1e+215) {
tmp = (x / z) * (2.0 / (y - t));
} else if (t_1 <= 5e+96) {
tmp = (x * 2.0) / (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) :: t_1
real(8) :: tmp
t_1 = (y * z) - (z * t)
if (t_1 <= (-1d+215)) then
tmp = (x / z) * (2.0d0 / (y - t))
else if (t_1 <= 5d+96) then
tmp = (x * 2.0d0) / (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 t_1 = (y * z) - (z * t);
double tmp;
if (t_1 <= -1e+215) {
tmp = (x / z) * (2.0 / (y - t));
} else if (t_1 <= 5e+96) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = ((x * -2.0) / (t - y)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - (z * t) tmp = 0 if t_1 <= -1e+215: tmp = (x / z) * (2.0 / (y - t)) elif t_1 <= 5e+96: tmp = (x * 2.0) / (z * (y - t)) else: tmp = ((x * -2.0) / (t - y)) / z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - Float64(z * t)) tmp = 0.0 if (t_1 <= -1e+215) tmp = Float64(Float64(x / z) * Float64(2.0 / Float64(y - t))); elseif (t_1 <= 5e+96) tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); else tmp = Float64(Float64(Float64(x * -2.0) / Float64(t - y)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) - (z * t); tmp = 0.0; if (t_1 <= -1e+215) tmp = (x / z) * (2.0 / (y - t)); elseif (t_1 <= 5e+96) tmp = (x * 2.0) / (z * (y - t)); else tmp = ((x * -2.0) / (t - y)) / z; 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[LessEqual[t$95$1, -1e+215], N[(N[(x / z), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+96], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * -2.0), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - z \cdot t\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y - t}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+96}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t - y}}{z}\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -9.99999999999999907e214Initial program 85.9%
distribute-rgt-out--85.9%
times-frac100.0%
Simplified100.0%
if -9.99999999999999907e214 < (-.f64 (*.f64 y z) (*.f64 t z)) < 5.0000000000000004e96Initial program 98.4%
distribute-rgt-out--98.4%
Simplified98.4%
if 5.0000000000000004e96 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 80.6%
associate-*r/80.5%
distribute-rgt-out--89.6%
associate-/l/90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
associate-/r*90.1%
metadata-eval90.1%
Simplified90.1%
associate-*r/99.8%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.1e-115) (not (<= y 126000.0))) (* 2.0 (/ (/ x z) y)) (* x (/ -2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e-115) || !(y <= 126000.0)) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = x * (-2.0 / (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 ((y <= (-2.1d-115)) .or. (.not. (y <= 126000.0d0))) then
tmp = 2.0d0 * ((x / z) / y)
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e-115) || !(y <= 126000.0)) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.1e-115) or not (y <= 126000.0): tmp = 2.0 * ((x / z) / y) else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.1e-115) || !(y <= 126000.0)) tmp = Float64(2.0 * Float64(Float64(x / z) / y)); else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.1e-115) || ~((y <= 126000.0))) tmp = 2.0 * ((x / z) / y); else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.1e-115], N[Not[LessEqual[y, 126000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-115} \lor \neg \left(y \leq 126000\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if y < -2.10000000000000002e-115 or 126000 < y Initial program 90.9%
associate-*l/90.9%
*-commutative90.9%
distribute-rgt-out--94.4%
associate-/r*89.7%
Simplified89.7%
Taylor expanded in x around 0 94.4%
associate-*r/94.4%
*-commutative94.4%
times-frac93.0%
associate-*l/89.6%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in y around inf 77.9%
associate-/l/76.5%
Simplified76.5%
if -2.10000000000000002e-115 < y < 126000Initial program 94.6%
associate-*r/93.9%
distribute-rgt-out--93.9%
associate-/l/94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
neg-mul-194.0%
associate-/r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in t around inf 76.6%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2e-112) (not (<= y 1200.0))) (* x (/ 2.0 (* y z))) (* x (/ -2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-112) || !(y <= 1200.0)) {
tmp = x * (2.0 / (y * z));
} else {
tmp = x * (-2.0 / (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 ((y <= (-2d-112)) .or. (.not. (y <= 1200.0d0))) then
tmp = x * (2.0d0 / (y * z))
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-112) || !(y <= 1200.0)) {
tmp = x * (2.0 / (y * z));
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2e-112) or not (y <= 1200.0): tmp = x * (2.0 / (y * z)) else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2e-112) || !(y <= 1200.0)) tmp = Float64(x * Float64(2.0 / Float64(y * z))); else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2e-112) || ~((y <= 1200.0))) tmp = x * (2.0 / (y * z)); else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2e-112], N[Not[LessEqual[y, 1200.0]], $MachinePrecision]], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-112} \lor \neg \left(y \leq 1200\right):\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.9999999999999999e-112 or 1200 < y Initial program 90.9%
associate-*r/90.7%
distribute-rgt-out--94.2%
associate-/l/94.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
associate-/r*94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in t around 0 77.7%
if -1.9999999999999999e-112 < y < 1200Initial program 94.6%
associate-*r/93.9%
distribute-rgt-out--93.9%
associate-/l/94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
neg-mul-194.0%
associate-/r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in t around inf 76.6%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2e-112) (not (<= y 1550.0))) (* x (/ 2.0 (* y z))) (* x (/ (/ -2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2e-112) || !(y <= 1550.0)) {
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 <= (-2d-112)) .or. (.not. (y <= 1550.0d0))) 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 <= -2e-112) || !(y <= 1550.0)) {
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 <= -2e-112) or not (y <= 1550.0): 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 <= -2e-112) || !(y <= 1550.0)) tmp = Float64(x * Float64(2.0 / Float64(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 <= -2e-112) || ~((y <= 1550.0))) 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, -2e-112], N[Not[LessEqual[y, 1550.0]], $MachinePrecision]], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-112} \lor \neg \left(y \leq 1550\right):\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if y < -1.9999999999999999e-112 or 1550 < y Initial program 90.9%
associate-*r/90.7%
distribute-rgt-out--94.2%
associate-/l/94.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
associate-/r*94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in t around 0 77.7%
if -1.9999999999999999e-112 < y < 1550Initial program 94.6%
associate-*r/93.9%
distribute-rgt-out--93.9%
associate-/l/94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
neg-mul-194.0%
associate-/r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in t around inf 76.6%
associate-/r*76.7%
Simplified76.7%
Final simplification77.3%
(FPCore (x y z t) :precision binary64 (if (<= y -2e-112) (* x (/ 2.0 (* y z))) (if (<= y 1900.0) (* x (/ (/ -2.0 t) z)) (* x (/ (/ 2.0 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-112) {
tmp = x * (2.0 / (y * z));
} else if (y <= 1900.0) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = x * ((2.0 / 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 (y <= (-2d-112)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 1900.0d0) then
tmp = x * (((-2.0d0) / t) / z)
else
tmp = x * ((2.0d0 / y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-112) {
tmp = x * (2.0 / (y * z));
} else if (y <= 1900.0) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = x * ((2.0 / y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e-112: tmp = x * (2.0 / (y * z)) elif y <= 1900.0: tmp = x * ((-2.0 / t) / z) else: tmp = x * ((2.0 / y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e-112) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 1900.0) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); else tmp = Float64(x * Float64(Float64(2.0 / y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2e-112) tmp = x * (2.0 / (y * z)); elseif (y <= 1900.0) tmp = x * ((-2.0 / t) / z); else tmp = x * ((2.0 / y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e-112], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1900.0], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 1900:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\end{array}
\end{array}
if y < -1.9999999999999999e-112Initial program 92.8%
associate-*r/92.7%
distribute-rgt-out--96.3%
associate-/l/96.3%
sub-neg96.3%
+-commutative96.3%
neg-sub096.3%
associate-+l-96.3%
sub0-neg96.3%
neg-mul-196.3%
associate-/r*96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in t around 0 76.8%
if -1.9999999999999999e-112 < y < 1900Initial program 94.6%
associate-*r/93.9%
distribute-rgt-out--93.9%
associate-/l/94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
neg-mul-194.0%
associate-/r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in t around inf 76.6%
associate-/r*76.7%
Simplified76.7%
if 1900 < y Initial program 88.1%
associate-*r/87.9%
distribute-rgt-out--91.3%
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 0 79.6%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (<= y -2e-112) (* x (/ 2.0 (* y z))) (if (<= y 3.45) (* x (/ (/ -2.0 t) z)) (* (/ 2.0 z) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-112) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.45) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = (2.0 / z) * (x / 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 <= (-2d-112)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 3.45d0) then
tmp = x * (((-2.0d0) / t) / z)
else
tmp = (2.0d0 / z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-112) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.45) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = (2.0 / z) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e-112: tmp = x * (2.0 / (y * z)) elif y <= 3.45: tmp = x * ((-2.0 / t) / z) else: tmp = (2.0 / z) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e-112) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 3.45) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); else tmp = Float64(Float64(2.0 / z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2e-112) tmp = x * (2.0 / (y * z)); elseif (y <= 3.45) tmp = x * ((-2.0 / t) / z); else tmp = (2.0 / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e-112], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.45], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 3.45:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -1.9999999999999999e-112Initial program 92.8%
associate-*r/92.7%
distribute-rgt-out--96.3%
associate-/l/96.3%
sub-neg96.3%
+-commutative96.3%
neg-sub096.3%
associate-+l-96.3%
sub0-neg96.3%
neg-mul-196.3%
associate-/r*96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in t around 0 76.8%
if -1.9999999999999999e-112 < y < 3.4500000000000002Initial program 94.6%
associate-*r/93.9%
distribute-rgt-out--93.9%
associate-/l/94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
neg-mul-194.0%
associate-/r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in t around inf 76.6%
associate-/r*76.7%
Simplified76.7%
if 3.4500000000000002 < y Initial program 88.1%
associate-*l/88.1%
*-commutative88.1%
distribute-rgt-out--91.5%
associate-/r*88.5%
Simplified88.5%
Taylor expanded in y around inf 79.2%
associate-*r/79.2%
*-commutative79.2%
Simplified79.2%
times-frac85.5%
Applied egg-rr85.5%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (<= y -9e-113) (* x (/ 2.0 (* y z))) (if (<= y 8.2e-51) (* -2.0 (/ (/ x z) t)) (* (/ 2.0 z) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-113) {
tmp = x * (2.0 / (y * z));
} else if (y <= 8.2e-51) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = (2.0 / z) * (x / 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 <= (-9d-113)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 8.2d-51) then
tmp = (-2.0d0) * ((x / z) / t)
else
tmp = (2.0d0 / z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-113) {
tmp = x * (2.0 / (y * z));
} else if (y <= 8.2e-51) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = (2.0 / z) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-113: tmp = x * (2.0 / (y * z)) elif y <= 8.2e-51: tmp = -2.0 * ((x / z) / t) else: tmp = (2.0 / z) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-113) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 8.2e-51) tmp = Float64(-2.0 * Float64(Float64(x / z) / t)); else tmp = Float64(Float64(2.0 / z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-113) tmp = x * (2.0 / (y * z)); elseif (y <= 8.2e-51) tmp = -2.0 * ((x / z) / t); else tmp = (2.0 / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-113], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-51], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-113}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-51}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -9.0000000000000002e-113Initial program 92.8%
associate-*r/92.7%
distribute-rgt-out--96.3%
associate-/l/96.3%
sub-neg96.3%
+-commutative96.3%
neg-sub096.3%
associate-+l-96.3%
sub0-neg96.3%
neg-mul-196.3%
associate-/r*96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in t around 0 76.8%
if -9.0000000000000002e-113 < y < 8.19999999999999947e-51Initial program 94.5%
associate-*l/94.5%
*-commutative94.5%
distribute-rgt-out--94.5%
associate-/r*95.8%
Simplified95.8%
Taylor expanded in y around 0 81.0%
*-commutative81.0%
*-commutative81.0%
associate-/r*84.9%
Simplified84.9%
if 8.19999999999999947e-51 < y Initial program 90.0%
associate-*l/90.0%
*-commutative90.0%
distribute-rgt-out--92.5%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in y around inf 72.5%
associate-*r/72.5%
*-commutative72.5%
Simplified72.5%
times-frac77.1%
Applied egg-rr77.1%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e-114) (/ (* x 2.0) (* y z)) (if (<= y 1.6e-50) (* -2.0 (/ (/ x z) t)) (* (/ 2.0 z) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-114) {
tmp = (x * 2.0) / (y * z);
} else if (y <= 1.6e-50) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = (2.0 / z) * (x / 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 <= (-7.5d-114)) then
tmp = (x * 2.0d0) / (y * z)
else if (y <= 1.6d-50) then
tmp = (-2.0d0) * ((x / z) / t)
else
tmp = (2.0d0 / z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-114) {
tmp = (x * 2.0) / (y * z);
} else if (y <= 1.6e-50) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = (2.0 / z) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e-114: tmp = (x * 2.0) / (y * z) elif y <= 1.6e-50: tmp = -2.0 * ((x / z) / t) else: tmp = (2.0 / z) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e-114) tmp = Float64(Float64(x * 2.0) / Float64(y * z)); elseif (y <= 1.6e-50) tmp = Float64(-2.0 * Float64(Float64(x / z) / t)); else tmp = Float64(Float64(2.0 / z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e-114) tmp = (x * 2.0) / (y * z); elseif (y <= 1.6e-50) tmp = -2.0 * ((x / z) / t); else tmp = (2.0 / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e-114], N[(N[(x * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-50], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-114}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-50}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -7.5000000000000002e-114Initial program 92.8%
associate-*l/92.8%
*-commutative92.8%
distribute-rgt-out--96.4%
associate-/r*90.6%
Simplified90.6%
Taylor expanded in y around inf 77.0%
associate-*r/77.0%
*-commutative77.0%
Simplified77.0%
if -7.5000000000000002e-114 < y < 1.6e-50Initial program 94.5%
associate-*l/94.5%
*-commutative94.5%
distribute-rgt-out--94.5%
associate-/r*95.8%
Simplified95.8%
Taylor expanded in y around 0 81.0%
*-commutative81.0%
*-commutative81.0%
associate-/r*84.9%
Simplified84.9%
if 1.6e-50 < y Initial program 90.0%
associate-*l/90.0%
*-commutative90.0%
distribute-rgt-out--92.5%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in y around inf 72.5%
associate-*r/72.5%
*-commutative72.5%
Simplified72.5%
times-frac77.1%
Applied egg-rr77.1%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1.7e-112) (/ (* x 2.0) (* y z)) (if (<= y 1.55e-51) (/ (/ (* x -2.0) z) t) (* (/ 2.0 z) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-112) {
tmp = (x * 2.0) / (y * z);
} else if (y <= 1.55e-51) {
tmp = ((x * -2.0) / z) / t;
} else {
tmp = (2.0 / z) * (x / 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.7d-112)) then
tmp = (x * 2.0d0) / (y * z)
else if (y <= 1.55d-51) then
tmp = ((x * (-2.0d0)) / z) / t
else
tmp = (2.0d0 / z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-112) {
tmp = (x * 2.0) / (y * z);
} else if (y <= 1.55e-51) {
tmp = ((x * -2.0) / z) / t;
} else {
tmp = (2.0 / z) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e-112: tmp = (x * 2.0) / (y * z) elif y <= 1.55e-51: tmp = ((x * -2.0) / z) / t else: tmp = (2.0 / z) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-112) tmp = Float64(Float64(x * 2.0) / Float64(y * z)); elseif (y <= 1.55e-51) tmp = Float64(Float64(Float64(x * -2.0) / z) / t); else tmp = Float64(Float64(2.0 / z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.7e-112) tmp = (x * 2.0) / (y * z); elseif (y <= 1.55e-51) tmp = ((x * -2.0) / z) / t; else tmp = (2.0 / z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e-112], N[(N[(x * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-51], N[(N[(N[(x * -2.0), $MachinePrecision] / z), $MachinePrecision] / t), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-112}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-51}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -1.6999999999999999e-112Initial program 92.8%
associate-*l/92.8%
*-commutative92.8%
distribute-rgt-out--96.4%
associate-/r*90.6%
Simplified90.6%
Taylor expanded in y around inf 77.0%
associate-*r/77.0%
*-commutative77.0%
Simplified77.0%
if -1.6999999999999999e-112 < y < 1.5499999999999999e-51Initial program 94.5%
associate-*r/93.5%
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 inf 81.0%
associate-*r/81.0%
metadata-eval81.0%
distribute-rgt-neg-in81.0%
*-commutative81.0%
associate-/r*84.9%
distribute-rgt-neg-in84.9%
metadata-eval84.9%
Applied egg-rr84.9%
if 1.5499999999999999e-51 < y Initial program 90.0%
associate-*l/90.0%
*-commutative90.0%
distribute-rgt-out--92.5%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in y around inf 72.5%
associate-*r/72.5%
*-commutative72.5%
Simplified72.5%
times-frac77.1%
Applied egg-rr77.1%
Final simplification79.9%
(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 92.5%
associate-*l/92.5%
*-commutative92.5%
distribute-rgt-out--94.5%
associate-/r*91.6%
Simplified91.6%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (* x (/ (/ -2.0 (- t y)) z)))
double code(double x, double y, double z, double t) {
return x * ((-2.0 / (t - y)) / 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 - y)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x * ((-2.0 / (t - y)) / z);
}
def code(x, y, z, t): return x * ((-2.0 / (t - y)) / z)
function code(x, y, z, t) return Float64(x * Float64(Float64(-2.0 / Float64(t - y)) / z)) end
function tmp = code(x, y, z, t) tmp = x * ((-2.0 / (t - y)) / z); end
code[x_, y_, z_, t_] := N[(x * N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{-2}{t - y}}{z}
\end{array}
Initial program 92.5%
associate-*r/92.1%
distribute-rgt-out--94.1%
associate-/l/94.2%
sub-neg94.2%
+-commutative94.2%
neg-sub094.2%
associate-+l-94.2%
sub0-neg94.2%
neg-mul-194.2%
associate-/r*94.2%
metadata-eval94.2%
Simplified94.2%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (* x (/ (/ 2.0 z) (- y t))))
double code(double x, double y, double z, double t) {
return x * ((2.0 / 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 = x * ((2.0d0 / z) / (y - t))
end function
public static double code(double x, double y, double z, double t) {
return x * ((2.0 / z) / (y - t));
}
def code(x, y, z, t): return x * ((2.0 / z) / (y - t))
function code(x, y, z, t) return Float64(x * Float64(Float64(2.0 / z) / Float64(y - t))) end
function tmp = code(x, y, z, t) tmp = x * ((2.0 / z) / (y - t)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{2}{z}}{y - t}
\end{array}
Initial program 92.5%
associate-*l/92.5%
*-commutative92.5%
distribute-rgt-out--94.5%
associate-/r*91.6%
Simplified91.6%
Taylor expanded in x around 0 94.5%
associate-*r/94.5%
*-commutative94.5%
times-frac92.3%
associate-*l/91.5%
associate-*r/94.2%
Simplified94.2%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (* z (- y t))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / (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 = (x * 2.0d0) / (z * (y - t))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / (z * (y - t));
}
def code(x, y, z, t): return (x * 2.0) / (z * (y - t))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / (z * (y - t)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{z \cdot \left(y - t\right)}
\end{array}
Initial program 92.5%
distribute-rgt-out--94.5%
Simplified94.5%
Final simplification94.5%
(FPCore (x y z t) :precision binary64 (* 2.0 (/ (/ x z) y)))
double code(double x, double y, double z, double t) {
return 2.0 * ((x / z) / y);
}
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)
end function
public static double code(double x, double y, double z, double t) {
return 2.0 * ((x / z) / y);
}
def code(x, y, z, t): return 2.0 * ((x / z) / y)
function code(x, y, z, t) return Float64(2.0 * Float64(Float64(x / z) / y)) end
function tmp = code(x, y, z, t) tmp = 2.0 * ((x / z) / y); end
code[x_, y_, z_, t_] := N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\frac{x}{z}}{y}
\end{array}
Initial program 92.5%
associate-*l/92.5%
*-commutative92.5%
distribute-rgt-out--94.5%
associate-/r*91.6%
Simplified91.6%
Taylor expanded in x around 0 94.5%
associate-*r/94.5%
*-commutative94.5%
times-frac92.3%
associate-*l/91.5%
associate-*r/94.2%
Simplified94.2%
Taylor expanded in y around inf 57.2%
associate-/l/56.8%
Simplified56.8%
Final simplification56.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
(t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
(if (< t_2 -2.559141628295061e-13)
t_1
(if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / ((y - t) * z)) * 2.0d0
t_2 = (x * 2.0d0) / ((y * z) - (t * z))
if (t_2 < (-2.559141628295061d-13)) then
tmp = t_1
else if (t_2 < 1.045027827330126d-269) then
tmp = ((x / z) * 2.0d0) / (y - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / ((y - t) * z)) * 2.0 t_2 = (x * 2.0) / ((y * z) - (t * z)) tmp = 0 if t_2 < -2.559141628295061e-13: tmp = t_1 elif t_2 < 1.045027827330126e-269: tmp = ((x / z) * 2.0) / (y - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0) t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) tmp = 0.0 if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / ((y - t) * z)) * 2.0; t_2 = (x * 2.0) / ((y * z) - (t * z)); tmp = 0.0; if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = ((x / z) * 2.0) / (y - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023199
(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))))