
(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 11 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 (or (<= t_1 -1e+263) (not (<= t_1 2e+247)))
(* 2.0 (/ (/ x z) (- y t)))
(/ (* 2.0 x) (* z (- y t))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - (z * t);
double tmp;
if ((t_1 <= -1e+263) || !(t_1 <= 2e+247)) {
tmp = 2.0 * ((x / 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) :: t_1
real(8) :: tmp
t_1 = (y * z) - (z * t)
if ((t_1 <= (-1d+263)) .or. (.not. (t_1 <= 2d+247))) then
tmp = 2.0d0 * ((x / 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 t_1 = (y * z) - (z * t);
double tmp;
if ((t_1 <= -1e+263) || !(t_1 <= 2e+247)) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 * x) / (z * (y - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - (z * t) tmp = 0 if (t_1 <= -1e+263) or not (t_1 <= 2e+247): tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (2.0 * x) / (z * (y - t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - Float64(z * t)) tmp = 0.0 if ((t_1 <= -1e+263) || !(t_1 <= 2e+247)) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(2.0 * x) / Float64(z * Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) - (z * t); tmp = 0.0; if ((t_1 <= -1e+263) || ~((t_1 <= 2e+247))) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (2.0 * x) / (z * (y - t)); 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[Or[LessEqual[t$95$1, -1e+263], N[Not[LessEqual[t$95$1, 2e+247]], $MachinePrecision]], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - z \cdot t\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+263} \lor \neg \left(t_1 \leq 2 \cdot 10^{+247}\right):\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot x}{z \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if (-.f64 (*.f64 y z) (*.f64 t z)) < -1.00000000000000002e263 or 1.9999999999999999e247 < (-.f64 (*.f64 y z) (*.f64 t z)) Initial program 65.3%
*-commutative65.3%
associate-*r/65.3%
distribute-rgt-out--70.7%
associate-/r*99.9%
Simplified99.9%
if -1.00000000000000002e263 < (-.f64 (*.f64 y z) (*.f64 t z)) < 1.9999999999999999e247Initial program 96.5%
distribute-rgt-out--97.6%
Simplified97.6%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (/ -2.0 z) t))) (t_2 (* 2.0 (/ (/ x y) z))))
(if (<= y -1.12e-10)
t_2
(if (<= y -2.5e-66)
t_1
(if (<= y -6.5e-98)
(* x (/ 2.0 (* y z)))
(if (<= y 3.5e-69) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((-2.0 / z) / t);
double t_2 = 2.0 * ((x / y) / z);
double tmp;
if (y <= -1.12e-10) {
tmp = t_2;
} else if (y <= -2.5e-66) {
tmp = t_1;
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.5e-69) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * (((-2.0d0) / z) / t)
t_2 = 2.0d0 * ((x / y) / z)
if (y <= (-1.12d-10)) then
tmp = t_2
else if (y <= (-2.5d-66)) then
tmp = t_1
else if (y <= (-6.5d-98)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 3.5d-69) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((-2.0 / z) / t);
double t_2 = 2.0 * ((x / y) / z);
double tmp;
if (y <= -1.12e-10) {
tmp = t_2;
} else if (y <= -2.5e-66) {
tmp = t_1;
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.5e-69) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((-2.0 / z) / t) t_2 = 2.0 * ((x / y) / z) tmp = 0 if y <= -1.12e-10: tmp = t_2 elif y <= -2.5e-66: tmp = t_1 elif y <= -6.5e-98: tmp = x * (2.0 / (y * z)) elif y <= 3.5e-69: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-2.0 / z) / t)) t_2 = Float64(2.0 * Float64(Float64(x / y) / z)) tmp = 0.0 if (y <= -1.12e-10) tmp = t_2; elseif (y <= -2.5e-66) tmp = t_1; elseif (y <= -6.5e-98) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 3.5e-69) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((-2.0 / z) / t); t_2 = 2.0 * ((x / y) / z); tmp = 0.0; if (y <= -1.12e-10) tmp = t_2; elseif (y <= -2.5e-66) tmp = t_1; elseif (y <= -6.5e-98) tmp = x * (2.0 / (y * z)); elseif (y <= 3.5e-69) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.12e-10], t$95$2, If[LessEqual[y, -2.5e-66], t$95$1, If[LessEqual[y, -6.5e-98], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-69], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{-2}{z}}{t}\\
t_2 := 2 \cdot \frac{\frac{x}{y}}{z}\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.12e-10 or 3.5000000000000001e-69 < y Initial program 87.3%
*-commutative87.3%
associate-*r/87.3%
distribute-rgt-out--90.2%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in y around inf 77.3%
associate-/r*78.8%
Simplified78.8%
if -1.12e-10 < y < -2.49999999999999981e-66 or -6.50000000000000017e-98 < y < 3.5000000000000001e-69Initial program 86.8%
*-commutative86.8%
distribute-rgt-out--88.7%
times-frac92.1%
Simplified92.1%
frac-times88.7%
*-commutative88.7%
times-frac95.2%
clear-num95.1%
frac-times94.7%
metadata-eval94.7%
Applied egg-rr94.7%
Taylor expanded in y around 0 76.3%
associate-*r/76.3%
*-commutative76.3%
*-rgt-identity76.3%
*-commutative76.3%
associate-*r/76.2%
associate-*l*76.2%
associate-/r*76.2%
associate-*r/76.3%
*-commutative76.3%
associate-*l/76.3%
metadata-eval76.3%
Simplified76.3%
if -2.49999999999999981e-66 < y < -6.50000000000000017e-98Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
associate-*r/88.1%
associate-*l/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
Final simplification78.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (/ (/ x y) z))))
(if (<= y -5.1e-11)
t_1
(if (<= y -2.5e-66)
(* x (/ (/ -2.0 z) t))
(if (<= y -6.2e-98)
(* x (/ 2.0 (* y z)))
(if (<= y 1.3e-67) (* (/ -2.0 z) (/ x t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * ((x / y) / z);
double tmp;
if (y <= -5.1e-11) {
tmp = t_1;
} else if (y <= -2.5e-66) {
tmp = x * ((-2.0 / z) / t);
} else if (y <= -6.2e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 1.3e-67) {
tmp = (-2.0 / z) * (x / 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) :: tmp
t_1 = 2.0d0 * ((x / y) / z)
if (y <= (-5.1d-11)) then
tmp = t_1
else if (y <= (-2.5d-66)) then
tmp = x * (((-2.0d0) / z) / t)
else if (y <= (-6.2d-98)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 1.3d-67) then
tmp = ((-2.0d0) / z) * (x / 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 = 2.0 * ((x / y) / z);
double tmp;
if (y <= -5.1e-11) {
tmp = t_1;
} else if (y <= -2.5e-66) {
tmp = x * ((-2.0 / z) / t);
} else if (y <= -6.2e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 1.3e-67) {
tmp = (-2.0 / z) * (x / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * ((x / y) / z) tmp = 0 if y <= -5.1e-11: tmp = t_1 elif y <= -2.5e-66: tmp = x * ((-2.0 / z) / t) elif y <= -6.2e-98: tmp = x * (2.0 / (y * z)) elif y <= 1.3e-67: tmp = (-2.0 / z) * (x / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(Float64(x / y) / z)) tmp = 0.0 if (y <= -5.1e-11) tmp = t_1; elseif (y <= -2.5e-66) tmp = Float64(x * Float64(Float64(-2.0 / z) / t)); elseif (y <= -6.2e-98) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 1.3e-67) tmp = Float64(Float64(-2.0 / z) * Float64(x / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * ((x / y) / z); tmp = 0.0; if (y <= -5.1e-11) tmp = t_1; elseif (y <= -2.5e-66) tmp = x * ((-2.0 / z) / t); elseif (y <= -6.2e-98) tmp = x * (2.0 / (y * z)); elseif (y <= 1.3e-67) tmp = (-2.0 / z) * (x / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.1e-11], t$95$1, If[LessEqual[y, -2.5e-66], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.2e-98], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-67], N[(N[(-2.0 / z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x}{y}}{z}\\
\mathbf{if}\;y \leq -5.1 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-67}:\\
\;\;\;\;\frac{-2}{z} \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.09999999999999984e-11 or 1.2999999999999999e-67 < y Initial program 87.3%
*-commutative87.3%
associate-*r/87.3%
distribute-rgt-out--90.2%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in y around inf 77.3%
associate-/r*78.8%
Simplified78.8%
if -5.09999999999999984e-11 < y < -2.49999999999999981e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
frac-times93.8%
*-commutative93.8%
times-frac93.7%
clear-num93.8%
frac-times94.0%
metadata-eval94.0%
Applied egg-rr94.0%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-rgt-identity70.6%
*-commutative70.6%
associate-*r/70.5%
associate-*l*70.5%
associate-/r*70.5%
associate-*r/70.5%
*-commutative70.5%
associate-*l/70.5%
metadata-eval70.5%
Simplified70.5%
if -2.49999999999999981e-66 < y < -6.2e-98Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
associate-*r/88.1%
associate-*l/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
if -6.2e-98 < y < 1.2999999999999999e-67Initial program 85.6%
*-commutative85.6%
distribute-rgt-out--87.9%
times-frac91.8%
Simplified91.8%
Taylor expanded in y around 0 77.2%
*-commutative77.2%
Simplified77.2%
associate-*l/77.2%
metadata-eval77.2%
distribute-rgt-neg-in77.2%
associate-/r*80.5%
distribute-rgt-neg-in80.5%
metadata-eval80.5%
Applied egg-rr80.5%
associate-/l/77.2%
*-commutative77.2%
times-frac80.5%
Applied egg-rr80.5%
Final simplification79.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (/ (/ x y) z))))
(if (<= y -4e-7)
t_1
(if (<= y -3.3e-66)
(* x (/ (/ -2.0 z) t))
(if (<= y -6.2e-98)
(* x (/ 2.0 (* y z)))
(if (<= y 6e-68) (* (/ x z) (/ -2.0 t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * ((x / y) / z);
double tmp;
if (y <= -4e-7) {
tmp = t_1;
} else if (y <= -3.3e-66) {
tmp = x * ((-2.0 / z) / t);
} else if (y <= -6.2e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 6e-68) {
tmp = (x / z) * (-2.0 / 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) :: tmp
t_1 = 2.0d0 * ((x / y) / z)
if (y <= (-4d-7)) then
tmp = t_1
else if (y <= (-3.3d-66)) then
tmp = x * (((-2.0d0) / z) / t)
else if (y <= (-6.2d-98)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 6d-68) then
tmp = (x / z) * ((-2.0d0) / 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 = 2.0 * ((x / y) / z);
double tmp;
if (y <= -4e-7) {
tmp = t_1;
} else if (y <= -3.3e-66) {
tmp = x * ((-2.0 / z) / t);
} else if (y <= -6.2e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 6e-68) {
tmp = (x / z) * (-2.0 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * ((x / y) / z) tmp = 0 if y <= -4e-7: tmp = t_1 elif y <= -3.3e-66: tmp = x * ((-2.0 / z) / t) elif y <= -6.2e-98: tmp = x * (2.0 / (y * z)) elif y <= 6e-68: tmp = (x / z) * (-2.0 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(Float64(x / y) / z)) tmp = 0.0 if (y <= -4e-7) tmp = t_1; elseif (y <= -3.3e-66) tmp = Float64(x * Float64(Float64(-2.0 / z) / t)); elseif (y <= -6.2e-98) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 6e-68) tmp = Float64(Float64(x / z) * Float64(-2.0 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * ((x / y) / z); tmp = 0.0; if (y <= -4e-7) tmp = t_1; elseif (y <= -3.3e-66) tmp = x * ((-2.0 / z) / t); elseif (y <= -6.2e-98) tmp = x * (2.0 / (y * z)); elseif (y <= 6e-68) tmp = (x / z) * (-2.0 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e-7], t$95$1, If[LessEqual[y, -3.3e-66], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.2e-98], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-68], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\frac{x}{y}}{z}\\
\mathbf{if}\;y \leq -4 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.9999999999999998e-7 or 6e-68 < y Initial program 87.3%
*-commutative87.3%
associate-*r/87.3%
distribute-rgt-out--90.2%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in y around inf 77.3%
associate-/r*78.8%
Simplified78.8%
if -3.9999999999999998e-7 < y < -3.2999999999999999e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
frac-times93.8%
*-commutative93.8%
times-frac93.7%
clear-num93.8%
frac-times94.0%
metadata-eval94.0%
Applied egg-rr94.0%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-rgt-identity70.6%
*-commutative70.6%
associate-*r/70.5%
associate-*l*70.5%
associate-/r*70.5%
associate-*r/70.5%
*-commutative70.5%
associate-*l/70.5%
metadata-eval70.5%
Simplified70.5%
if -3.2999999999999999e-66 < y < -6.2e-98Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
associate-*r/88.1%
associate-*l/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
if -6.2e-98 < y < 6e-68Initial program 85.6%
distribute-rgt-out--87.9%
Simplified87.9%
times-frac95.5%
Applied egg-rr95.5%
Taylor expanded in y around 0 82.0%
Final simplification79.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.7e-9)
(* 2.0 (/ (/ x y) z))
(if (<= y -2.3e-66)
(* x (/ (/ -2.0 z) t))
(if (<= y -6.5e-98)
(* x (/ 2.0 (* y z)))
(if (<= y 1.55e+27) (* (/ x z) (/ -2.0 t)) (* (/ x z) (/ 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.7e-9) {
tmp = 2.0 * ((x / y) / z);
} else if (y <= -2.3e-66) {
tmp = x * ((-2.0 / z) / t);
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 1.55e+27) {
tmp = (x / z) * (-2.0 / 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 <= (-1.7d-9)) then
tmp = 2.0d0 * ((x / y) / z)
else if (y <= (-2.3d-66)) then
tmp = x * (((-2.0d0) / z) / t)
else if (y <= (-6.5d-98)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 1.55d+27) then
tmp = (x / z) * ((-2.0d0) / 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 <= -1.7e-9) {
tmp = 2.0 * ((x / y) / z);
} else if (y <= -2.3e-66) {
tmp = x * ((-2.0 / z) / t);
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 1.55e+27) {
tmp = (x / z) * (-2.0 / t);
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.7e-9: tmp = 2.0 * ((x / y) / z) elif y <= -2.3e-66: tmp = x * ((-2.0 / z) / t) elif y <= -6.5e-98: tmp = x * (2.0 / (y * z)) elif y <= 1.55e+27: tmp = (x / z) * (-2.0 / t) else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.7e-9) tmp = Float64(2.0 * Float64(Float64(x / y) / z)); elseif (y <= -2.3e-66) tmp = Float64(x * Float64(Float64(-2.0 / z) / t)); elseif (y <= -6.5e-98) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 1.55e+27) tmp = Float64(Float64(x / z) * Float64(-2.0 / 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 <= -1.7e-9) tmp = 2.0 * ((x / y) / z); elseif (y <= -2.3e-66) tmp = x * ((-2.0 / z) / t); elseif (y <= -6.5e-98) tmp = x * (2.0 / (y * z)); elseif (y <= 1.55e+27) tmp = (x / z) * (-2.0 / t); else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.7e-9], N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e-66], N[(x * N[(N[(-2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.5e-98], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+27], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y}}{z}\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \frac{\frac{-2}{z}}{t}\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+27}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -1.6999999999999999e-9Initial program 86.8%
*-commutative86.8%
associate-*r/86.8%
distribute-rgt-out--91.9%
associate-/r*91.8%
Simplified91.8%
Taylor expanded in y around inf 83.6%
associate-/r*87.1%
Simplified87.1%
if -1.6999999999999999e-9 < y < -2.29999999999999992e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
frac-times93.8%
*-commutative93.8%
times-frac93.7%
clear-num93.8%
frac-times94.0%
metadata-eval94.0%
Applied egg-rr94.0%
Taylor expanded in y around 0 70.6%
associate-*r/70.6%
*-commutative70.6%
*-rgt-identity70.6%
*-commutative70.6%
associate-*r/70.5%
associate-*l*70.5%
associate-/r*70.5%
associate-*r/70.5%
*-commutative70.5%
associate-*l/70.5%
metadata-eval70.5%
Simplified70.5%
if -2.29999999999999992e-66 < y < -6.50000000000000017e-98Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
associate-*r/88.1%
associate-*l/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
if -6.50000000000000017e-98 < y < 1.54999999999999998e27Initial program 86.4%
distribute-rgt-out--88.2%
Simplified88.2%
times-frac95.3%
Applied egg-rr95.3%
Taylor expanded in y around 0 78.3%
if 1.54999999999999998e27 < y Initial program 86.9%
distribute-rgt-out--88.7%
Simplified88.7%
times-frac88.6%
Applied egg-rr88.6%
Taylor expanded in y around inf 79.6%
Final simplification80.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.1e-8)
(* 2.0 (/ (/ x y) z))
(if (<= y -2.8e-66)
(* (/ x (* z t)) -2.0)
(if (<= y -6.5e-98)
(* x (/ 2.0 (* y z)))
(if (<= y 3.5e+26) (* (/ x z) (/ -2.0 t)) (* (/ x z) (/ 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-8) {
tmp = 2.0 * ((x / y) / z);
} else if (y <= -2.8e-66) {
tmp = (x / (z * t)) * -2.0;
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.5e+26) {
tmp = (x / z) * (-2.0 / 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 <= (-2.1d-8)) then
tmp = 2.0d0 * ((x / y) / z)
else if (y <= (-2.8d-66)) then
tmp = (x / (z * t)) * (-2.0d0)
else if (y <= (-6.5d-98)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 3.5d+26) then
tmp = (x / z) * ((-2.0d0) / 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 <= -2.1e-8) {
tmp = 2.0 * ((x / y) / z);
} else if (y <= -2.8e-66) {
tmp = (x / (z * t)) * -2.0;
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.5e+26) {
tmp = (x / z) * (-2.0 / t);
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e-8: tmp = 2.0 * ((x / y) / z) elif y <= -2.8e-66: tmp = (x / (z * t)) * -2.0 elif y <= -6.5e-98: tmp = x * (2.0 / (y * z)) elif y <= 3.5e+26: tmp = (x / z) * (-2.0 / t) else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-8) tmp = Float64(2.0 * Float64(Float64(x / y) / z)); elseif (y <= -2.8e-66) tmp = Float64(Float64(x / Float64(z * t)) * -2.0); elseif (y <= -6.5e-98) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 3.5e+26) tmp = Float64(Float64(x / z) * Float64(-2.0 / 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 <= -2.1e-8) tmp = 2.0 * ((x / y) / z); elseif (y <= -2.8e-66) tmp = (x / (z * t)) * -2.0; elseif (y <= -6.5e-98) tmp = x * (2.0 / (y * z)); elseif (y <= 3.5e+26) tmp = (x / z) * (-2.0 / t); else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-8], N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.8e-66], N[(N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[y, -6.5e-98], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+26], N[(N[(x / z), $MachinePrecision] * N[(-2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y}}{z}\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{z \cdot t} \cdot -2\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+26}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -2.09999999999999994e-8Initial program 86.8%
*-commutative86.8%
associate-*r/86.8%
distribute-rgt-out--91.9%
associate-/r*91.8%
Simplified91.8%
Taylor expanded in y around inf 83.6%
associate-/r*87.1%
Simplified87.1%
if -2.09999999999999994e-8 < y < -2.8e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 70.6%
*-commutative70.6%
Simplified70.6%
if -2.8e-66 < y < -6.50000000000000017e-98Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
associate-*r/88.1%
associate-*l/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
if -6.50000000000000017e-98 < y < 3.4999999999999999e26Initial program 86.4%
distribute-rgt-out--88.2%
Simplified88.2%
times-frac95.3%
Applied egg-rr95.3%
Taylor expanded in y around 0 78.3%
if 3.4999999999999999e26 < y Initial program 86.9%
distribute-rgt-out--88.7%
Simplified88.7%
times-frac88.6%
Applied egg-rr88.6%
Taylor expanded in y around inf 79.6%
Final simplification80.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.8e-5)
(* 2.0 (/ (/ x y) z))
(if (<= y -2.3e-66)
(* (/ x (* z t)) -2.0)
(if (<= y -6.5e-98)
(* x (/ 2.0 (* y z)))
(if (<= y 3.9e+25) (/ (/ (* x -2.0) z) t) (* (/ x z) (/ 2.0 y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-5) {
tmp = 2.0 * ((x / y) / z);
} else if (y <= -2.3e-66) {
tmp = (x / (z * t)) * -2.0;
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.9e+25) {
tmp = ((x * -2.0) / 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 <= (-1.8d-5)) then
tmp = 2.0d0 * ((x / y) / z)
else if (y <= (-2.3d-66)) then
tmp = (x / (z * t)) * (-2.0d0)
else if (y <= (-6.5d-98)) then
tmp = x * (2.0d0 / (y * z))
else if (y <= 3.9d+25) then
tmp = ((x * (-2.0d0)) / 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 <= -1.8e-5) {
tmp = 2.0 * ((x / y) / z);
} else if (y <= -2.3e-66) {
tmp = (x / (z * t)) * -2.0;
} else if (y <= -6.5e-98) {
tmp = x * (2.0 / (y * z));
} else if (y <= 3.9e+25) {
tmp = ((x * -2.0) / z) / t;
} else {
tmp = (x / z) * (2.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-5: tmp = 2.0 * ((x / y) / z) elif y <= -2.3e-66: tmp = (x / (z * t)) * -2.0 elif y <= -6.5e-98: tmp = x * (2.0 / (y * z)) elif y <= 3.9e+25: tmp = ((x * -2.0) / z) / t else: tmp = (x / z) * (2.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-5) tmp = Float64(2.0 * Float64(Float64(x / y) / z)); elseif (y <= -2.3e-66) tmp = Float64(Float64(x / Float64(z * t)) * -2.0); elseif (y <= -6.5e-98) tmp = Float64(x * Float64(2.0 / Float64(y * z))); elseif (y <= 3.9e+25) tmp = Float64(Float64(Float64(x * -2.0) / 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 <= -1.8e-5) tmp = 2.0 * ((x / y) / z); elseif (y <= -2.3e-66) tmp = (x / (z * t)) * -2.0; elseif (y <= -6.5e-98) tmp = x * (2.0 / (y * z)); elseif (y <= 3.9e+25) tmp = ((x * -2.0) / z) / t; else tmp = (x / z) * (2.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-5], N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e-66], N[(N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[y, -6.5e-98], N[(x * N[(2.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+25], N[(N[(N[(x * -2.0), $MachinePrecision] / z), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(2.0 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{y}}{z}\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{z \cdot t} \cdot -2\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{2}{y \cdot z}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+25}:\\
\;\;\;\;\frac{\frac{x \cdot -2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{2}{y}\\
\end{array}
\end{array}
if y < -1.80000000000000005e-5Initial program 86.8%
*-commutative86.8%
associate-*r/86.8%
distribute-rgt-out--91.9%
associate-/r*91.8%
Simplified91.8%
Taylor expanded in y around inf 83.6%
associate-/r*87.1%
Simplified87.1%
if -1.80000000000000005e-5 < y < -2.29999999999999992e-66Initial program 93.8%
*-commutative93.8%
distribute-rgt-out--93.8%
times-frac93.7%
Simplified93.7%
Taylor expanded in y around 0 70.6%
*-commutative70.6%
Simplified70.6%
if -2.29999999999999992e-66 < y < -6.50000000000000017e-98Initial program 99.6%
distribute-rgt-out--99.6%
Simplified99.6%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 88.1%
*-commutative88.1%
associate-*r/88.1%
associate-*l/88.3%
*-commutative88.3%
*-commutative88.3%
Simplified88.3%
if -6.50000000000000017e-98 < y < 3.9000000000000002e25Initial program 86.4%
*-commutative86.4%
distribute-rgt-out--88.2%
times-frac93.1%
Simplified93.1%
Taylor expanded in y around 0 72.6%
*-commutative72.6%
Simplified72.6%
associate-*l/72.6%
*-commutative72.6%
metadata-eval72.6%
distribute-rgt-neg-in72.6%
associate-/r*78.3%
distribute-rgt-neg-in78.3%
metadata-eval78.3%
Applied egg-rr78.3%
if 3.9000000000000002e25 < y Initial program 86.9%
distribute-rgt-out--88.7%
Simplified88.7%
times-frac88.6%
Applied egg-rr88.6%
Taylor expanded in y around inf 79.6%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (<= (* 2.0 x) 2e-77) (* 2.0 (/ (/ x z) (- y t))) (* (/ 2.0 z) (/ x (- y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((2.0 * x) <= 2e-77) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 / z) * (x / (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 ((2.0d0 * x) <= 2d-77) then
tmp = 2.0d0 * ((x / z) / (y - t))
else
tmp = (2.0d0 / z) * (x / (y - t))
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-77) {
tmp = 2.0 * ((x / z) / (y - t));
} else {
tmp = (2.0 / z) * (x / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (2.0 * x) <= 2e-77: tmp = 2.0 * ((x / z) / (y - t)) else: tmp = (2.0 / z) * (x / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(2.0 * x) <= 2e-77) tmp = Float64(2.0 * Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((2.0 * x) <= 2e-77) tmp = 2.0 * ((x / z) / (y - t)); else tmp = (2.0 / z) * (x / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(2.0 * x), $MachinePrecision], 2e-77], N[(2.0 * N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x \leq 2 \cdot 10^{-77}:\\
\;\;\;\;2 \cdot \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if (*.f64 x 2) < 1.9999999999999999e-77Initial program 89.1%
*-commutative89.1%
associate-*r/89.1%
distribute-rgt-out--92.1%
associate-/r*94.2%
Simplified94.2%
if 1.9999999999999999e-77 < (*.f64 x 2) Initial program 84.1%
*-commutative84.1%
distribute-rgt-out--85.2%
times-frac98.5%
Simplified98.5%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (<= (* 2.0 x) 5e-23) (/ 2.0 (* (- y t) (/ z x))) (* (/ 2.0 z) (/ x (- y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((2.0 * x) <= 5e-23) {
tmp = 2.0 / ((y - t) * (z / x));
} else {
tmp = (2.0 / z) * (x / (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 ((2.0d0 * x) <= 5d-23) then
tmp = 2.0d0 / ((y - t) * (z / x))
else
tmp = (2.0d0 / z) * (x / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((2.0 * x) <= 5e-23) {
tmp = 2.0 / ((y - t) * (z / x));
} else {
tmp = (2.0 / z) * (x / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (2.0 * x) <= 5e-23: tmp = 2.0 / ((y - t) * (z / x)) else: tmp = (2.0 / z) * (x / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(2.0 * x) <= 5e-23) tmp = Float64(2.0 / Float64(Float64(y - t) * Float64(z / x))); else tmp = Float64(Float64(2.0 / z) * Float64(x / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((2.0 * x) <= 5e-23) tmp = 2.0 / ((y - t) * (z / x)); else tmp = (2.0 / z) * (x / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(2.0 * x), $MachinePrecision], 5e-23], N[(2.0 / N[(N[(y - t), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] * N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x \leq 5 \cdot 10^{-23}:\\
\;\;\;\;\frac{2}{\left(y - t\right) \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\end{array}
\end{array}
if (*.f64 x 2) < 5.0000000000000002e-23Initial program 89.8%
*-commutative89.8%
distribute-rgt-out--92.6%
times-frac90.5%
Simplified90.5%
frac-times92.6%
*-commutative92.6%
times-frac94.5%
clear-num94.4%
frac-times94.8%
metadata-eval94.8%
Applied egg-rr94.8%
if 5.0000000000000002e-23 < (*.f64 x 2) Initial program 81.7%
*-commutative81.7%
distribute-rgt-out--83.1%
times-frac98.3%
Simplified98.3%
Final simplification95.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 87.5%
*-commutative87.5%
associate-*r/87.5%
distribute-rgt-out--89.9%
associate-/r*93.0%
Simplified93.0%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (* 2.0 (/ (/ x y) z)))
double code(double x, double y, double z, double t) {
return 2.0 * ((x / y) / z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 2.0d0 * ((x / y) / z)
end function
public static double code(double x, double y, double z, double t) {
return 2.0 * ((x / y) / z);
}
def code(x, y, z, t): return 2.0 * ((x / y) / z)
function code(x, y, z, t) return Float64(2.0 * Float64(Float64(x / y) / z)) end
function tmp = code(x, y, z, t) tmp = 2.0 * ((x / y) / z); end
code[x_, y_, z_, t_] := N[(2.0 * N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \frac{\frac{x}{y}}{z}
\end{array}
Initial program 87.5%
*-commutative87.5%
associate-*r/87.5%
distribute-rgt-out--89.9%
associate-/r*93.0%
Simplified93.0%
Taylor expanded in y around inf 53.8%
associate-/r*55.0%
Simplified55.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 2023279
(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))))