
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -5e+75) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e+75) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
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 * 3.0d0) <= (-5d+75)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
else
tmp = x + (((t / y) - y) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e+75) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e+75: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -5e+75) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -5e+75) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -5e+75], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{+75}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -5.0000000000000002e75Initial program 99.9%
if -5.0000000000000002e75 < (*.f64 z #s(literal 3 binary64)) Initial program 92.1%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6498.5%
Applied egg-rr98.5%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.8e+74)
(/ (/ y -3.0) z)
(if (<= y -1.15e-57)
x
(if (<= y 3.9e+15)
(* (/ t z) (/ 0.3333333333333333 y))
(/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+74) {
tmp = (y / -3.0) / z;
} else if (y <= -1.15e-57) {
tmp = x;
} else if (y <= 3.9e+15) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.8d+74)) then
tmp = (y / (-3.0d0)) / z
else if (y <= (-1.15d-57)) then
tmp = x
else if (y <= 3.9d+15) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+74) {
tmp = (y / -3.0) / z;
} else if (y <= -1.15e-57) {
tmp = x;
} else if (y <= 3.9e+15) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e+74: tmp = (y / -3.0) / z elif y <= -1.15e-57: tmp = x elif y <= 3.9e+15: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e+74) tmp = Float64(Float64(y / -3.0) / z); elseif (y <= -1.15e-57) tmp = x; elseif (y <= 3.9e+15) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e+74) tmp = (y / -3.0) / z; elseif (y <= -1.15e-57) tmp = x; elseif (y <= 3.9e+15) tmp = (t / z) * (0.3333333333333333 / y); else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+74], N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -1.15e-57], x, If[LessEqual[y, 3.9e+15], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+15}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -6.7999999999999998e74Initial program 97.8%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6481.4%
Simplified81.4%
*-commutativeN/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval81.6%
Applied egg-rr81.6%
if -6.7999999999999998e74 < y < -1.15e-57Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
Simplified56.9%
if -1.15e-57 < y < 3.9e15Initial program 88.8%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6492.7%
Simplified92.7%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6458.9%
Simplified58.9%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6463.9%
Applied egg-rr63.9%
if 3.9e15 < y Initial program 96.7%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6469.5%
Simplified69.5%
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
*-commutativeN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
distribute-neg-frac2N/A
metadata-evalN/A
/-lowering-/.f6469.5%
Applied egg-rr69.5%
div-invN/A
metadata-evalN/A
*-lowering-*.f6469.7%
Applied egg-rr69.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e-21) (- x (/ (/ y 3.0) z)) (if (<= y 1.8e+14) (+ x (/ t (* (* z 3.0) y))) (- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-21) {
tmp = x - ((y / 3.0) / z);
} else if (y <= 1.8e+14) {
tmp = x + (t / ((z * 3.0) * y));
} else {
tmp = x - (y / (z * 3.0));
}
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.3d-21)) then
tmp = x - ((y / 3.0d0) / z)
else if (y <= 1.8d+14) then
tmp = x + (t / ((z * 3.0d0) * y))
else
tmp = x - (y / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-21) {
tmp = x - ((y / 3.0) / z);
} else if (y <= 1.8e+14) {
tmp = x + (t / ((z * 3.0) * y));
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e-21: tmp = x - ((y / 3.0) / z) elif y <= 1.8e+14: tmp = x + (t / ((z * 3.0) * y)) else: tmp = x - (y / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e-21) tmp = Float64(x - Float64(Float64(y / 3.0) / z)); elseif (y <= 1.8e+14) tmp = Float64(x + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e-21) tmp = x - ((y / 3.0) / z); elseif (y <= 1.8e+14) tmp = x + (t / ((z * 3.0) * y)); else tmp = x - (y / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e-21], N[(x - N[(N[(y / 3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+14], N[(x + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-21}:\\
\;\;\;\;x - \frac{\frac{y}{3}}{z}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+14}:\\
\;\;\;\;x + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.30000000000000009e-21Initial program 98.4%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified94.4%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6494.6%
Applied egg-rr94.6%
if -1.30000000000000009e-21 < y < 1.8e14Initial program 88.9%
Taylor expanded in x around inf
Simplified87.7%
if 1.8e14 < y Initial program 96.8%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified95.2%
(FPCore (x y z t) :precision binary64 (if (<= y -4.1e-59) (- x (/ (/ y 3.0) z)) (if (<= y 28000.0) (/ (/ t z) (* 3.0 y)) (- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e-59) {
tmp = x - ((y / 3.0) / z);
} else if (y <= 28000.0) {
tmp = (t / z) / (3.0 * y);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.1d-59)) then
tmp = x - ((y / 3.0d0) / z)
else if (y <= 28000.0d0) then
tmp = (t / z) / (3.0d0 * y)
else
tmp = x - (y / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e-59) {
tmp = x - ((y / 3.0) / z);
} else if (y <= 28000.0) {
tmp = (t / z) / (3.0 * y);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.1e-59: tmp = x - ((y / 3.0) / z) elif y <= 28000.0: tmp = (t / z) / (3.0 * y) else: tmp = x - (y / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.1e-59) tmp = Float64(x - Float64(Float64(y / 3.0) / z)); elseif (y <= 28000.0) tmp = Float64(Float64(t / z) / Float64(3.0 * y)); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.1e-59) tmp = x - ((y / 3.0) / z); elseif (y <= 28000.0) tmp = (t / z) / (3.0 * y); else tmp = x - (y / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e-59], N[(x - N[(N[(y / 3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 28000.0], N[(N[(t / z), $MachinePrecision] / N[(3.0 * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-59}:\\
\;\;\;\;x - \frac{\frac{y}{3}}{z}\\
\mathbf{elif}\;y \leq 28000:\\
\;\;\;\;\frac{\frac{t}{z}}{3 \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -4.0999999999999996e-59Initial program 98.5%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified93.5%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6493.6%
Applied egg-rr93.6%
if -4.0999999999999996e-59 < y < 28000Initial program 88.3%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6460.6%
Simplified60.6%
times-fracN/A
metadata-evalN/A
associate-/r*N/A
*-commutativeN/A
div-invN/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6460.6%
Applied egg-rr60.6%
associate-*l/N/A
div-invN/A
metadata-evalN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.6%
Applied egg-rr60.6%
*-commutativeN/A
associate-*l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6465.7%
Applied egg-rr65.7%
if 28000 < y Initial program 96.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified94.0%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.5e-58)
(- x (/ (/ y 3.0) z))
(if (<= y 31500.0)
(* (/ t z) (/ 0.3333333333333333 y))
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-58) {
tmp = x - ((y / 3.0) / z);
} else if (y <= 31500.0) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d-58)) then
tmp = x - ((y / 3.0d0) / z)
else if (y <= 31500.0d0) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else
tmp = x - (y / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-58) {
tmp = x - ((y / 3.0) / z);
} else if (y <= 31500.0) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-58: tmp = x - ((y / 3.0) / z) elif y <= 31500.0: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = x - (y / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-58) tmp = Float64(x - Float64(Float64(y / 3.0) / z)); elseif (y <= 31500.0) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e-58) tmp = x - ((y / 3.0) / z); elseif (y <= 31500.0) tmp = (t / z) * (0.3333333333333333 / y); else tmp = x - (y / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-58], N[(x - N[(N[(y / 3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 31500.0], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-58}:\\
\;\;\;\;x - \frac{\frac{y}{3}}{z}\\
\mathbf{elif}\;y \leq 31500:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -3.4999999999999999e-58Initial program 98.5%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified93.5%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6493.6%
Applied egg-rr93.6%
if -3.4999999999999999e-58 < y < 31500Initial program 88.3%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6460.6%
Simplified60.6%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6465.7%
Applied egg-rr65.7%
if 31500 < y Initial program 96.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified94.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.35e-59)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 12200.0)
(* (/ t z) (/ 0.3333333333333333 y))
(- x (/ y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-59) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 12200.0) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x - (y / (z * 3.0));
}
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.35d-59)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 12200.0d0) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else
tmp = x - (y / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-59) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 12200.0) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x - (y / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e-59: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 12200.0: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = x - (y / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e-59) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 12200.0) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = Float64(x - Float64(y / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.35e-59) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 12200.0) tmp = (t / z) * (0.3333333333333333 / y); else tmp = x - (y / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e-59], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 12200.0], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-59}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 12200:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\end{array}
\end{array}
if y < -1.3499999999999999e-59Initial program 98.5%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6499.8%
Simplified99.8%
Taylor expanded in y around inf
Simplified93.6%
if -1.3499999999999999e-59 < y < 12200Initial program 88.3%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6460.6%
Simplified60.6%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6465.7%
Applied egg-rr65.7%
if 12200 < y Initial program 96.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified94.0%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y (/ -0.3333333333333333 z)))))
(if (<= y -2.2e-57)
t_1
(if (<= y 12200.0) (* (/ t z) (/ 0.3333333333333333 y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * (-0.3333333333333333 / z));
double tmp;
if (y <= -2.2e-57) {
tmp = t_1;
} else if (y <= 12200.0) {
tmp = (t / z) * (0.3333333333333333 / y);
} 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 = x + (y * ((-0.3333333333333333d0) / z))
if (y <= (-2.2d-57)) then
tmp = t_1
else if (y <= 12200.0d0) then
tmp = (t / z) * (0.3333333333333333d0 / y)
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 * (-0.3333333333333333 / z));
double tmp;
if (y <= -2.2e-57) {
tmp = t_1;
} else if (y <= 12200.0) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * (-0.3333333333333333 / z)) tmp = 0 if y <= -2.2e-57: tmp = t_1 elif y <= 12200.0: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) tmp = 0.0 if (y <= -2.2e-57) tmp = t_1; elseif (y <= 12200.0) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * (-0.3333333333333333 / z)); tmp = 0.0; if (y <= -2.2e-57) tmp = t_1; elseif (y <= 12200.0) tmp = (t / z) * (0.3333333333333333 / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-57], t$95$1, If[LessEqual[y, 12200.0], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 12200:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.19999999999999999e-57 or 12200 < y Initial program 97.8%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6499.8%
Simplified99.8%
Taylor expanded in y around inf
Simplified93.7%
if -2.19999999999999999e-57 < y < 12200Initial program 88.3%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
Taylor expanded in y around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6460.6%
Simplified60.6%
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6465.7%
Applied egg-rr65.7%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.4e+76) (/ (/ y -3.0) z) (if (<= y 1.65e+69) x (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e+76) {
tmp = (y / -3.0) / z;
} else if (y <= 1.65e+69) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
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.4d+76)) then
tmp = (y / (-3.0d0)) / z
else if (y <= 1.65d+69) then
tmp = x
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e+76) {
tmp = (y / -3.0) / z;
} else if (y <= 1.65e+69) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.4e+76: tmp = (y / -3.0) / z elif y <= 1.65e+69: tmp = x else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e+76) tmp = Float64(Float64(y / -3.0) / z); elseif (y <= 1.65e+69) tmp = x; else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.4e+76) tmp = (y / -3.0) / z; elseif (y <= 1.65e+69) tmp = x; else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e+76], N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 1.65e+69], x, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+76}:\\
\;\;\;\;\frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -2.4e76Initial program 97.8%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6481.4%
Simplified81.4%
*-commutativeN/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval81.6%
Applied egg-rr81.6%
if -2.4e76 < y < 1.6499999999999999e69Initial program 91.4%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6494.4%
Simplified94.4%
Taylor expanded in x around inf
Simplified39.4%
if 1.6499999999999999e69 < y Initial program 95.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6475.7%
Simplified75.7%
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
*-commutativeN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
distribute-neg-frac2N/A
metadata-evalN/A
/-lowering-/.f6475.7%
Applied egg-rr75.7%
div-invN/A
metadata-evalN/A
*-lowering-*.f6475.8%
Applied egg-rr75.8%
(FPCore (x y z t) :precision binary64 (if (<= y -7e+74) (* y (/ -0.3333333333333333 z)) (if (<= y 3.5e+69) x (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+74) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 3.5e+69) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
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 <= (-7d+74)) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (y <= 3.5d+69) then
tmp = x
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+74) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 3.5e+69) {
tmp = x;
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e+74: tmp = y * (-0.3333333333333333 / z) elif y <= 3.5e+69: tmp = x else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e+74) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (y <= 3.5e+69) tmp = x; else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7e+74) tmp = y * (-0.3333333333333333 / z); elseif (y <= 3.5e+69) tmp = x; else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e+74], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+69], x, N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -7.00000000000000029e74Initial program 97.8%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6481.4%
Simplified81.4%
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
*-commutativeN/A
frac-2negN/A
remove-double-negN/A
div-invN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
/-lowering-/.f6481.5%
Applied egg-rr81.5%
if -7.00000000000000029e74 < y < 3.49999999999999987e69Initial program 91.4%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6494.4%
Simplified94.4%
Taylor expanded in x around inf
Simplified39.4%
if 3.49999999999999987e69 < y Initial program 95.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6475.7%
Simplified75.7%
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
*-commutativeN/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
metadata-evalN/A
div-invN/A
distribute-neg-frac2N/A
metadata-evalN/A
/-lowering-/.f6475.7%
Applied egg-rr75.7%
div-invN/A
metadata-evalN/A
*-lowering-*.f6475.8%
Applied egg-rr75.8%
Final simplification55.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.35e+77) (* y (/ -0.3333333333333333 z)) (if (<= y 1.85e+71) x (* -0.3333333333333333 (/ y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+77) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 1.85e+71) {
tmp = x;
} else {
tmp = -0.3333333333333333 * (y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.35d+77)) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (y <= 1.85d+71) then
tmp = x
else
tmp = (-0.3333333333333333d0) * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+77) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 1.85e+71) {
tmp = x;
} else {
tmp = -0.3333333333333333 * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e+77: tmp = y * (-0.3333333333333333 / z) elif y <= 1.85e+71: tmp = x else: tmp = -0.3333333333333333 * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e+77) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (y <= 1.85e+71) tmp = x; else tmp = Float64(-0.3333333333333333 * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.35e+77) tmp = y * (-0.3333333333333333 / z); elseif (y <= 1.85e+71) tmp = x; else tmp = -0.3333333333333333 * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e+77], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+71], x, N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+77}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -1.3499999999999999e77Initial program 97.8%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6481.4%
Simplified81.4%
metadata-evalN/A
times-fracN/A
neg-mul-1N/A
*-commutativeN/A
frac-2negN/A
remove-double-negN/A
div-invN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
/-lowering-/.f6481.5%
Applied egg-rr81.5%
if -1.3499999999999999e77 < y < 1.85e71Initial program 91.4%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6494.4%
Simplified94.4%
Taylor expanded in x around inf
Simplified39.4%
if 1.85e71 < y Initial program 95.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6475.7%
Simplified75.7%
Final simplification55.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* -0.3333333333333333 (/ y z)))) (if (<= y -3.6e+77) t_1 (if (<= y 2.45e+70) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -3.6e+77) {
tmp = t_1;
} else if (y <= 2.45e+70) {
tmp = x;
} 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 = (-0.3333333333333333d0) * (y / z)
if (y <= (-3.6d+77)) then
tmp = t_1
else if (y <= 2.45d+70) then
tmp = x
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 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -3.6e+77) {
tmp = t_1;
} else if (y <= 2.45e+70) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.3333333333333333 * (y / z) tmp = 0 if y <= -3.6e+77: tmp = t_1 elif y <= 2.45e+70: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-0.3333333333333333 * Float64(y / z)) tmp = 0.0 if (y <= -3.6e+77) tmp = t_1; elseif (y <= 2.45e+70) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.3333333333333333 * (y / z); tmp = 0.0; if (y <= -3.6e+77) tmp = t_1; elseif (y <= 2.45e+70) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+77], t$95$1, If[LessEqual[y, 2.45e+70], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+70}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.5999999999999998e77 or 2.45000000000000014e70 < y Initial program 96.9%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f6478.6%
Simplified78.6%
if -3.5999999999999998e77 < y < 2.45000000000000014e70Initial program 91.4%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6494.4%
Simplified94.4%
Taylor expanded in x around inf
Simplified39.4%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
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 + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 93.6%
associate-+l-N/A
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6496.6%
Applied egg-rr96.6%
Final simplification96.6%
(FPCore (x y z t) :precision binary64 (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / 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 + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + ((y - (t / y)) * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 93.6%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6496.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.6%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
unsub-negN/A
neg-mul-1N/A
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
distribute-neg-fracN/A
neg-mul-1N/A
times-fracN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f6496.5%
Simplified96.5%
Taylor expanded in x around inf
Simplified31.2%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024163
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))