
(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 15 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-67)
(* (/ x (- y t)) (/ 2.0 z))
(if (<= (* x 2.0) 2e+173)
(* x (/ 2.0 (* z (- y t))))
(* 2.0 (/ (/ x z) (- y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * 2.0) <= -2e-67) {
tmp = (x / (y - t)) * (2.0 / z);
} else if ((x * 2.0) <= 2e+173) {
tmp = x * (2.0 / (z * (y - t)));
} 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 ((x * 2.0d0) <= (-2d-67)) then
tmp = (x / (y - t)) * (2.0d0 / z)
else if ((x * 2.0d0) <= 2d+173) then
tmp = x * (2.0d0 / (z * (y - t)))
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 ((x * 2.0) <= -2e-67) {
tmp = (x / (y - t)) * (2.0 / z);
} else if ((x * 2.0) <= 2e+173) {
tmp = x * (2.0 / (z * (y - t)));
} else {
tmp = 2.0 * ((x / z) / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * 2.0) <= -2e-67: tmp = (x / (y - t)) * (2.0 / z) elif (x * 2.0) <= 2e+173: tmp = x * (2.0 / (z * (y - t))) else: tmp = 2.0 * ((x / z) / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * 2.0) <= -2e-67) tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z)); elseif (Float64(x * 2.0) <= 2e+173) tmp = Float64(x * Float64(2.0 / Float64(z * Float64(y - t)))); 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 ((x * 2.0) <= -2e-67) tmp = (x / (y - t)) * (2.0 / z); elseif ((x * 2.0) <= 2e+173) tmp = x * (2.0 / (z * (y - t))); else tmp = 2.0 * ((x / z) / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], -2e-67], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 2e+173], N[(x * N[(2.0 / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -2 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\mathbf{elif}\;x \cdot 2 \leq 2 \cdot 10^{+173}:\\
\;\;\;\;x \cdot \frac{2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if (*.f64 x 2) < -1.99999999999999989e-67Initial program 84.7%
distribute-rgt-out--88.9%
Simplified88.9%
*-commutative88.9%
times-frac98.6%
Applied egg-rr98.6%
if -1.99999999999999989e-67 < (*.f64 x 2) < 2e173Initial program 99.2%
associate-*r/99.0%
distribute-rgt-out--99.0%
Simplified99.0%
if 2e173 < (*.f64 x 2) Initial program 68.7%
associate-*l/68.7%
*-commutative68.7%
distribute-rgt-out--72.7%
associate-/r*96.4%
Simplified96.4%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* x 2.0) (- (* y z) (* z t))) -1e-279) (/ (* x 2.0) (* 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) / ((y * z) - (z * t))) <= -1e-279) {
tmp = (x * 2.0) / (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) / ((y * z) - (z * t))) <= (-1d-279)) then
tmp = (x * 2.0d0) / (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) / ((y * z) - (z * t))) <= -1e-279) {
tmp = (x * 2.0) / (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) / ((y * z) - (z * t))) <= -1e-279: tmp = (x * 2.0) / (z * (y - t)) else: tmp = (x / (y - t)) * (2.0 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * 2.0) / Float64(Float64(y * z) - Float64(z * t))) <= -1e-279) tmp = Float64(Float64(x * 2.0) / Float64(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) / ((y * z) - (z * t))) <= -1e-279) tmp = (x * 2.0) / (z * (y - t)); else tmp = (x / (y - t)) * (2.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * 2.0), $MachinePrecision] / N[(N[(y * z), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-279], N[(N[(x * 2.0), $MachinePrecision] / N[(z * 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}\;\frac{x \cdot 2}{y \cdot z - z \cdot t} \leq -1 \cdot 10^{-279}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) < -1.00000000000000006e-279Initial program 97.4%
distribute-rgt-out--99.6%
Simplified99.6%
if -1.00000000000000006e-279 < (/.f64 (*.f64 x 2) (-.f64 (*.f64 y z) (*.f64 t z))) Initial program 86.8%
distribute-rgt-out--88.7%
Simplified88.7%
*-commutative88.7%
times-frac96.9%
Applied egg-rr96.9%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= t -3.6e-80)
(* x (/ (/ -2.0 t) z))
(if (<= t 3.1e-259)
t_1
(if (<= t 4.6e-215)
(* x (/ 2.0 (* y z)))
(if (<= t 4.4e-16) t_1 (* x (/ -2.0 (* z t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -3.6e-80) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 3.1e-259) {
tmp = t_1;
} else if (t <= 4.6e-215) {
tmp = x * (2.0 / (y * z));
} else if (t <= 4.4e-16) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / z) * (x / y)
if (t <= (-3.6d-80)) then
tmp = x * (((-2.0d0) / t) / z)
else if (t <= 3.1d-259) then
tmp = t_1
else if (t <= 4.6d-215) then
tmp = x * (2.0d0 / (y * z))
else if (t <= 4.4d-16) then
tmp = t_1
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -3.6e-80) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 3.1e-259) {
tmp = t_1;
} else if (t <= 4.6e-215) {
tmp = x * (2.0 / (y * z));
} else if (t <= 4.4e-16) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) tmp = 0 if t <= -3.6e-80: tmp = x * ((-2.0 / t) / z) elif t <= 3.1e-259: tmp = t_1 elif t <= 4.6e-215: tmp = x * (2.0 / (y * z)) elif t <= 4.4e-16: tmp = t_1 else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / z) * Float64(x / y)) tmp = 0.0 if (t <= -3.6e-80) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); elseif (t <= 3.1e-259) tmp = t_1; elseif (t <= 4.6e-215) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (t <= 4.4e-16) tmp = t_1; else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / z) * (x / y); tmp = 0.0; if (t <= -3.6e-80) tmp = x * ((-2.0 / t) / z); elseif (t <= 3.1e-259) tmp = t_1; elseif (t <= 4.6e-215) tmp = x * (2.0 / (y * z)); elseif (t <= 4.4e-16) tmp = t_1; else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e-80], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e-259], t$95$1, If[LessEqual[t, 4.6e-215], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-16], t$95$1, N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-80}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-259}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-215}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -3.6e-80Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--93.7%
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 75.5%
if -3.6e-80 < t < 3.0999999999999998e-259 or 4.5999999999999998e-215 < t < 4.40000000000000001e-16Initial program 88.6%
associate-*l/88.6%
*-commutative88.6%
distribute-rgt-out--91.6%
associate-/r*94.2%
Simplified94.2%
Taylor expanded in y around inf 75.3%
associate-*r/75.3%
*-commutative75.3%
Simplified75.3%
times-frac81.5%
Applied egg-rr81.5%
if 3.0999999999999998e-259 < t < 4.5999999999999998e-215Initial program 93.1%
associate-*r/93.2%
distribute-rgt-out--93.2%
Simplified93.2%
Taylor expanded in y around inf 93.2%
if 4.40000000000000001e-16 < t Initial program 90.7%
associate-*r/90.8%
distribute-rgt-out--92.4%
Simplified92.4%
Taylor expanded in y around 0 78.6%
Final simplification79.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ 2.0 z) (/ x y))))
(if (<= t -3.5e-80)
(* (/ x z) (/ -2.0 t))
(if (<= t 1.32e-257)
t_1
(if (<= t 3.2e-215)
(* x (/ 2.0 (* y z)))
(if (<= t 3.6e-15) t_1 (* x (/ -2.0 (* z t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -3.5e-80) {
tmp = (x / z) * (-2.0 / t);
} else if (t <= 1.32e-257) {
tmp = t_1;
} else if (t <= 3.2e-215) {
tmp = x * (2.0 / (y * z));
} else if (t <= 3.6e-15) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (2.0d0 / z) * (x / y)
if (t <= (-3.5d-80)) then
tmp = (x / z) * ((-2.0d0) / t)
else if (t <= 1.32d-257) then
tmp = t_1
else if (t <= 3.2d-215) then
tmp = x * (2.0d0 / (y * z))
else if (t <= 3.6d-15) then
tmp = t_1
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 / z) * (x / y);
double tmp;
if (t <= -3.5e-80) {
tmp = (x / z) * (-2.0 / t);
} else if (t <= 1.32e-257) {
tmp = t_1;
} else if (t <= 3.2e-215) {
tmp = x * (2.0 / (y * z));
} else if (t <= 3.6e-15) {
tmp = t_1;
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / z) * (x / y) tmp = 0 if t <= -3.5e-80: tmp = (x / z) * (-2.0 / t) elif t <= 1.32e-257: tmp = t_1 elif t <= 3.2e-215: tmp = x * (2.0 / (y * z)) elif t <= 3.6e-15: tmp = t_1 else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / z) * Float64(x / y)) tmp = 0.0 if (t <= -3.5e-80) tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); elseif (t <= 1.32e-257) tmp = t_1; elseif (t <= 3.2e-215) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (t <= 3.6e-15) tmp = t_1; else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / z) * (x / y); tmp = 0.0; if (t <= -3.5e-80) tmp = (x / z) * (-2.0 / t); elseif (t <= 1.32e-257) tmp = t_1; elseif (t <= 3.2e-215) tmp = x * (2.0 / (y * z)); elseif (t <= 3.6e-15) tmp = t_1; else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e-80], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.32e-257], t$95$1, If[LessEqual[t, 3.2e-215], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e-15], t$95$1, N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-215}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -3.50000000000000015e-80Initial program 92.4%
associate-*l/92.4%
*-commutative92.4%
distribute-rgt-out--93.8%
associate-/r*93.5%
Simplified93.5%
Taylor expanded in y around 0 75.6%
associate-*r/75.6%
*-commutative75.6%
*-commutative75.6%
times-frac79.3%
Simplified79.3%
if -3.50000000000000015e-80 < t < 1.32e-257 or 3.2000000000000001e-215 < t < 3.6000000000000001e-15Initial program 88.6%
associate-*l/88.6%
*-commutative88.6%
distribute-rgt-out--91.6%
associate-/r*94.2%
Simplified94.2%
Taylor expanded in y around inf 75.3%
associate-*r/75.3%
*-commutative75.3%
Simplified75.3%
times-frac81.5%
Applied egg-rr81.5%
if 1.32e-257 < t < 3.2000000000000001e-215Initial program 93.1%
associate-*r/93.2%
distribute-rgt-out--93.2%
Simplified93.2%
Taylor expanded in y around inf 93.2%
if 3.6000000000000001e-15 < t Initial program 90.7%
associate-*r/90.8%
distribute-rgt-out--92.4%
Simplified92.4%
Taylor expanded in y around 0 78.6%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2e+51) (not (<= z 9.2e+118))) (* 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 <= -2e+51) || !(z <= 9.2e+118)) {
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 <= (-2d+51)) .or. (.not. (z <= 9.2d+118))) 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 <= -2e+51) || !(z <= 9.2e+118)) {
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 <= -2e+51) or not (z <= 9.2e+118): 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 <= -2e+51) || !(z <= 9.2e+118)) 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 <= -2e+51) || ~((z <= 9.2e+118))) 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, -2e+51], N[Not[LessEqual[z, 9.2e+118]], $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 -2 \cdot 10^{+51} \lor \neg \left(z \leq 9.2 \cdot 10^{+118}\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 < -2e51 or 9.20000000000000063e118 < z Initial program 83.1%
associate-*l/83.1%
*-commutative83.1%
distribute-rgt-out--85.0%
associate-/r*98.2%
Simplified98.2%
if -2e51 < z < 9.20000000000000063e118Initial program 96.5%
associate-*r/96.2%
distribute-rgt-out--98.3%
Simplified98.3%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (<= (* x 2.0) -1e-74) (* (/ x (- y t)) (/ 2.0 z)) (/ 2.0 (* (- y t) (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x * 2.0) <= -1e-74) {
tmp = (x / (y - t)) * (2.0 / z);
} 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) :: tmp
if ((x * 2.0d0) <= (-1d-74)) then
tmp = (x / (y - t)) * (2.0d0 / z)
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 tmp;
if ((x * 2.0) <= -1e-74) {
tmp = (x / (y - t)) * (2.0 / z);
} else {
tmp = 2.0 / ((y - t) * (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x * 2.0) <= -1e-74: tmp = (x / (y - t)) * (2.0 / z) else: tmp = 2.0 / ((y - t) * (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x * 2.0) <= -1e-74) tmp = Float64(Float64(x / Float64(y - t)) * Float64(2.0 / z)); else tmp = Float64(2.0 / Float64(Float64(y - t) * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x * 2.0) <= -1e-74) tmp = (x / (y - t)) * (2.0 / z); else tmp = 2.0 / ((y - t) * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], -1e-74], N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(2.0 / z), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(y - t), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -1 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{y - t} \cdot \frac{2}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(y - t\right) \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if (*.f64 x 2) < -9.99999999999999958e-75Initial program 85.0%
distribute-rgt-out--89.2%
Simplified89.2%
*-commutative89.2%
times-frac98.6%
Applied egg-rr98.6%
if -9.99999999999999958e-75 < (*.f64 x 2) Initial program 93.9%
associate-*l/93.8%
*-commutative93.8%
distribute-rgt-out--94.5%
associate-/r*95.9%
Simplified95.9%
*-commutative95.9%
associate-*l/95.9%
associate-*r/95.9%
clear-num95.6%
frac-times96.4%
metadata-eval96.4%
Applied egg-rr96.4%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.8e-81) (not (<= t 7.8e-21))) (* x (/ -2.0 (* z t))) (* x (/ 2.0 (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.8e-81) || !(t <= 7.8e-21)) {
tmp = x * (-2.0 / (z * t));
} 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 ((t <= (-3.8d-81)) .or. (.not. (t <= 7.8d-21))) then
tmp = x * ((-2.0d0) / (z * t))
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 ((t <= -3.8e-81) || !(t <= 7.8e-21)) {
tmp = x * (-2.0 / (z * t));
} else {
tmp = x * (2.0 / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.8e-81) or not (t <= 7.8e-21): tmp = x * (-2.0 / (z * t)) else: tmp = x * (2.0 / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.8e-81) || !(t <= 7.8e-21)) tmp = Float64(x * Float64(-2.0 / Float64(z * t))); else tmp = Float64(x * Float64(2.0 / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.8e-81) || ~((t <= 7.8e-21))) tmp = x * (-2.0 / (z * t)); else tmp = x * (2.0 / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.8e-81], N[Not[LessEqual[t, 7.8e-21]], $MachinePrecision]], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-81} \lor \neg \left(t \leq 7.8 \cdot 10^{-21}\right):\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\end{array}
\end{array}
if t < -3.7999999999999999e-81 or 7.8000000000000001e-21 < t Initial program 91.7%
associate-*r/91.6%
distribute-rgt-out--93.1%
Simplified93.1%
Taylor expanded in y around 0 76.9%
if -3.7999999999999999e-81 < t < 7.8000000000000001e-21Initial program 89.2%
associate-*r/88.8%
distribute-rgt-out--91.5%
Simplified91.5%
Taylor expanded in y around inf 77.2%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= t -2.3e-80) (* x (/ (/ -2.0 t) z)) (if (<= t 1.2e-17) (* x (/ 2.0 (* y z))) (* x (/ -2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.3e-80) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 1.2e-17) {
tmp = x * (2.0 / (y * z));
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.3d-80)) then
tmp = x * (((-2.0d0) / t) / z)
else if (t <= 1.2d-17) then
tmp = x * (2.0d0 / (y * z))
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.3e-80) {
tmp = x * ((-2.0 / t) / z);
} else if (t <= 1.2e-17) {
tmp = x * (2.0 / (y * z));
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.3e-80: tmp = x * ((-2.0 / t) / z) elif t <= 1.2e-17: tmp = x * (2.0 / (y * z)) else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.3e-80) tmp = Float64(x * Float64(Float64(-2.0 / t) / z)); elseif (t <= 1.2e-17) tmp = Float64(x * Float64(2.0 / Float64(y * z))); else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.3e-80) tmp = x * ((-2.0 / t) / z); elseif (t <= 1.2e-17) tmp = x * (2.0 / (y * z)); else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.3e-80], N[(x * N[(N[(-2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-17], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-80}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{t}}{z}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -2.2999999999999998e-80Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--93.7%
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 75.5%
if -2.2999999999999998e-80 < t < 1.19999999999999993e-17Initial program 89.2%
associate-*r/88.8%
distribute-rgt-out--91.5%
Simplified91.5%
Taylor expanded in y around inf 77.2%
if 1.19999999999999993e-17 < t Initial program 90.7%
associate-*r/90.8%
distribute-rgt-out--92.4%
Simplified92.4%
Taylor expanded in y around 0 78.6%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (if (<= t -2.3e-80) (* (/ x z) (/ -2.0 t)) (if (<= t 4.4e-42) (* (/ x z) (/ 2.0 y)) (* x (/ -2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.3e-80) {
tmp = (x / z) * (-2.0 / t);
} else if (t <= 4.4e-42) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.3d-80)) then
tmp = (x / z) * ((-2.0d0) / t)
else if (t <= 4.4d-42) then
tmp = (x / z) * (2.0d0 / y)
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.3e-80) {
tmp = (x / z) * (-2.0 / t);
} else if (t <= 4.4e-42) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.3e-80: tmp = (x / z) * (-2.0 / t) elif t <= 4.4e-42: tmp = (x / z) * (2.0 / y) else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.3e-80) tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); elseif (t <= 4.4e-42) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.3e-80) tmp = (x / z) * (-2.0 / t); elseif (t <= 4.4e-42) tmp = (x / z) * (2.0 / y); else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.3e-80], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-42], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-80}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -2.2999999999999998e-80Initial program 92.4%
associate-*l/92.4%
*-commutative92.4%
distribute-rgt-out--93.8%
associate-/r*93.5%
Simplified93.5%
Taylor expanded in y around 0 75.6%
associate-*r/75.6%
*-commutative75.6%
*-commutative75.6%
times-frac79.3%
Simplified79.3%
if -2.2999999999999998e-80 < t < 4.4000000000000001e-42Initial program 88.7%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--91.4%
associate-/r*96.3%
Simplified96.3%
Taylor expanded in y around inf 78.2%
associate-*r/78.2%
*-commutative78.2%
Simplified78.2%
*-commutative78.2%
times-frac85.7%
Applied egg-rr85.7%
if 4.4000000000000001e-42 < t Initial program 91.4%
associate-*r/91.4%
distribute-rgt-out--92.9%
Simplified92.9%
Taylor expanded in y around 0 77.3%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= t -3.6e-80) (/ -2.0 (* t (/ z x))) (if (<= t 4.4e-42) (* (/ x z) (/ 2.0 y)) (* x (/ -2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.6e-80) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.6d-80)) then
tmp = (-2.0d0) / (t * (z / x))
else if (t <= 4.4d-42) then
tmp = (x / z) * (2.0d0 / y)
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.6e-80) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = (x / z) * (2.0 / y);
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.6e-80: tmp = -2.0 / (t * (z / x)) elif t <= 4.4e-42: tmp = (x / z) * (2.0 / y) else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.6e-80) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (t <= 4.4e-42) tmp = Float64(Float64(x / z) * Float64(2.0 / y)); else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.6e-80) tmp = -2.0 / (t * (z / x)); elseif (t <= 4.4e-42) tmp = (x / z) * (2.0 / y); else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.6e-80], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-42], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-80}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -3.6e-80Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--93.7%
Simplified93.7%
Taylor expanded in y around 0 75.5%
associate-*r/75.6%
*-commutative75.6%
frac-times79.3%
clear-num80.5%
frac-times82.7%
metadata-eval82.7%
Applied egg-rr82.7%
if -3.6e-80 < t < 4.4000000000000001e-42Initial program 88.7%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--91.4%
associate-/r*96.3%
Simplified96.3%
Taylor expanded in y around inf 78.2%
associate-*r/78.2%
*-commutative78.2%
Simplified78.2%
*-commutative78.2%
times-frac85.7%
Applied egg-rr85.7%
if 4.4000000000000001e-42 < t Initial program 91.4%
associate-*r/91.4%
distribute-rgt-out--92.9%
Simplified92.9%
Taylor expanded in y around 0 77.3%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (<= t -3.8e-81) (/ -2.0 (* t (/ z x))) (if (<= t 4.4e-42) (/ 2.0 (/ y (/ x z))) (* x (/ -2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.8e-81) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = 2.0 / (y / (x / z));
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.8d-81)) then
tmp = (-2.0d0) / (t * (z / x))
else if (t <= 4.4d-42) then
tmp = 2.0d0 / (y / (x / z))
else
tmp = x * ((-2.0d0) / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.8e-81) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = 2.0 / (y / (x / z));
} else {
tmp = x * (-2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.8e-81: tmp = -2.0 / (t * (z / x)) elif t <= 4.4e-42: tmp = 2.0 / (y / (x / z)) else: tmp = x * (-2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.8e-81) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (t <= 4.4e-42) tmp = Float64(2.0 / Float64(y / Float64(x / z))); else tmp = Float64(x * Float64(-2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.8e-81) tmp = -2.0 / (t * (z / x)); elseif (t <= 4.4e-42) tmp = 2.0 / (y / (x / z)); else tmp = x * (-2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.8e-81], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-42], N[(2.0 / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-81}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-2}{z \cdot t}\\
\end{array}
\end{array}
if t < -3.7999999999999999e-81Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--93.7%
Simplified93.7%
Taylor expanded in y around 0 75.5%
associate-*r/75.6%
*-commutative75.6%
frac-times79.3%
clear-num80.5%
frac-times82.7%
metadata-eval82.7%
Applied egg-rr82.7%
if -3.7999999999999999e-81 < t < 4.4000000000000001e-42Initial program 88.7%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--91.4%
associate-/r*96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/96.3%
associate-*r/96.2%
clear-num95.4%
frac-times95.4%
metadata-eval95.4%
Applied egg-rr95.4%
Taylor expanded in y around inf 78.2%
associate-/l*85.7%
Simplified85.7%
if 4.4000000000000001e-42 < t Initial program 91.4%
associate-*r/91.4%
distribute-rgt-out--92.9%
Simplified92.9%
Taylor expanded in y around 0 77.3%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (<= t -3.1e-80) (/ -2.0 (* t (/ z x))) (if (<= t 4.4e-42) (/ 2.0 (/ y (/ x z))) (/ (/ x (* t -0.5)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.1e-80) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = 2.0 / (y / (x / z));
} else {
tmp = (x / (t * -0.5)) / 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 <= (-3.1d-80)) then
tmp = (-2.0d0) / (t * (z / x))
else if (t <= 4.4d-42) then
tmp = 2.0d0 / (y / (x / z))
else
tmp = (x / (t * (-0.5d0))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.1e-80) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = 2.0 / (y / (x / z));
} else {
tmp = (x / (t * -0.5)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.1e-80: tmp = -2.0 / (t * (z / x)) elif t <= 4.4e-42: tmp = 2.0 / (y / (x / z)) else: tmp = (x / (t * -0.5)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.1e-80) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (t <= 4.4e-42) tmp = Float64(2.0 / Float64(y / Float64(x / z))); else tmp = Float64(Float64(x / Float64(t * -0.5)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.1e-80) tmp = -2.0 / (t * (z / x)); elseif (t <= 4.4e-42) tmp = 2.0 / (y / (x / z)); else tmp = (x / (t * -0.5)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.1e-80], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-42], N[(2.0 / N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(t * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-80}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{2}{\frac{y}{\frac{x}{z}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t \cdot -0.5}}{z}\\
\end{array}
\end{array}
if t < -3.10000000000000016e-80Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--93.7%
Simplified93.7%
Taylor expanded in y around 0 75.5%
associate-*r/75.6%
*-commutative75.6%
frac-times79.3%
clear-num80.5%
frac-times82.7%
metadata-eval82.7%
Applied egg-rr82.7%
if -3.10000000000000016e-80 < t < 4.4000000000000001e-42Initial program 88.7%
associate-*l/88.7%
*-commutative88.7%
distribute-rgt-out--91.4%
associate-/r*96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/96.3%
associate-*r/96.2%
clear-num95.4%
frac-times95.4%
metadata-eval95.4%
Applied egg-rr95.4%
Taylor expanded in y around inf 78.2%
associate-/l*85.7%
Simplified85.7%
if 4.4000000000000001e-42 < t Initial program 91.4%
associate-*r/91.4%
distribute-rgt-out--92.9%
Simplified92.9%
Taylor expanded in y around 0 77.3%
associate-/r*77.2%
associate-*r/78.9%
clear-num78.9%
un-div-inv79.0%
div-inv79.0%
metadata-eval79.0%
Applied egg-rr79.0%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (<= t -1.36e-80) (/ -2.0 (* t (/ z x))) (if (<= t 4.4e-42) (/ (/ x (* z 0.5)) y) (/ (/ x (* t -0.5)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.36e-80) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = (x / (z * 0.5)) / y;
} else {
tmp = (x / (t * -0.5)) / 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.36d-80)) then
tmp = (-2.0d0) / (t * (z / x))
else if (t <= 4.4d-42) then
tmp = (x / (z * 0.5d0)) / y
else
tmp = (x / (t * (-0.5d0))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.36e-80) {
tmp = -2.0 / (t * (z / x));
} else if (t <= 4.4e-42) {
tmp = (x / (z * 0.5)) / y;
} else {
tmp = (x / (t * -0.5)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.36e-80: tmp = -2.0 / (t * (z / x)) elif t <= 4.4e-42: tmp = (x / (z * 0.5)) / y else: tmp = (x / (t * -0.5)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.36e-80) tmp = Float64(-2.0 / Float64(t * Float64(z / x))); elseif (t <= 4.4e-42) tmp = Float64(Float64(x / Float64(z * 0.5)) / y); else tmp = Float64(Float64(x / Float64(t * -0.5)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.36e-80) tmp = -2.0 / (t * (z / x)); elseif (t <= 4.4e-42) tmp = (x / (z * 0.5)) / y; else tmp = (x / (t * -0.5)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.36e-80], N[(-2.0 / N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-42], N[(N[(x / N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / N[(t * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{-80}:\\
\;\;\;\;\frac{-2}{t \cdot \frac{z}{x}}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x}{z \cdot 0.5}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t \cdot -0.5}}{z}\\
\end{array}
\end{array}
if t < -1.3599999999999999e-80Initial program 92.4%
associate-*r/92.3%
distribute-rgt-out--93.7%
Simplified93.7%
Taylor expanded in y around 0 75.5%
associate-*r/75.6%
*-commutative75.6%
frac-times79.3%
clear-num80.5%
frac-times82.7%
metadata-eval82.7%
Applied egg-rr82.7%
if -1.3599999999999999e-80 < t < 4.4000000000000001e-42Initial program 88.7%
associate-*r/88.4%
distribute-rgt-out--91.1%
Simplified91.1%
Taylor expanded in y around inf 77.9%
associate-*r/78.2%
frac-times79.7%
associate-*l/85.7%
clear-num85.7%
un-div-inv85.8%
div-inv85.8%
metadata-eval85.8%
Applied egg-rr85.8%
if 4.4000000000000001e-42 < t Initial program 91.4%
associate-*r/91.4%
distribute-rgt-out--92.9%
Simplified92.9%
Taylor expanded in y around 0 77.3%
associate-/r*77.2%
associate-*r/78.9%
clear-num78.9%
un-div-inv79.0%
div-inv79.0%
metadata-eval79.0%
Applied egg-rr79.0%
Final simplification83.0%
(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 90.5%
associate-*l/90.5%
*-commutative90.5%
distribute-rgt-out--92.5%
associate-/r*94.2%
Simplified94.2%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (* x (/ -2.0 (* z t))))
double code(double x, double y, double z, double t) {
return x * (-2.0 / (z * t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((-2.0d0) / (z * t))
end function
public static double code(double x, double y, double z, double t) {
return x * (-2.0 / (z * t));
}
def code(x, y, z, t): return x * (-2.0 / (z * t))
function code(x, y, z, t) return Float64(x * Float64(-2.0 / Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x * (-2.0 / (z * t)); end
code[x_, y_, z_, t_] := N[(x * N[(-2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{-2}{z \cdot t}
\end{array}
Initial program 90.5%
associate-*r/90.4%
distribute-rgt-out--92.4%
Simplified92.4%
Taylor expanded in y around 0 55.0%
Final simplification55.0%
(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 2023185
(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))))