
(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
(let* ((t_1 (- (* y z) (* z t))))
(if (<= t_1 -5e+296)
(* 2.0 (/ (/ x z) (- y t)))
(if (<= t_1 1e+151)
(/ (* 2.0 x) (* z (- y t)))
(/ (/ 2.0 (- y t)) (/ z x))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if (t_1 <= -5e+296) {
tmp = 2.0 * ((x / z) / (y - t));
} else if (t_1 <= 1e+151) {
tmp = (2.0 * x) / (z * (y - t));
} else {
tmp = (2.0 / (y - t)) / (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) :: t_1
real(8) :: tmp
t_1 = (y * z) - (z * t)
if (t_1 <= (-5d+296)) then
tmp = 2.0d0 * ((x / z) / (y - t))
else if (t_1 <= 1d+151) then
tmp = (2.0d0 * x) / (z * (y - t))
else
tmp = (2.0d0 / (y - t)) / (z / x)
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 <= -5e+296) {
tmp = 2.0 * ((x / z) / (y - t));
} else if (t_1 <= 1e+151) {
tmp = (2.0 * x) / (z * (y - t));
} else {
tmp = (2.0 / (y - t)) / (z / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - (z * t) tmp = 0 if t_1 <= -5e+296: tmp = 2.0 * ((x / z) / (y - t)) elif t_1 <= 1e+151: tmp = (2.0 * x) / (z * (y - t)) else: tmp = (2.0 / (y - t)) / (z / x) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - Float64(z * t)) tmp = 0.0 if (t_1 <= -5e+296) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); elseif (t_1 <= 1e+151) tmp = Float64(Float64(2.0 * x) / Float64(z * Float64(y - t))); else tmp = Float64(Float64(2.0 / Float64(y - t)) / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) - (z * t); tmp = 0.0; if (t_1 <= -5e+296) tmp = 2.0 * ((x / z) / (y - t)); elseif (t_1 <= 1e+151) tmp = (2.0 * x) / (z * (y - t)); else tmp = (2.0 / (y - t)) / (z / x); 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, -5e+296], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+151], N[(N[(2.0 * x), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - z \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+296}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t_1 \leq 10^{+151}:\\
\;\;\;\;\frac{2 \cdot x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{y - t}}{\frac{z}{x}}\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -5.0000000000000001e296Initial program 69.5%
associate-*l/69.5%
*-commutative69.5%
distribute-rgt-out--69.5%
associate-/r*100.0%
Simplified100.0%
if -5.0000000000000001e296 < (-.f64 (*.f64 y z) (*.f64 t z)) < 1.00000000000000002e151Initial program 98.7%
distribute-rgt-out--98.7%
Simplified98.7%
if 1.00000000000000002e151 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 78.7%
associate-*l/78.7%
*-commutative78.7%
distribute-rgt-out--84.1%
associate-/r*99.7%
Simplified99.7%
associate-*r/99.8%
associate-*l/99.8%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4e+22) (not (<= z 6.8e+133))) (* 2.0 (/ (/ x z) (- y t))) (* x (/ 2.0 (* z (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e+22) || !(z <= 6.8e+133)) {
tmp = 2.0 * ((x / z) / (y - t));
} 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 ((z <= (-4d+22)) .or. (.not. (z <= 6.8d+133))) then
tmp = 2.0d0 * ((x / z) / (y - t))
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 ((z <= -4e+22) || !(z <= 6.8e+133)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * (2.0 / (z * (y - t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4e+22) or not (z <= 6.8e+133): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = x * (2.0 / (z * (y - t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4e+22) || !(z <= 6.8e+133)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(x * Float64(2.0 / Float64(z * Float64(y - t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4e+22) || ~((z <= 6.8e+133))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = x * (2.0 / (z * (y - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4e+22], N[Not[LessEqual[z, 6.8e+133]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+22} \lor \neg \left(z \leq 6.8 \cdot 10^{+133}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if z < -4e22 or 6.79999999999999975e133 < z Initial program 80.4%
associate-*l/80.4%
*-commutative80.4%
distribute-rgt-out--83.9%
associate-/r*96.6%
Simplified96.6%
if -4e22 < z < 6.79999999999999975e133Initial program 98.0%
associate-*r/97.9%
distribute-rgt-out--98.0%
Simplified98.0%
Final simplification97.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5e+22) (not (<= z 6.8e+133))) (* 2.0 (/ (/ x z) (- y t))) (* x (/ (/ -2.0 (- t y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e+22) || !(z <= 6.8e+133)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * ((-2.0 / (t - y)) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.5d+22)) .or. (.not. (z <= 6.8d+133))) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = x * (((-2.0d0) / (t - y)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e+22) || !(z <= 6.8e+133)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = x * ((-2.0 / (t - y)) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.5e+22) or not (z <= 6.8e+133): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = x * ((-2.0 / (t - y)) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.5e+22) || !(z <= 6.8e+133)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(x * Float64(Float64(-2.0 / Float64(t - y)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.5e+22) || ~((z <= 6.8e+133))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = x * ((-2.0 / (t - y)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.5e+22], N[Not[LessEqual[z, 6.8e+133]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+22} \lor \neg \left(z \leq 6.8 \cdot 10^{+133}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t - y}}{z}\\
\end{array}
\end{array}
if z < -4.4999999999999998e22 or 6.79999999999999975e133 < z Initial program 80.4%
associate-*l/80.4%
*-commutative80.4%
distribute-rgt-out--83.9%
associate-/r*96.6%
Simplified96.6%
if -4.4999999999999998e22 < z < 6.79999999999999975e133Initial program 98.0%
associate-*r/97.9%
distribute-rgt-out--98.0%
associate-/l/98.4%
sub-neg98.4%
+-commutative98.4%
neg-sub098.4%
associate-+l-98.4%
sub0-neg98.4%
neg-mul-198.4%
associate-/r*98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification97.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -6.6e+24)
(* (/ x z) (/ 2.0 (- y t)))
(if (<= z 6.8e+133)
(* x (/ (/ -2.0 (- t y)) z))
(* 2.0 (/ (/ x z) (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e+24) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 6.8e+133) {
tmp = x * ((-2.0 / (t - y)) / z);
} else {
tmp = 2.0 * ((x / z) / (y - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.6d+24)) then
tmp = (x / z) * (2.0d0 / (y - t))
else if (z <= 6.8d+133) then
tmp = x * (((-2.0d0) / (t - y)) / z)
else
tmp = 2.0d0 * ((x / z) / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e+24) {
tmp = (x / z) * (2.0 / (y - t));
} else if (z <= 6.8e+133) {
tmp = x * ((-2.0 / (t - y)) / z);
} else {
tmp = 2.0 * ((x / z) / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.6e+24: tmp = (x / z) * (2.0 / (y - t)) elif z <= 6.8e+133: tmp = x * ((-2.0 / (t - y)) / z) else: tmp = 2.0 * ((x / z) / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.6e+24) tmp = Float64(Float64(x / z) * Float64(2.0 / Float64(y - t))); elseif (z <= 6.8e+133) tmp = Float64(x * Float64(Float64(-2.0 / Float64(t - y)) / z)); else tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.6e+24) tmp = (x / z) * (2.0 / (y - t)); elseif (z <= 6.8e+133) tmp = x * ((-2.0 / (t - y)) / z); else tmp = 2.0 * ((x / z) / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.6e+24], N[(N[(x / z), $MachinePrecision] * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+133], N[(x * N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+24}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y - t}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+133}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t - y}}{z}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if z < -6.5999999999999998e24Initial program 81.4%
distribute-rgt-out--84.9%
times-frac96.7%
Simplified96.7%
if -6.5999999999999998e24 < z < 6.79999999999999975e133Initial program 98.0%
associate-*r/97.9%
distribute-rgt-out--98.0%
associate-/l/98.4%
sub-neg98.4%
+-commutative98.4%
neg-sub098.4%
associate-+l-98.4%
sub0-neg98.4%
neg-mul-198.4%
associate-/r*98.4%
metadata-eval98.4%
Simplified98.4%
if 6.79999999999999975e133 < z Initial program 78.7%
associate-*l/78.7%
*-commutative78.7%
distribute-rgt-out--82.1%
associate-/r*96.5%
Simplified96.5%
Final simplification97.8%
(FPCore (x y z t) :precision binary64 (if (<= (* 2.0 x) 2e-81) (* x (/ (/ -2.0 (- t y)) z)) (/ (* x (/ 2.0 (- y t))) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((2.0 * x) <= 2e-81) {
tmp = x * ((-2.0 / (t - y)) / z);
} else {
tmp = (x * (2.0 / (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 ((2.0d0 * x) <= 2d-81) then
tmp = x * (((-2.0d0) / (t - y)) / z)
else
tmp = (x * (2.0d0 / (y - t))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((2.0 * x) <= 2e-81) {
tmp = x * ((-2.0 / (t - y)) / z);
} else {
tmp = (x * (2.0 / (y - t))) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (2.0 * x) <= 2e-81: tmp = x * ((-2.0 / (t - y)) / z) else: tmp = (x * (2.0 / (y - t))) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(2.0 * x) <= 2e-81) tmp = Float64(x * Float64(Float64(-2.0 / Float64(t - y)) / z)); else tmp = Float64(Float64(x * Float64(2.0 / Float64(y - t))) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((2.0 * x) <= 2e-81) tmp = x * ((-2.0 / (t - y)) / z); else tmp = (x * (2.0 / (y - t))) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(2.0 * x), $MachinePrecision], 2e-81], N[(x * N[(N[(-2.0 / N[(t - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(2.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x \leq 2 \cdot 10^{-81}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t - y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\
\end{array}
\end{array}
if (*.f64 x 2) < 1.9999999999999999e-81Initial program 95.2%
associate-*r/95.1%
distribute-rgt-out--95.7%
associate-/l/96.1%
sub-neg96.1%
+-commutative96.1%
neg-sub096.1%
associate-+l-96.1%
sub0-neg96.1%
neg-mul-196.1%
associate-/r*96.1%
metadata-eval96.1%
Simplified96.1%
if 1.9999999999999999e-81 < (*.f64 x 2) Initial program 82.8%
associate-*l/82.8%
*-commutative82.8%
distribute-rgt-out--85.7%
associate-/r*93.1%
Simplified93.1%
associate-*r/93.1%
associate-*l/93.1%
*-commutative93.1%
associate-*l/98.5%
Applied egg-rr98.5%
Final simplification96.7%
(FPCore (x y z t) :precision binary64 (if (<= t -2.4e+22) (* -2.0 (/ (/ x t) z)) (if (<= t 1.5e-107) (* x (/ 2.0 (* y z))) (* -2.0 (/ x (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.4e+22) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= 1.5e-107) {
tmp = x * (2.0 / (y * z));
} else {
tmp = -2.0 * (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.4d+22)) then
tmp = (-2.0d0) * ((x / t) / z)
else if (t <= 1.5d-107) then
tmp = x * (2.0d0 / (y * z))
else
tmp = (-2.0d0) * (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.4e+22) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= 1.5e-107) {
tmp = x * (2.0 / (y * z));
} else {
tmp = -2.0 * (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.4e+22: tmp = -2.0 * ((x / t) / z) elif t <= 1.5e-107: tmp = x * (2.0 / (y * z)) else: tmp = -2.0 * (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.4e+22) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif (t <= 1.5e-107) tmp = Float64(x * Float64(2.0 / Float64(y * z))); 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 <= -2.4e+22) tmp = -2.0 * ((x / t) / z); elseif (t <= 1.5e-107) tmp = x * (2.0 / (y * z)); else tmp = -2.0 * (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.4e+22], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-107], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+22}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if t < -2.4e22Initial program 83.8%
associate-*l/83.8%
*-commutative83.8%
distribute-rgt-out--87.2%
associate-/r*95.3%
Simplified95.3%
associate-/r*87.2%
associate-*r/87.2%
associate-/l*86.4%
Applied egg-rr86.4%
Taylor expanded in y around 0 72.4%
mul-1-neg72.4%
*-commutative72.4%
associate-/l*76.6%
distribute-neg-frac76.6%
Simplified76.6%
frac-2neg76.6%
metadata-eval76.6%
div-inv76.6%
distribute-neg-frac76.6%
add-sqr-sqrt37.7%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod18.0%
add-sqr-sqrt40.4%
clear-num39.8%
add-sqr-sqrt21.8%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod38.8%
add-sqr-sqrt76.8%
Applied egg-rr76.8%
if -2.4e22 < t < 1.4999999999999999e-107Initial program 96.2%
associate-*r/96.1%
distribute-rgt-out--96.1%
associate-/l/96.1%
sub-neg96.1%
+-commutative96.1%
neg-sub096.1%
associate-+l-96.1%
sub0-neg96.1%
neg-mul-196.1%
associate-/r*96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in t around 0 79.3%
if 1.4999999999999999e-107 < t Initial program 92.1%
associate-*r/91.9%
distribute-rgt-out--93.1%
associate-/l/94.7%
sub-neg94.7%
+-commutative94.7%
neg-sub094.7%
associate-+l-94.7%
sub0-neg94.7%
neg-mul-194.7%
associate-/r*94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 82.4%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (if (<= t -2e+19) (* -2.0 (/ (/ x t) z)) (if (<= t 1.5e-107) (* x (/ 2.0 (* y z))) (* x (/ (/ -2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2e+19) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= 1.5e-107) {
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 (t <= (-2d+19)) then
tmp = (-2.0d0) * ((x / t) / z)
else if (t <= 1.5d-107) 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 (t <= -2e+19) {
tmp = -2.0 * ((x / t) / z);
} else if (t <= 1.5e-107) {
tmp = x * (2.0 / (y * z));
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2e+19: tmp = -2.0 * ((x / t) / z) elif t <= 1.5e-107: 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 (t <= -2e+19) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); elseif (t <= 1.5e-107) 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 (t <= -2e+19) tmp = -2.0 * ((x / t) / z); elseif (t <= 1.5e-107) tmp = x * (2.0 / (y * z)); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2e+19], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-107], 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}\;t \leq -2 \cdot 10^{+19}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if t < -2e19Initial program 83.8%
associate-*l/83.8%
*-commutative83.8%
distribute-rgt-out--87.2%
associate-/r*95.3%
Simplified95.3%
associate-/r*87.2%
associate-*r/87.2%
associate-/l*86.4%
Applied egg-rr86.4%
Taylor expanded in y around 0 72.4%
mul-1-neg72.4%
*-commutative72.4%
associate-/l*76.6%
distribute-neg-frac76.6%
Simplified76.6%
frac-2neg76.6%
metadata-eval76.6%
div-inv76.6%
distribute-neg-frac76.6%
add-sqr-sqrt37.7%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod18.0%
add-sqr-sqrt40.4%
clear-num39.8%
add-sqr-sqrt21.8%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod38.8%
add-sqr-sqrt76.8%
Applied egg-rr76.8%
if -2e19 < t < 1.4999999999999999e-107Initial program 96.2%
associate-*r/96.1%
distribute-rgt-out--96.1%
associate-/l/96.1%
sub-neg96.1%
+-commutative96.1%
neg-sub096.1%
associate-+l-96.1%
sub0-neg96.1%
neg-mul-196.1%
associate-/r*96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in t around 0 79.3%
if 1.4999999999999999e-107 < t Initial program 92.1%
associate-*r/91.9%
distribute-rgt-out--93.1%
associate-/l/94.7%
sub-neg94.7%
+-commutative94.7%
neg-sub094.7%
associate-+l-94.7%
sub0-neg94.7%
neg-mul-194.7%
associate-/r*94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 82.8%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= t -1.4e-9) (/ -2.0 (* t (/ z x))) (if (<= t 1.3e-107) (* x (/ 2.0 (* y z))) (* x (/ (/ -2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-9) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 1.3e-107) {
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 (t <= (-1.4d-9)) then
tmp = (-2.0d0) / (t * (z / x))
else if (t <= 1.3d-107) 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 (t <= -1.4e-9) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 1.3e-107) {
tmp = x * (2.0 / (y * z));
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.4e-9: tmp = -2.0 / (t * (z / x)) elif t <= 1.3e-107: 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 (t <= -1.4e-9) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (t <= 1.3e-107) 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 (t <= -1.4e-9) tmp = -2.0 / (t * (z / x)); elseif (t <= 1.3e-107) tmp = x * (2.0 / (y * z)); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.4e-9], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-107], 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}\;t \leq -1.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if t < -1.39999999999999992e-9Initial program 84.3%
associate-*r/84.2%
distribute-rgt-out--87.5%
associate-/l/88.6%
sub-neg88.6%
+-commutative88.6%
neg-sub088.6%
associate-+l-88.6%
sub0-neg88.6%
neg-mul-188.6%
associate-/r*88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in t around inf 72.0%
clear-num71.7%
un-div-inv71.7%
*-commutative71.7%
Applied egg-rr71.7%
associate-/l*75.9%
associate-/r/76.0%
Applied egg-rr76.0%
if -1.39999999999999992e-9 < t < 1.3e-107Initial program 96.1%
associate-*r/96.0%
distribute-rgt-out--96.0%
associate-/l/96.0%
sub-neg96.0%
+-commutative96.0%
neg-sub096.0%
associate-+l-96.0%
sub0-neg96.0%
neg-mul-196.0%
associate-/r*96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in t around 0 79.9%
if 1.3e-107 < t Initial program 92.1%
associate-*r/91.9%
distribute-rgt-out--93.1%
associate-/l/94.7%
sub-neg94.7%
+-commutative94.7%
neg-sub094.7%
associate-+l-94.7%
sub0-neg94.7%
neg-mul-194.7%
associate-/r*94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 82.8%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= t -5.8e-7) (/ -2.0 (* t (/ z x))) (if (<= t 1.5e-107) (/ (* 2.0 x) (* y z)) (* x (/ (/ -2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-7) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 1.5e-107) {
tmp = (2.0 * x) / (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 (t <= (-5.8d-7)) then
tmp = (-2.0d0) / (t * (z / x))
else if (t <= 1.5d-107) then
tmp = (2.0d0 * x) / (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 (t <= -5.8e-7) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 1.5e-107) {
tmp = (2.0 * x) / (y * z);
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.8e-7: tmp = -2.0 / (t * (z / x)) elif t <= 1.5e-107: tmp = (2.0 * x) / (y * z) else: tmp = x * ((-2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.8e-7) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (t <= 1.5e-107) tmp = Float64(Float64(2.0 * x) / 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 (t <= -5.8e-7) tmp = -2.0 / (t * (z / x)); elseif (t <= 1.5e-107) tmp = (2.0 * x) / (y * z); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.8e-7], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-107], N[(N[(2.0 * x), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-107}:\\
\;\;\;\;\frac{2 \cdot x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if t < -5.7999999999999995e-7Initial program 84.3%
associate-*r/84.2%
distribute-rgt-out--87.5%
associate-/l/88.6%
sub-neg88.6%
+-commutative88.6%
neg-sub088.6%
associate-+l-88.6%
sub0-neg88.6%
neg-mul-188.6%
associate-/r*88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in t around inf 72.0%
clear-num71.7%
un-div-inv71.7%
*-commutative71.7%
Applied egg-rr71.7%
associate-/l*75.9%
associate-/r/76.0%
Applied egg-rr76.0%
if -5.7999999999999995e-7 < t < 1.4999999999999999e-107Initial program 96.1%
distribute-rgt-out--96.1%
Simplified96.1%
Taylor expanded in y around inf 79.9%
if 1.4999999999999999e-107 < t Initial program 92.1%
associate-*r/91.9%
distribute-rgt-out--93.1%
associate-/l/94.7%
sub-neg94.7%
+-commutative94.7%
neg-sub094.7%
associate-+l-94.7%
sub0-neg94.7%
neg-mul-194.7%
associate-/r*94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 82.8%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= t -1.35e-11) (/ (/ (* x -2.0) z) t) (if (<= t 6.5e-108) (/ (* 2.0 x) (* y z)) (* x (/ (/ -2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e-11) {
tmp = ((x * -2.0) / z) / t;
} else if (t <= 6.5e-108) {
tmp = (2.0 * x) / (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 (t <= (-1.35d-11)) then
tmp = ((x * (-2.0d0)) / z) / t
else if (t <= 6.5d-108) then
tmp = (2.0d0 * x) / (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 (t <= -1.35e-11) {
tmp = ((x * -2.0) / z) / t;
} else if (t <= 6.5e-108) {
tmp = (2.0 * x) / (y * z);
} else {
tmp = x * ((-2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.35e-11: tmp = ((x * -2.0) / z) / t elif t <= 6.5e-108: tmp = (2.0 * x) / (y * z) else: tmp = x * ((-2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.35e-11) tmp = Float64(Float64(Float64(x * -2.0) / z) / t); elseif (t <= 6.5e-108) tmp = Float64(Float64(2.0 * x) / 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 (t <= -1.35e-11) tmp = ((x * -2.0) / z) / t; elseif (t <= 6.5e-108) tmp = (2.0 * x) / (y * z); else tmp = x * ((-2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.35e-11], N[(N[(N[(x * -2.0), $MachinePrecision] / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 6.5e-108], N[(N[(2.0 * x), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{z}}{t}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{2 \cdot x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\end{array}
\end{array}
if t < -1.35000000000000002e-11Initial program 84.3%
associate-*l/84.3%
*-commutative84.3%
distribute-rgt-out--87.6%
associate-/r*93.9%
Simplified93.9%
associate-/r*87.6%
associate-*r/87.6%
associate-/l*86.8%
Applied egg-rr86.8%
Taylor expanded in y around 0 72.0%
associate-*r/72.0%
*-commutative72.0%
associate-/l/76.9%
Simplified76.9%
if -1.35000000000000002e-11 < t < 6.5000000000000002e-108Initial program 96.1%
distribute-rgt-out--96.1%
Simplified96.1%
Taylor expanded in y around inf 79.9%
if 6.5000000000000002e-108 < t Initial program 92.1%
associate-*r/91.9%
distribute-rgt-out--93.1%
associate-/l/94.7%
sub-neg94.7%
+-commutative94.7%
neg-sub094.7%
associate-+l-94.7%
sub0-neg94.7%
neg-mul-194.7%
associate-/r*94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 82.8%
Final simplification80.1%
(FPCore (x y z t) :precision binary64 (if (<= z -4e-30) (* -2.0 (/ (/ x t) z)) (* -2.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e-30) {
tmp = -2.0 * ((x / t) / z);
} else {
tmp = -2.0 * (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-4d-30)) then
tmp = (-2.0d0) * ((x / t) / z)
else
tmp = (-2.0d0) * (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e-30) {
tmp = -2.0 * ((x / t) / z);
} else {
tmp = -2.0 * (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4e-30: tmp = -2.0 * ((x / t) / z) else: tmp = -2.0 * (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4e-30) tmp = Float64(-2.0 * Float64(Float64(x / t) / z)); 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 (z <= -4e-30) tmp = -2.0 * ((x / t) / z); else tmp = -2.0 * (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e-30], N[(-2.0 * N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-30}:\\
\;\;\;\;-2 \cdot \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if z < -4e-30Initial program 84.5%
associate-*l/84.5%
*-commutative84.5%
distribute-rgt-out--87.4%
associate-/r*97.2%
Simplified97.2%
associate-/r*87.4%
associate-*r/87.4%
associate-/l*86.7%
Applied egg-rr86.7%
Taylor expanded in y around 0 59.2%
mul-1-neg59.2%
*-commutative59.2%
associate-/l*69.5%
distribute-neg-frac69.5%
Simplified69.5%
frac-2neg69.5%
metadata-eval69.5%
div-inv69.5%
distribute-neg-frac69.5%
add-sqr-sqrt69.4%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod0.0%
add-sqr-sqrt35.7%
clear-num35.2%
add-sqr-sqrt35.2%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod0.0%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
if -4e-30 < z Initial program 94.5%
associate-*r/94.4%
distribute-rgt-out--95.0%
associate-/l/95.5%
sub-neg95.5%
+-commutative95.5%
neg-sub095.5%
associate-+l-95.5%
sub0-neg95.5%
neg-mul-195.5%
associate-/r*95.5%
metadata-eval95.5%
Simplified95.5%
Taylor expanded in t around inf 57.2%
Final simplification60.6%
(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 91.7%
associate-*l/91.7%
*-commutative91.7%
distribute-rgt-out--92.9%
associate-/r*91.1%
Simplified91.1%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (* -2.0 (/ x (* z t))))
double code(double x, double y, double z, double t) {
return -2.0 * (x / (z * t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (-2.0d0) * (x / (z * t))
end function
public static double code(double x, double y, double z, double t) {
return -2.0 * (x / (z * t));
}
def code(x, y, z, t): return -2.0 * (x / (z * t))
function code(x, y, z, t) return Float64(-2.0 * Float64(x / Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = -2.0 * (x / (z * t)); end
code[x_, y_, z_, t_] := N[(-2.0 * N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-2 \cdot \frac{x}{z \cdot t}
\end{array}
Initial program 91.7%
associate-*r/91.6%
distribute-rgt-out--92.8%
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 57.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 2023192
(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))))