
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * 2.0d0) / ((y * z) - (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
def code(x, y, z, t): return (x * 2.0) / ((y * z) - (t * z))
function code(x, y, z, t) return Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x * 2.0) / ((y * z) - (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x 2.0) (- (* y z) (* z t)))))
(if (<= t_1 -2e-312)
(/ (* x 2.0) (* z (- y t)))
(if (<= t_1 1e-203)
(/ (/ (* 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 = (x * 2.0) / ((y * z) - (z * t));
double tmp;
if (t_1 <= -2e-312) {
tmp = (x * 2.0) / (z * (y - t));
} else if (t_1 <= 1e-203) {
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 = (x * 2.0d0) / ((y * z) - (z * t))
if (t_1 <= (-2d-312)) then
tmp = (x * 2.0d0) / (z * (y - t))
else if (t_1 <= 1d-203) 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 = (x * 2.0) / ((y * z) - (z * t));
double tmp;
if (t_1 <= -2e-312) {
tmp = (x * 2.0) / (z * (y - t));
} else if (t_1 <= 1e-203) {
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 = (x * 2.0) / ((y * z) - (z * t)) tmp = 0 if t_1 <= -2e-312: tmp = (x * 2.0) / (z * (y - t)) elif t_1 <= 1e-203: 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(x * 2.0) / Float64(Float64(y * z) - Float64(z * t))) tmp = 0.0 if (t_1 <= -2e-312) tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); elseif (t_1 <= 1e-203) tmp = Float64(Float64(Float64(x * 2.0) / 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 = (x * 2.0) / ((y * z) - (z * t)); tmp = 0.0; if (t_1 <= -2e-312) tmp = (x * 2.0) / (z * (y - t)); elseif (t_1 <= 1e-203) 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[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-312], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-203], N[(N[(N[(x * 2.0), $MachinePrecision] / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * -2.0), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot 2}{y \cdot z - z \cdot t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-312}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t_1 \leq 10^{-203}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{t - y}}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -2.0000000000019e-312Initial program 96.3%
distribute-rgt-out--98.6%
Simplified98.6%
if -2.0000000000019e-312 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < 1e-203Initial program 77.5%
distribute-rgt-out--77.5%
associate-/r*99.9%
Simplified99.9%
if 1e-203 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 85.7%
associate-*l/85.7%
*-commutative85.7%
distribute-rgt-out--94.6%
associate-/l/96.1%
Simplified96.1%
*-commutative96.1%
associate-/l/94.6%
associate-*l/94.6%
times-frac80.5%
associate-*l/95.9%
Applied egg-rr95.9%
frac-2neg95.9%
metadata-eval95.9%
associate-*r/96.1%
neg-sub096.1%
sub-neg96.1%
+-commutative96.1%
associate--r+96.1%
add-sqr-sqrt42.6%
sqrt-unprod67.0%
sqr-neg67.0%
sqrt-unprod28.1%
add-sqr-sqrt53.9%
neg-sub053.9%
add-sqr-sqrt25.8%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod53.3%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (* x 2.0) -1e-19) (not (<= (* x 2.0) 5e-128))) (* 2.0 (/ (/ x (- y t)) z)) (* x (/ (/ 2.0 z) (- y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * 2.0) <= -1e-19) || !((x * 2.0) <= 5e-128)) {
tmp = 2.0 * ((x / (y - t)) / z);
} else {
tmp = x * ((2.0 / 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 (((x * 2.0d0) <= (-1d-19)) .or. (.not. ((x * 2.0d0) <= 5d-128))) then
tmp = 2.0d0 * ((x / (y - t)) / z)
else
tmp = x * ((2.0d0 / z) / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x * 2.0) <= -1e-19) || !((x * 2.0) <= 5e-128)) {
tmp = 2.0 * ((x / (y - t)) / z);
} else {
tmp = x * ((2.0 / z) / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * 2.0) <= -1e-19) or not ((x * 2.0) <= 5e-128): tmp = 2.0 * ((x / (y - t)) / z) else: tmp = x * ((2.0 / z) / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x * 2.0) <= -1e-19) || !(Float64(x * 2.0) <= 5e-128)) tmp = Float64(2.0 * Float64(Float64(x / Float64(y - t)) / z)); else tmp = Float64(x * Float64(Float64(2.0 / z) / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * 2.0) <= -1e-19) || ~(((x * 2.0) <= 5e-128))) tmp = 2.0 * ((x / (y - t)) / z); else tmp = x * ((2.0 / z) / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x * 2.0), $MachinePrecision], -1e-19], N[Not[LessEqual[N[(x * 2.0), $MachinePrecision], 5e-128]], $MachinePrecision]], N[(2.0 * N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -1 \cdot 10^{-19} \lor \neg \left(x \cdot 2 \leq 5 \cdot 10^{-128}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{2}{z}}{y - t}\\
\end{array}
\end{array}
if (*.f64 x 2) < -9.9999999999999998e-20 or 5.0000000000000001e-128 < (*.f64 x 2) Initial program 84.5%
associate-*l/84.5%
*-commutative84.5%
distribute-rgt-out--86.8%
associate-/l/97.5%
Simplified97.5%
if -9.9999999999999998e-20 < (*.f64 x 2) < 5.0000000000000001e-128Initial program 90.1%
associate-*l/90.1%
*-commutative90.1%
distribute-rgt-out--95.6%
associate-/l/83.9%
Simplified83.9%
Taylor expanded in x around 0 95.6%
associate-/r*95.6%
associate-*r/95.6%
associate-*r/95.6%
*-commutative95.6%
associate-*r/95.5%
associate-*r/95.4%
Simplified95.4%
Final simplification96.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.4e+68)
(* (/ x z) (/ 2.0 (- y t)))
(if (<= z 1.1e-34)
(* x (/ (/ 2.0 z) (- y t)))
(* 2.0 (/ (/ x (- y t)) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e+68) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 1.1e-34) {
tmp = x * ((2.0 / z) / (y - t));
} else {
tmp = 2.0 * ((x / (y - 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 (z <= (-1.4d+68)) then
tmp = (x / z) * (2.0d0 / (y - t))
else if (z <= 1.1d-34) then
tmp = x * ((2.0d0 / z) / (y - t))
else
tmp = 2.0d0 * ((x / (y - t)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e+68) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 1.1e-34) {
tmp = x * ((2.0 / z) / (y - t));
} else {
tmp = 2.0 * ((x / (y - t)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.4e+68: tmp = (x / z) * (2.0 / (y - t)) elif z <= 1.1e-34: tmp = x * ((2.0 / z) / (y - t)) else: tmp = 2.0 * ((x / (y - t)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.4e+68) tmp = Float64(Float64(x / z) * Float64(2.0 / Float64(y - t))); elseif (z <= 1.1e-34) tmp = Float64(x * Float64(Float64(2.0 / z) / Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / Float64(y - t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.4e+68) tmp = (x / z) * (2.0 / (y - t)); elseif (z <= 1.1e-34) tmp = x * ((2.0 / z) / (y - t)); else tmp = 2.0 * ((x / (y - t)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.4e+68], N[(N[(x / z), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-34], N[(x * N[(N[(2.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+68}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y - t}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-34}:\\
\;\;\;\;x \cdot \frac{\frac{2}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y - t}}{z}\\
\end{array}
\end{array}
if z < -1.4e68Initial program 72.6%
distribute-rgt-out--78.1%
Simplified78.1%
times-frac99.8%
Applied egg-rr99.8%
if -1.4e68 < z < 1.0999999999999999e-34Initial program 93.8%
associate-*l/93.8%
*-commutative93.8%
distribute-rgt-out--95.6%
associate-/l/86.4%
Simplified86.4%
Taylor expanded in x around 0 95.6%
associate-/r*84.2%
associate-*r/84.2%
associate-*r/84.2%
*-commutative84.2%
associate-*r/84.1%
associate-*r/95.4%
Simplified95.4%
if 1.0999999999999999e-34 < z Initial program 85.5%
associate-*l/85.5%
*-commutative85.5%
distribute-rgt-out--89.9%
associate-/l/99.8%
Simplified99.8%
Final simplification97.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.7e+46)
(* (/ x z) (/ 2.0 (- y t)))
(if (<= z 1.1e-34)
(/ (* x 2.0) (* z (- y t)))
(* 2.0 (/ (/ x (- y t)) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+46) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 1.1e-34) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = 2.0 * ((x / (y - 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 (z <= (-2.7d+46)) then
tmp = (x / z) * (2.0d0 / (y - t))
else if (z <= 1.1d-34) then
tmp = (x * 2.0d0) / (z * (y - t))
else
tmp = 2.0d0 * ((x / (y - t)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+46) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 1.1e-34) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = 2.0 * ((x / (y - t)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e+46: tmp = (x / z) * (2.0 / (y - t)) elif z <= 1.1e-34: tmp = (x * 2.0) / (z * (y - t)) else: tmp = 2.0 * ((x / (y - t)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e+46) tmp = Float64(Float64(x / z) * Float64(2.0 / Float64(y - t))); elseif (z <= 1.1e-34) tmp = Float64(Float64(x * 2.0) / Float64(z * Float64(y - t))); else tmp = Float64(2.0 * Float64(Float64(x / Float64(y - t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e+46) tmp = (x / z) * (2.0 / (y - t)); elseif (z <= 1.1e-34) tmp = (x * 2.0) / (z * (y - t)); else tmp = 2.0 * ((x / (y - t)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+46], N[(N[(x / z), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-34], N[(N[(x * 2.0), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+46}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y - t}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-34}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y - t}}{z}\\
\end{array}
\end{array}
if z < -2.7000000000000002e46Initial program 74.4%
distribute-rgt-out--79.6%
Simplified79.6%
times-frac99.7%
Applied egg-rr99.7%
if -2.7000000000000002e46 < z < 1.0999999999999999e-34Initial program 93.6%
distribute-rgt-out--95.4%
Simplified95.4%
if 1.0999999999999999e-34 < z Initial program 85.5%
associate-*l/85.5%
*-commutative85.5%
distribute-rgt-out--89.9%
associate-/l/99.8%
Simplified99.8%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.5e+46)
(* (/ x z) (/ 2.0 (- y t)))
(if (<= z 1.05e-34)
(/ (* x 2.0) (* z (- y t)))
(/ (/ (* x -2.0) (- t y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e+46) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 1.05e-34) {
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) :: tmp
if (z <= (-1.5d+46)) then
tmp = (x / z) * (2.0d0 / (y - t))
else if (z <= 1.05d-34) 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 tmp;
if (z <= -1.5e+46) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 1.05e-34) {
tmp = (x * 2.0) / (z * (y - t));
} else {
tmp = ((x * -2.0) / (t - y)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.5e+46: tmp = (x / z) * (2.0 / (y - t)) elif z <= 1.05e-34: tmp = (x * 2.0) / (z * (y - t)) else: tmp = ((x * -2.0) / (t - y)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e+46) tmp = Float64(Float64(x / z) * Float64(2.0 / Float64(y - t))); elseif (z <= 1.05e-34) 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) tmp = 0.0; if (z <= -1.5e+46) tmp = (x / z) * (2.0 / (y - t)); elseif (z <= 1.05e-34) 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_] := If[LessEqual[z, -1.5e+46], N[(N[(x / z), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-34], 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}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y - t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-34}:\\
\;\;\;\;\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 z < -1.50000000000000012e46Initial program 74.4%
distribute-rgt-out--79.6%
Simplified79.6%
times-frac99.7%
Applied egg-rr99.7%
if -1.50000000000000012e46 < z < 1.05e-34Initial program 93.6%
distribute-rgt-out--95.4%
Simplified95.4%
if 1.05e-34 < z Initial program 85.5%
associate-*l/85.5%
*-commutative85.5%
distribute-rgt-out--89.9%
associate-/l/99.8%
Simplified99.8%
*-commutative99.8%
associate-/l/89.9%
associate-*l/89.9%
times-frac95.1%
associate-*l/99.7%
Applied egg-rr99.7%
frac-2neg99.7%
metadata-eval99.7%
associate-*r/99.8%
neg-sub099.8%
sub-neg99.8%
+-commutative99.8%
associate--r+99.8%
add-sqr-sqrt48.1%
sqrt-unprod78.6%
sqr-neg78.6%
sqrt-unprod34.7%
add-sqr-sqrt64.5%
neg-sub064.5%
add-sqr-sqrt29.8%
sqrt-unprod73.8%
sqr-neg73.8%
sqrt-unprod51.5%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.8e-54) (not (<= y 180000000.0))) (* 2.0 (/ (/ x z) y)) (* (/ x z) (/ -2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.8e-54) || !(y <= 180000000.0)) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = (x / z) * (-2.0 / 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.8d-54)) .or. (.not. (y <= 180000000.0d0))) then
tmp = 2.0d0 * ((x / z) / y)
else
tmp = (x / z) * ((-2.0d0) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.8e-54) || !(y <= 180000000.0)) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = (x / z) * (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.8e-54) or not (y <= 180000000.0): tmp = 2.0 * ((x / z) / y) else: tmp = (x / z) * (-2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.8e-54) || !(y <= 180000000.0)) tmp = Float64(2.0 * Float64(Float64(x / z) / y)); else tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.8e-54) || ~((y <= 180000000.0))) tmp = 2.0 * ((x / z) / y); else tmp = (x / z) * (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.8e-54], N[Not[LessEqual[y, 180000000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-54} \lor \neg \left(y \leq 180000000\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if y < -2.8000000000000002e-54 or 1.8e8 < y Initial program 84.6%
associate-*l/84.6%
*-commutative84.6%
distribute-rgt-out--89.4%
associate-/l/90.9%
Simplified90.9%
Taylor expanded in y around inf 76.9%
*-commutative76.9%
associate-/r*76.3%
Simplified76.3%
if -2.8000000000000002e-54 < y < 1.8e8Initial program 88.9%
distribute-rgt-out--90.7%
Simplified90.7%
times-frac94.6%
Applied egg-rr94.6%
Taylor expanded in y around 0 74.7%
Final simplification75.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -600000000000.0) (not (<= y 45000.0))) (* 2.0 (/ (/ x z) y)) (/ (* -2.0 (/ x t)) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -600000000000.0) || !(y <= 45000.0)) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = (-2.0 * (x / 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 <= (-600000000000.0d0)) .or. (.not. (y <= 45000.0d0))) then
tmp = 2.0d0 * ((x / z) / y)
else
tmp = ((-2.0d0) * (x / t)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -600000000000.0) || !(y <= 45000.0)) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = (-2.0 * (x / t)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -600000000000.0) or not (y <= 45000.0): tmp = 2.0 * ((x / z) / y) else: tmp = (-2.0 * (x / t)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -600000000000.0) || !(y <= 45000.0)) tmp = Float64(2.0 * Float64(Float64(x / z) / y)); else tmp = Float64(Float64(-2.0 * Float64(x / t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -600000000000.0) || ~((y <= 45000.0))) tmp = 2.0 * ((x / z) / y); else tmp = (-2.0 * (x / t)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -600000000000.0], N[Not[LessEqual[y, 45000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -600000000000 \lor \neg \left(y \leq 45000\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2 \cdot \frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -6e11 or 45000 < y Initial program 84.9%
associate-*l/84.9%
*-commutative84.9%
distribute-rgt-out--89.3%
associate-/l/90.2%
Simplified90.2%
Taylor expanded in y around inf 78.8%
*-commutative78.8%
associate-/r*78.2%
Simplified78.2%
if -6e11 < y < 45000Initial program 88.2%
associate-*l/88.2%
*-commutative88.2%
distribute-rgt-out--90.7%
associate-/l/95.3%
Simplified95.3%
*-commutative95.3%
associate-/l/90.7%
associate-*l/90.7%
times-frac93.4%
associate-*l/95.1%
Applied egg-rr95.1%
Taylor expanded in y around 0 76.2%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (<= t -5.5e-33) (* (/ x z) (/ -2.0 t)) (if (<= t 6.5e-13) (* 2.0 (/ (/ x z) y)) (* -2.0 (/ x (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.5e-33) {
tmp = (x / z) * (-2.0 / t);
} else if (t <= 6.5e-13) {
tmp = 2.0 * ((x / z) / y);
} 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 <= (-5.5d-33)) then
tmp = (x / z) * ((-2.0d0) / t)
else if (t <= 6.5d-13) then
tmp = 2.0d0 * ((x / z) / y)
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 <= -5.5e-33) {
tmp = (x / z) * (-2.0 / t);
} else if (t <= 6.5e-13) {
tmp = 2.0 * ((x / z) / y);
} else {
tmp = -2.0 * (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.5e-33: tmp = (x / z) * (-2.0 / t) elif t <= 6.5e-13: tmp = 2.0 * ((x / z) / y) else: tmp = -2.0 * (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.5e-33) tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); elseif (t <= 6.5e-13) tmp = Float64(2.0 * Float64(Float64(x / z) / y)); else tmp = Float64(-2.0 * Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.5e-33) tmp = (x / z) * (-2.0 / t); elseif (t <= 6.5e-13) tmp = 2.0 * ((x / z) / y); else tmp = -2.0 * (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.5e-33], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-13], N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-13}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if t < -5.5e-33Initial program 82.9%
distribute-rgt-out--90.1%
Simplified90.1%
times-frac88.9%
Applied egg-rr88.9%
Taylor expanded in y around 0 71.7%
if -5.5e-33 < t < 6.49999999999999957e-13Initial program 87.6%
associate-*l/87.6%
*-commutative87.6%
distribute-rgt-out--89.2%
associate-/l/93.6%
Simplified93.6%
Taylor expanded in y around inf 74.6%
*-commutative74.6%
associate-/r*79.8%
Simplified79.8%
if 6.49999999999999957e-13 < t Initial program 88.3%
associate-*l/88.3%
*-commutative88.3%
distribute-rgt-out--91.2%
associate-/l/93.1%
Simplified93.1%
Taylor expanded in y around 0 72.2%
*-commutative72.2%
*-commutative72.2%
Simplified72.2%
Final simplification75.7%
(FPCore (x y z t) :precision binary64 (if (<= y -26500000.0) (/ (* 2.0 (/ x y)) z) (if (<= y 680000.0) (/ (* -2.0 (/ x t)) z) (* 2.0 (/ (/ x z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -26500000.0) {
tmp = (2.0 * (x / y)) / z;
} else if (y <= 680000.0) {
tmp = (-2.0 * (x / t)) / z;
} else {
tmp = 2.0 * ((x / z) / 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 <= (-26500000.0d0)) then
tmp = (2.0d0 * (x / y)) / z
else if (y <= 680000.0d0) then
tmp = ((-2.0d0) * (x / t)) / z
else
tmp = 2.0d0 * ((x / z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -26500000.0) {
tmp = (2.0 * (x / y)) / z;
} else if (y <= 680000.0) {
tmp = (-2.0 * (x / t)) / z;
} else {
tmp = 2.0 * ((x / z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -26500000.0: tmp = (2.0 * (x / y)) / z elif y <= 680000.0: tmp = (-2.0 * (x / t)) / z else: tmp = 2.0 * ((x / z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -26500000.0) tmp = Float64(Float64(2.0 * Float64(x / y)) / z); elseif (y <= 680000.0) tmp = Float64(Float64(-2.0 * Float64(x / t)) / z); else tmp = Float64(2.0 * Float64(Float64(x / z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -26500000.0) tmp = (2.0 * (x / y)) / z; elseif (y <= 680000.0) tmp = (-2.0 * (x / t)) / z; else tmp = 2.0 * ((x / z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -26500000.0], N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 680000.0], N[(N[(-2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(2.0 * N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -26500000:\\
\;\;\;\;\frac{2 \cdot \frac{x}{y}}{z}\\
\mathbf{elif}\;y \leq 680000:\\
\;\;\;\;\frac{-2 \cdot \frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y}\\
\end{array}
\end{array}
if y < -2.65e7Initial program 81.7%
associate-*l/81.7%
*-commutative81.7%
distribute-rgt-out--87.7%
associate-/l/93.7%
Simplified93.7%
*-commutative93.7%
associate-/l/87.7%
associate-*l/87.7%
times-frac89.4%
associate-*l/93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 84.8%
if -2.65e7 < y < 6.8e5Initial program 88.2%
associate-*l/88.2%
*-commutative88.2%
distribute-rgt-out--90.7%
associate-/l/95.3%
Simplified95.3%
*-commutative95.3%
associate-/l/90.7%
associate-*l/90.7%
times-frac93.4%
associate-*l/95.1%
Applied egg-rr95.1%
Taylor expanded in y around 0 76.2%
if 6.8e5 < y Initial program 87.8%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-out--90.7%
associate-/l/87.0%
Simplified87.0%
Taylor expanded in y around inf 78.9%
*-commutative78.9%
associate-/r*77.4%
Simplified77.4%
Final simplification78.6%
(FPCore (x y z t) :precision binary64 (if (<= y -15500000000.0) (/ (* 2.0 (/ x y)) z) (if (<= y 2750000.0) (/ (* -2.0 (/ x t)) z) (/ (* x 2.0) (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -15500000000.0) {
tmp = (2.0 * (x / y)) / z;
} else if (y <= 2750000.0) {
tmp = (-2.0 * (x / 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 <= (-15500000000.0d0)) then
tmp = (2.0d0 * (x / y)) / z
else if (y <= 2750000.0d0) then
tmp = ((-2.0d0) * (x / 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 <= -15500000000.0) {
tmp = (2.0 * (x / y)) / z;
} else if (y <= 2750000.0) {
tmp = (-2.0 * (x / t)) / z;
} else {
tmp = (x * 2.0) / (y * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -15500000000.0: tmp = (2.0 * (x / y)) / z elif y <= 2750000.0: tmp = (-2.0 * (x / t)) / z else: tmp = (x * 2.0) / (y * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -15500000000.0) tmp = Float64(Float64(2.0 * Float64(x / y)) / z); elseif (y <= 2750000.0) tmp = Float64(Float64(-2.0 * Float64(x / t)) / z); else tmp = Float64(Float64(x * 2.0) / Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -15500000000.0) tmp = (2.0 * (x / y)) / z; elseif (y <= 2750000.0) tmp = (-2.0 * (x / t)) / z; else tmp = (x * 2.0) / (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -15500000000.0], N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2750000.0], N[(N[(-2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -15500000000:\\
\;\;\;\;\frac{2 \cdot \frac{x}{y}}{z}\\
\mathbf{elif}\;y \leq 2750000:\\
\;\;\;\;\frac{-2 \cdot \frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z}\\
\end{array}
\end{array}
if y < -1.55e10Initial program 81.7%
associate-*l/81.7%
*-commutative81.7%
distribute-rgt-out--87.7%
associate-/l/93.7%
Simplified93.7%
*-commutative93.7%
associate-/l/87.7%
associate-*l/87.7%
times-frac89.4%
associate-*l/93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 84.8%
if -1.55e10 < y < 2.75e6Initial program 88.2%
associate-*l/88.2%
*-commutative88.2%
distribute-rgt-out--90.7%
associate-/l/95.3%
Simplified95.3%
*-commutative95.3%
associate-/l/90.7%
associate-*l/90.7%
times-frac93.4%
associate-*l/95.1%
Applied egg-rr95.1%
Taylor expanded in y around 0 76.2%
if 2.75e6 < y Initial program 87.8%
distribute-rgt-out--90.7%
Simplified90.7%
Taylor expanded in y around inf 78.9%
*-commutative78.9%
Simplified78.9%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (* 2.0 (/ (/ x (- y t)) z)))
double code(double x, double y, double z, double t) {
return 2.0 * ((x / (y - 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 = 2.0d0 * ((x / (y - t)) / z)
end function
public static double code(double x, double y, double z, double t) {
return 2.0 * ((x / (y - t)) / z);
}
def code(x, y, z, t): return 2.0 * ((x / (y - t)) / z)
function code(x, y, z, t) return Float64(2.0 * Float64(Float64(x / Float64(y - t)) / z)) end
function tmp = code(x, y, z, t) tmp = 2.0 * ((x / (y - t)) / z); end
code[x_, y_, z_, t_] := N[(2.0 * N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\frac{x}{y - t}}{z}
\end{array}
Initial program 86.5%
associate-*l/86.5%
*-commutative86.5%
distribute-rgt-out--90.0%
associate-/l/92.7%
Simplified92.7%
Final simplification92.7%
(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 86.5%
associate-*l/86.5%
*-commutative86.5%
distribute-rgt-out--90.0%
associate-/l/92.7%
Simplified92.7%
Taylor expanded in y around inf 54.5%
*-commutative54.5%
associate-/r*57.6%
Simplified57.6%
Final simplification57.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x (* (- y t) z)) 2.0))
(t_2 (/ (* x 2.0) (- (* y z) (* t z)))))
(if (< t_2 -2.559141628295061e-13)
t_1
(if (< t_2 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / ((y - t) * z)) * 2.0d0
t_2 = (x * 2.0d0) / ((y * z) - (t * z))
if (t_2 < (-2.559141628295061d-13)) then
tmp = t_1
else if (t_2 < 1.045027827330126d-269) then
tmp = ((x / z) * 2.0d0) / (y - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / ((y - t) * z)) * 2.0;
double t_2 = (x * 2.0) / ((y * z) - (t * z));
double tmp;
if (t_2 < -2.559141628295061e-13) {
tmp = t_1;
} else if (t_2 < 1.045027827330126e-269) {
tmp = ((x / z) * 2.0) / (y - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / ((y - t) * z)) * 2.0 t_2 = (x * 2.0) / ((y * z) - (t * z)) tmp = 0 if t_2 < -2.559141628295061e-13: tmp = t_1 elif t_2 < 1.045027827330126e-269: tmp = ((x / z) * 2.0) / (y - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(Float64(y - t) * z)) * 2.0) t_2 = Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(t * z))) tmp = 0.0 if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = Float64(Float64(Float64(x / z) * 2.0) / Float64(y - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / ((y - t) * z)) * 2.0; t_2 = (x * 2.0) / ((y * z) - (t * z)); tmp = 0.0; if (t_2 < -2.559141628295061e-13) tmp = t_1; elseif (t_2 < 1.045027827330126e-269) tmp = ((x / z) * 2.0) / (y - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -2.559141628295061e-13], t$95$1, If[Less[t$95$2, 1.045027827330126e-269], N[(N[(N[(x / z), $MachinePrecision] * 2.0), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
t_2 := \frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{if}\;t_2 < -2.559141628295061 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.045027827330126 \cdot 10^{-269}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023301
(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))))