
(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 13 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 (if (<= (* x 2.0) 2e+82) (* 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 ((x * 2.0) <= 2e+82) {
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 ((x * 2.0d0) <= 2d+82) 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 ((x * 2.0) <= 2e+82) {
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 (x * 2.0) <= 2e+82: 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(x * 2.0) <= 2e+82) 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 ((x * 2.0) <= 2e+82) 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[(x * 2.0), $MachinePrecision], 2e+82], 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}\;x \cdot 2 \leq 2 \cdot 10^{+82}:\\
\;\;\;\;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) < 1.9999999999999999e82Initial program 86.9%
associate-*l/86.9%
*-commutative86.9%
distribute-rgt-out--90.2%
associate-/r*97.0%
Simplified97.0%
if 1.9999999999999999e82 < (*.f64 x 2) Initial program 66.2%
distribute-rgt-out--68.8%
Simplified68.8%
*-commutative68.8%
times-frac97.5%
Applied egg-rr97.5%
Final simplification97.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.4e+35) (not (<= y 5.8e+38))) (* 2.0 (/ x (* z y))) (* x (/ (/ -2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.4e+35) || !(y <= 5.8e+38)) {
tmp = 2.0 * (x / (z * y));
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-6.4d+35)) .or. (.not. (y <= 5.8d+38))) then
tmp = 2.0d0 * (x / (z * y))
else
tmp = x * (((-2.0d0) / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.4e+35) || !(y <= 5.8e+38)) {
tmp = 2.0 * (x / (z * y));
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.4e+35) or not (y <= 5.8e+38): tmp = 2.0 * (x / (z * y)) else: tmp = x * ((-2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.4e+35) || !(y <= 5.8e+38)) tmp = Float64(2.0 * Float64(x / Float64(z * y))); 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 <= -6.4e+35) || ~((y <= 5.8e+38))) tmp = 2.0 * (x / (z * y)); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.4e+35], N[Not[LessEqual[y, 5.8e+38]], $MachinePrecision]], N[(2.0 * N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+35} \lor \neg \left(y \leq 5.8 \cdot 10^{+38}\right):\\
\;\;\;\;2 \cdot \frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if y < -6.39999999999999965e35 or 5.80000000000000013e38 < y Initial program 78.5%
associate-*l/78.5%
*-commutative78.5%
distribute-rgt-out--85.0%
associate-/r*94.6%
Simplified94.6%
Taylor expanded in y around inf 80.0%
if -6.39999999999999965e35 < y < 5.80000000000000013e38Initial program 87.0%
associate-*r/86.9%
distribute-rgt-out--87.7%
associate-/l/88.1%
sub-neg88.1%
+-commutative88.1%
neg-sub088.1%
associate-+l-88.1%
sub0-neg88.1%
neg-mul-188.1%
associate-/r*88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in t around inf 75.7%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.75e+33) (not (<= y 1.1e+39))) (* (/ x z) (/ 2.0 y)) (* x (/ (/ -2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.75e+33) || !(y <= 1.1e+39)) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.75d+33)) .or. (.not. (y <= 1.1d+39))) then
tmp = (x / z) * (2.0d0 / y)
else
tmp = x * (((-2.0d0) / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.75e+33) || !(y <= 1.1e+39)) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.75e+33) or not (y <= 1.1e+39): tmp = (x / z) * (2.0 / y) else: tmp = x * ((-2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.75e+33) || !(y <= 1.1e+39)) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); 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 <= -1.75e+33) || ~((y <= 1.1e+39))) tmp = (x / z) * (2.0 / y); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.75e+33], N[Not[LessEqual[y, 1.1e+39]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+33} \lor \neg \left(y \leq 1.1 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if y < -1.75000000000000005e33 or 1.1000000000000001e39 < y Initial program 78.5%
associate-*r/78.5%
distribute-rgt-out--85.0%
associate-/l/86.5%
sub-neg86.5%
+-commutative86.5%
neg-sub086.5%
associate-+l-86.5%
sub0-neg86.5%
neg-mul-186.5%
associate-/r*86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in t around 0 80.0%
associate-*r/80.0%
times-frac84.8%
Simplified84.8%
if -1.75000000000000005e33 < y < 1.1000000000000001e39Initial program 87.0%
associate-*r/86.9%
distribute-rgt-out--87.7%
associate-/l/88.1%
sub-neg88.1%
+-commutative88.1%
neg-sub088.1%
associate-+l-88.1%
sub0-neg88.1%
neg-mul-188.1%
associate-/r*88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in t around inf 75.7%
Final simplification79.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.5e+35) (not (<= y 2.15e+39))) (* (/ x z) (/ 2.0 y)) (* (/ x z) (/ -2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.5e+35) || !(y <= 2.15e+39)) {
tmp = (x / z) * (2.0 / 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 <= (-5.5d+35)) .or. (.not. (y <= 2.15d+39))) then
tmp = (x / z) * (2.0d0 / 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 <= -5.5e+35) || !(y <= 2.15e+39)) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = (x / z) * (-2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.5e+35) or not (y <= 2.15e+39): tmp = (x / z) * (2.0 / y) else: tmp = (x / z) * (-2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.5e+35) || !(y <= 2.15e+39)) tmp = Float64(Float64(x / z) * Float64(2.0 / 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 <= -5.5e+35) || ~((y <= 2.15e+39))) tmp = (x / z) * (2.0 / y); else tmp = (x / z) * (-2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.5e+35], N[Not[LessEqual[y, 2.15e+39]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+35} \lor \neg \left(y \leq 2.15 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\end{array}
\end{array}
if y < -5.50000000000000001e35 or 2.15e39 < y Initial program 78.5%
associate-*r/78.5%
distribute-rgt-out--85.0%
associate-/l/86.5%
sub-neg86.5%
+-commutative86.5%
neg-sub086.5%
associate-+l-86.5%
sub0-neg86.5%
neg-mul-186.5%
associate-/r*86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in t around 0 80.0%
associate-*r/80.0%
times-frac84.8%
Simplified84.8%
if -5.50000000000000001e35 < y < 2.15e39Initial program 87.0%
distribute-rgt-out--87.8%
times-frac94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv95.2%
Applied egg-rr95.2%
Taylor expanded in y around 0 75.4%
associate-*r/75.4%
*-commutative75.4%
*-commutative75.4%
times-frac80.1%
Simplified80.1%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.7e+38) (not (<= y 5.5e+40))) (* (/ x z) (/ 2.0 y)) (* -2.0 (/ (/ x z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.7e+38) || !(y <= 5.5e+40)) {
tmp = (x / z) * (2.0 / 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 ((y <= (-5.7d+38)) .or. (.not. (y <= 5.5d+40))) then
tmp = (x / z) * (2.0d0 / 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 ((y <= -5.7e+38) || !(y <= 5.5e+40)) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = -2.0 * ((x / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.7e+38) or not (y <= 5.5e+40): tmp = (x / z) * (2.0 / y) else: tmp = -2.0 * ((x / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.7e+38) || !(y <= 5.5e+40)) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); 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 ((y <= -5.7e+38) || ~((y <= 5.5e+40))) tmp = (x / z) * (2.0 / y); else tmp = -2.0 * ((x / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.7e+38], N[Not[LessEqual[y, 5.5e+40]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.7 \cdot 10^{+38} \lor \neg \left(y \leq 5.5 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if y < -5.6999999999999997e38 or 5.49999999999999974e40 < y Initial program 78.5%
associate-*r/78.5%
distribute-rgt-out--85.0%
associate-/l/86.5%
sub-neg86.5%
+-commutative86.5%
neg-sub086.5%
associate-+l-86.5%
sub0-neg86.5%
neg-mul-186.5%
associate-/r*86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in t around 0 80.0%
associate-*r/80.0%
times-frac84.8%
Simplified84.8%
if -5.6999999999999997e38 < y < 5.49999999999999974e40Initial program 87.0%
associate-*r/86.9%
distribute-rgt-out--87.7%
associate-/l/88.1%
sub-neg88.1%
+-commutative88.1%
neg-sub088.1%
associate-+l-88.1%
sub0-neg88.1%
neg-mul-188.1%
associate-/r*88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in t around inf 75.4%
*-commutative75.4%
*-commutative75.4%
associate-/r*80.1%
Simplified80.1%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.75e+34) (* x (/ (/ 2.0 y) z)) (if (<= y 2.3e+39) (* x (/ (/ -2.0 t) z)) (* 2.0 (/ x (* z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.75e+34) {
tmp = x * ((2.0 / y) / z);
} else if (y <= 2.3e+39) {
tmp = x * ((-2.0 / 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 <= (-1.75d+34)) then
tmp = x * ((2.0d0 / y) / z)
else if (y <= 2.3d+39) then
tmp = x * (((-2.0d0) / 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 <= -1.75e+34) {
tmp = x * ((2.0 / y) / z);
} else if (y <= 2.3e+39) {
tmp = x * ((-2.0 / t) / z);
} else {
tmp = 2.0 * (x / (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.75e+34: tmp = x * ((2.0 / y) / z) elif y <= 2.3e+39: tmp = x * ((-2.0 / t) / z) else: tmp = 2.0 * (x / (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.75e+34) tmp = Float64(x * Float64(Float64(2.0 / y) / z)); elseif (y <= 2.3e+39) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); else tmp = Float64(2.0 * Float64(x / Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.75e+34) tmp = x * ((2.0 / y) / z); elseif (y <= 2.3e+39) tmp = x * ((-2.0 / t) / z); else tmp = 2.0 * (x / (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.75e+34], N[(x * N[(N[(2.0 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+39], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y}}{z}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{x}{z \cdot y}\\
\end{array}
\end{array}
if y < -1.74999999999999999e34Initial program 74.6%
associate-*r/74.6%
distribute-rgt-out--82.2%
associate-/l/85.2%
sub-neg85.2%
+-commutative85.2%
neg-sub085.2%
associate-+l-85.2%
sub0-neg85.2%
neg-mul-185.2%
associate-/r*85.2%
metadata-eval85.2%
Simplified85.2%
Taylor expanded in t around 0 79.4%
if -1.74999999999999999e34 < y < 2.30000000000000012e39Initial program 87.0%
associate-*r/86.9%
distribute-rgt-out--87.7%
associate-/l/88.1%
sub-neg88.1%
+-commutative88.1%
neg-sub088.1%
associate-+l-88.1%
sub0-neg88.1%
neg-mul-188.1%
associate-/r*88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in t around inf 75.7%
if 2.30000000000000012e39 < y Initial program 82.4%
associate-*l/82.4%
*-commutative82.4%
distribute-rgt-out--87.9%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in y around inf 81.8%
Final simplification77.8%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e+39) (/ 2.0 (* z (/ y x))) (if (<= y 8.5e+38) (* -2.0 (/ (/ x z) t)) (* (/ x z) (/ 2.0 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+39) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 8.5e+38) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d+39)) then
tmp = 2.0d0 / (z * (y / x))
else if (y <= 8.5d+38) then
tmp = (-2.0d0) * ((x / z) / t)
else
tmp = (x / z) * (2.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+39) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 8.5e+38) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+39: tmp = 2.0 / (z * (y / x)) elif y <= 8.5e+38: tmp = -2.0 * ((x / z) / t) else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e+39) tmp = Float64(2.0 / Float64(z * Float64(y / x))); elseif (y <= 8.5e+38) tmp = Float64(-2.0 * Float64(Float64(x / z) / t)); else tmp = Float64(Float64(x / z) * Float64(2.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e+39) tmp = 2.0 / (z * (y / x)); elseif (y <= 8.5e+38) tmp = -2.0 * ((x / z) / t); else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+39], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+38], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+39}:\\
\;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+38}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -3.5000000000000002e39Initial program 74.6%
distribute-rgt-out--82.2%
times-frac94.4%
Simplified94.4%
clear-num94.4%
frac-times94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 78.3%
associate-/l*83.5%
associate-/r/83.6%
Simplified83.6%
if -3.5000000000000002e39 < y < 8.4999999999999997e38Initial program 87.0%
associate-*r/86.9%
distribute-rgt-out--87.7%
associate-/l/88.1%
sub-neg88.1%
+-commutative88.1%
neg-sub088.1%
associate-+l-88.1%
sub0-neg88.1%
neg-mul-188.1%
associate-/r*88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in t around inf 75.4%
*-commutative75.4%
*-commutative75.4%
associate-/r*80.1%
Simplified80.1%
if 8.4999999999999997e38 < y Initial program 82.4%
associate-*r/82.3%
distribute-rgt-out--87.8%
associate-/l/87.8%
sub-neg87.8%
+-commutative87.8%
neg-sub087.8%
associate-+l-87.8%
sub0-neg87.8%
neg-mul-187.8%
associate-/r*87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in t around 0 81.8%
associate-*r/81.8%
times-frac86.8%
Simplified86.8%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (<= y -2.9e+41) (/ 2.0 (* z (/ y x))) (if (<= y 4e+39) (* -2.0 (/ (/ x z) t)) (/ 2.0 (/ y (/ x z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e+41) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 4e+39) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = 2.0 / (y / (x / 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 <= (-2.9d+41)) then
tmp = 2.0d0 / (z * (y / x))
else if (y <= 4d+39) then
tmp = (-2.0d0) * ((x / z) / t)
else
tmp = 2.0d0 / (y / (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e+41) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 4e+39) {
tmp = -2.0 * ((x / z) / t);
} else {
tmp = 2.0 / (y / (x / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.9e+41: tmp = 2.0 / (z * (y / x)) elif y <= 4e+39: tmp = -2.0 * ((x / z) / t) else: tmp = 2.0 / (y / (x / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.9e+41) tmp = Float64(2.0 / Float64(z * Float64(y / x))); elseif (y <= 4e+39) tmp = Float64(-2.0 * Float64(Float64(x / z) / t)); else tmp = Float64(2.0 / Float64(y / Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.9e+41) tmp = 2.0 / (z * (y / x)); elseif (y <= 4e+39) tmp = -2.0 * ((x / z) / t); else tmp = 2.0 / (y / (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e+41], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+39], N[(-2.0 * N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+39}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\
\end{array}
\end{array}
if y < -2.89999999999999988e41Initial program 74.6%
distribute-rgt-out--82.2%
times-frac94.4%
Simplified94.4%
clear-num94.4%
frac-times94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 78.3%
associate-/l*83.5%
associate-/r/83.6%
Simplified83.6%
if -2.89999999999999988e41 < y < 3.99999999999999976e39Initial program 87.0%
associate-*r/86.9%
distribute-rgt-out--87.7%
associate-/l/88.1%
sub-neg88.1%
+-commutative88.1%
neg-sub088.1%
associate-+l-88.1%
sub0-neg88.1%
neg-mul-188.1%
associate-/r*88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in t around inf 75.4%
*-commutative75.4%
*-commutative75.4%
associate-/r*80.1%
Simplified80.1%
if 3.99999999999999976e39 < y Initial program 82.4%
associate-*l/82.4%
*-commutative82.4%
distribute-rgt-out--87.9%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in y around inf 81.8%
clear-num81.7%
un-div-inv81.7%
associate-/l*86.8%
Applied egg-rr86.8%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (<= y -4.4e+34) (/ 2.0 (* z (/ y x))) (if (<= y 1.25e+39) (/ (/ -2.0 t) (/ z x)) (/ 2.0 (/ y (/ x z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e+34) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 1.25e+39) {
tmp = (-2.0 / t) / (z / x);
} else {
tmp = 2.0 / (y / (x / 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 <= (-4.4d+34)) then
tmp = 2.0d0 / (z * (y / x))
else if (y <= 1.25d+39) then
tmp = ((-2.0d0) / t) / (z / x)
else
tmp = 2.0d0 / (y / (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e+34) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 1.25e+39) {
tmp = (-2.0 / t) / (z / x);
} else {
tmp = 2.0 / (y / (x / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.4e+34: tmp = 2.0 / (z * (y / x)) elif y <= 1.25e+39: tmp = (-2.0 / t) / (z / x) else: tmp = 2.0 / (y / (x / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.4e+34) tmp = Float64(2.0 / Float64(z * Float64(y / x))); elseif (y <= 1.25e+39) tmp = Float64(Float64(-2.0 / t) / Float64(z / x)); else tmp = Float64(2.0 / Float64(y / Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.4e+34) tmp = 2.0 / (z * (y / x)); elseif (y <= 1.25e+39) tmp = (-2.0 / t) / (z / x); else tmp = 2.0 / (y / (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e+34], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+39], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+34}:\\
\;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\
\end{array}
\end{array}
if y < -4.4000000000000005e34Initial program 74.6%
distribute-rgt-out--82.2%
times-frac94.4%
Simplified94.4%
clear-num94.4%
frac-times94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 78.3%
associate-/l*83.5%
associate-/r/83.6%
Simplified83.6%
if -4.4000000000000005e34 < y < 1.25000000000000004e39Initial program 87.0%
distribute-rgt-out--87.8%
times-frac94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv95.2%
Applied egg-rr95.2%
flip--70.0%
associate-/r/70.0%
Applied egg-rr70.0%
Taylor expanded in y around 0 80.9%
if 1.25000000000000004e39 < y Initial program 82.4%
associate-*l/82.4%
*-commutative82.4%
distribute-rgt-out--87.9%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in y around inf 81.8%
clear-num81.7%
un-div-inv81.7%
associate-/l*86.8%
Applied egg-rr86.8%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.9e+34) (/ 2.0 (* z (/ y x))) (if (<= y 8.2e+40) (/ (/ -2.0 t) (/ z x)) (/ (/ 2.0 y) (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e+34) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 8.2e+40) {
tmp = (-2.0 / t) / (z / x);
} else {
tmp = (2.0 / y) / (z / x);
}
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.9d+34)) then
tmp = 2.0d0 / (z * (y / x))
else if (y <= 8.2d+40) then
tmp = ((-2.0d0) / t) / (z / x)
else
tmp = (2.0d0 / y) / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e+34) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 8.2e+40) {
tmp = (-2.0 / t) / (z / x);
} else {
tmp = (2.0 / y) / (z / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.9e+34: tmp = 2.0 / (z * (y / x)) elif y <= 8.2e+40: tmp = (-2.0 / t) / (z / x) else: tmp = (2.0 / y) / (z / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.9e+34) tmp = Float64(2.0 / Float64(z * Float64(y / x))); elseif (y <= 8.2e+40) tmp = Float64(Float64(-2.0 / t) / Float64(z / x)); else tmp = Float64(Float64(2.0 / y) / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.9e+34) tmp = 2.0 / (z * (y / x)); elseif (y <= 8.2e+40) tmp = (-2.0 / t) / (z / x); else tmp = (2.0 / y) / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e+34], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+40], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{y}}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -2.9000000000000001e34Initial program 74.6%
distribute-rgt-out--82.2%
times-frac94.4%
Simplified94.4%
clear-num94.4%
frac-times94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 78.3%
associate-/l*83.5%
associate-/r/83.6%
Simplified83.6%
if -2.9000000000000001e34 < y < 8.2000000000000003e40Initial program 87.0%
distribute-rgt-out--87.8%
times-frac94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv95.2%
Applied egg-rr95.2%
flip--70.0%
associate-/r/70.0%
Applied egg-rr70.0%
Taylor expanded in y around 0 80.9%
if 8.2000000000000003e40 < y Initial program 82.4%
distribute-rgt-out--87.9%
times-frac94.5%
Simplified94.5%
*-commutative94.5%
clear-num94.5%
un-div-inv94.6%
Applied egg-rr94.6%
flip--50.6%
associate-/r/50.7%
Applied egg-rr50.7%
Taylor expanded in y around inf 86.9%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (<= y -6.4e+37) (/ 2.0 (* z (/ y x))) (if (<= y 4.3e+39) (/ (/ -2.0 t) (/ z x)) (/ (/ (* x 2.0) z) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e+37) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 4.3e+39) {
tmp = (-2.0 / t) / (z / x);
} else {
tmp = ((x * 2.0) / 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 <= (-6.4d+37)) then
tmp = 2.0d0 / (z * (y / x))
else if (y <= 4.3d+39) then
tmp = ((-2.0d0) / t) / (z / x)
else
tmp = ((x * 2.0d0) / z) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e+37) {
tmp = 2.0 / (z * (y / x));
} else if (y <= 4.3e+39) {
tmp = (-2.0 / t) / (z / x);
} else {
tmp = ((x * 2.0) / z) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.4e+37: tmp = 2.0 / (z * (y / x)) elif y <= 4.3e+39: tmp = (-2.0 / t) / (z / x) else: tmp = ((x * 2.0) / z) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.4e+37) tmp = Float64(2.0 / Float64(z * Float64(y / x))); elseif (y <= 4.3e+39) tmp = Float64(Float64(-2.0 / t) / Float64(z / x)); else tmp = Float64(Float64(Float64(x * 2.0) / z) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.4e+37) tmp = 2.0 / (z * (y / x)); elseif (y <= 4.3e+39) tmp = (-2.0 / t) / (z / x); else tmp = ((x * 2.0) / z) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.4e+37], N[(2.0 / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e+39], N[(N[(-2.0 / t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+37}:\\
\;\;\;\;\frac{2}{z \cdot \frac{y}{x}}\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{-2}{t}}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{z}}{y}\\
\end{array}
\end{array}
if y < -6.40000000000000027e37Initial program 74.6%
distribute-rgt-out--82.2%
times-frac94.4%
Simplified94.4%
clear-num94.4%
frac-times94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 78.3%
associate-/l*83.5%
associate-/r/83.6%
Simplified83.6%
if -6.40000000000000027e37 < y < 4.3e39Initial program 87.0%
distribute-rgt-out--87.8%
times-frac94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv95.2%
Applied egg-rr95.2%
flip--70.0%
associate-/r/70.0%
Applied egg-rr70.0%
Taylor expanded in y around 0 80.9%
if 4.3e39 < y Initial program 82.4%
distribute-rgt-out--87.9%
times-frac94.5%
Simplified94.5%
clear-num94.5%
frac-times94.5%
metadata-eval94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 81.8%
associate-*r/81.8%
*-commutative81.8%
associate-/l/86.9%
Simplified86.9%
Final simplification82.8%
(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 83.4%
associate-*l/83.4%
*-commutative83.4%
distribute-rgt-out--86.6%
associate-/r*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(x / Float64(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[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{x}{z \cdot y}
\end{array}
Initial program 83.4%
associate-*l/83.4%
*-commutative83.4%
distribute-rgt-out--86.6%
associate-/r*94.5%
Simplified94.5%
Taylor expanded in y around inf 48.8%
Final simplification48.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 2023240
(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))))