
(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 16 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 (<= t 1.3e+15) (+ x (fma -0.3333333333333333 (/ y z) (/ (/ (/ t z) y) 3.0))) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.3e+15) {
tmp = x + fma(-0.3333333333333333, (y / z), (((t / z) / y) / 3.0));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 1.3e+15) tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(Float64(Float64(t / z) / y) / 3.0))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.3e+15], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{\frac{\frac{t}{z}}{y}}{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if t < 1.3e15Initial program 96.0%
associate-+l-96.0%
sub-neg96.0%
sub-neg96.0%
distribute-neg-in96.0%
distribute-neg-frac96.0%
neg-mul-196.0%
*-commutative96.0%
times-frac96.0%
remove-double-neg96.0%
fma-def96.0%
metadata-eval96.0%
associate-*l*96.1%
associate-/r*99.3%
associate-/l/99.3%
Simplified99.3%
if 1.3e15 < t Initial program 98.1%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= t 2e+15) (+ x (+ (* -0.3333333333333333 (/ y z)) (/ (/ t z) (* y 3.0)))) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2e+15) {
tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0)));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (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 (t <= 2d+15) then
tmp = x + (((-0.3333333333333333d0) * (y / z)) + ((t / z) / (y * 3.0d0)))
else
tmp = (x - (y / (z * 3.0d0))) + (t / (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 (t <= 2e+15) {
tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0)));
} else {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2e+15: tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0))) else: tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2e+15) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y / z)) + Float64(Float64(t / z) / Float64(y * 3.0)))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2e+15) tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0))); else tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2e+15], N[(x + N[(N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \left(-0.3333333333333333 \cdot \frac{y}{z} + \frac{\frac{t}{z}}{y \cdot 3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if t < 2e15Initial program 96.0%
associate-+l-96.0%
sub-neg96.0%
sub-neg96.0%
distribute-neg-in96.0%
distribute-neg-frac96.0%
neg-mul-196.0%
*-commutative96.0%
times-frac96.0%
remove-double-neg96.0%
fma-def96.0%
metadata-eval96.0%
associate-*l*96.1%
associate-/r*99.3%
associate-/l/99.3%
Simplified99.3%
fma-udef99.3%
associate-/l/99.3%
Applied egg-rr99.3%
if 2e15 < t Initial program 98.1%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ 0.3333333333333333 (* y z)))))
(if (<= y -2.16e+49)
(/ (/ y -3.0) z)
(if (<= y 2.1e-166)
t_1
(if (<= y 3.5e-36) x (if (<= y 5.1e-15) t_1 (/ (/ y z) -3.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (0.3333333333333333 / (y * z));
double tmp;
if (y <= -2.16e+49) {
tmp = (y / -3.0) / z;
} else if (y <= 2.1e-166) {
tmp = t_1;
} else if (y <= 3.5e-36) {
tmp = x;
} else if (y <= 5.1e-15) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * (0.3333333333333333d0 / (y * z))
if (y <= (-2.16d+49)) then
tmp = (y / (-3.0d0)) / z
else if (y <= 2.1d-166) then
tmp = t_1
else if (y <= 3.5d-36) then
tmp = x
else if (y <= 5.1d-15) then
tmp = t_1
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 t_1 = t * (0.3333333333333333 / (y * z));
double tmp;
if (y <= -2.16e+49) {
tmp = (y / -3.0) / z;
} else if (y <= 2.1e-166) {
tmp = t_1;
} else if (y <= 3.5e-36) {
tmp = x;
} else if (y <= 5.1e-15) {
tmp = t_1;
} else {
tmp = (y / z) / -3.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (0.3333333333333333 / (y * z)) tmp = 0 if y <= -2.16e+49: tmp = (y / -3.0) / z elif y <= 2.1e-166: tmp = t_1 elif y <= 3.5e-36: tmp = x elif y <= 5.1e-15: tmp = t_1 else: tmp = (y / z) / -3.0 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(0.3333333333333333 / Float64(y * z))) tmp = 0.0 if (y <= -2.16e+49) tmp = Float64(Float64(y / -3.0) / z); elseif (y <= 2.1e-166) tmp = t_1; elseif (y <= 3.5e-36) tmp = x; elseif (y <= 5.1e-15) tmp = t_1; else tmp = Float64(Float64(y / z) / -3.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (0.3333333333333333 / (y * z)); tmp = 0.0; if (y <= -2.16e+49) tmp = (y / -3.0) / z; elseif (y <= 2.1e-166) tmp = t_1; elseif (y <= 3.5e-36) tmp = x; elseif (y <= 5.1e-15) tmp = t_1; else tmp = (y / z) / -3.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.16e+49], N[(N[(y / -3.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.1e-166], t$95$1, If[LessEqual[y, 3.5e-36], x, If[LessEqual[y, 5.1e-15], t$95$1, N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{if}\;y \leq -2.16 \cdot 10^{+49}:\\
\;\;\;\;\frac{\frac{y}{-3}}{z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\
\end{array}
\end{array}
if y < -2.16000000000000003e49Initial program 97.0%
Taylor expanded in z around 0 73.5%
Taylor expanded in t around 0 69.2%
*-commutative69.2%
Simplified69.2%
associate-/l*69.3%
div-inv69.2%
div-inv69.2%
metadata-eval69.2%
Applied egg-rr69.2%
un-div-inv69.3%
*-commutative69.3%
associate-/r*69.3%
Applied egg-rr69.3%
if -2.16000000000000003e49 < y < 2.0999999999999999e-166 or 3.5e-36 < y < 5.1e-15Initial program 94.5%
associate-+l-94.5%
sub-neg94.5%
sub-neg94.5%
distribute-neg-in94.5%
unsub-neg94.5%
neg-mul-194.5%
associate-*r/94.5%
associate-*l/94.5%
distribute-neg-frac94.5%
neg-mul-194.5%
times-frac93.4%
distribute-lft-out--93.4%
*-commutative93.4%
associate-/r*93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in x around 0 93.3%
Taylor expanded in z around 0 69.3%
Taylor expanded in y around 0 64.5%
associate-*r/64.6%
*-commutative64.6%
associate-*r/62.8%
Simplified62.8%
if 2.0999999999999999e-166 < y < 3.5e-36Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
times-frac99.7%
remove-double-neg99.7%
fma-def99.7%
metadata-eval99.7%
associate-*l*99.8%
associate-/r*96.9%
associate-/l/96.9%
Simplified96.9%
Taylor expanded in x around inf 53.2%
if 5.1e-15 < y Initial program 97.9%
Taylor expanded in z around 0 69.5%
Taylor expanded in t around 0 60.5%
*-commutative60.5%
Simplified60.5%
associate-/l*60.6%
div-inv60.5%
div-inv60.5%
metadata-eval60.5%
Applied egg-rr60.5%
un-div-inv60.5%
associate-/r*60.6%
Applied egg-rr60.6%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (+ x (+ (* -0.3333333333333333 (/ y z)) (/ (/ t z) (* y 3.0)))))
double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 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 + (((-0.3333333333333333d0) * (y / z)) + ((t / z) / (y * 3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0)));
}
def code(x, y, z, t): return x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0)))
function code(x, y, z, t) return Float64(x + Float64(Float64(-0.3333333333333333 * Float64(y / z)) + Float64(Float64(t / z) / Float64(y * 3.0)))) end
function tmp = code(x, y, z, t) tmp = x + ((-0.3333333333333333 * (y / z)) + ((t / z) / (y * 3.0))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-0.3333333333333333 \cdot \frac{y}{z} + \frac{\frac{t}{z}}{y \cdot 3}\right)
\end{array}
Initial program 96.5%
associate-+l-96.5%
sub-neg96.5%
sub-neg96.5%
distribute-neg-in96.5%
distribute-neg-frac96.5%
neg-mul-196.5%
*-commutative96.5%
times-frac96.5%
remove-double-neg96.5%
fma-def96.5%
metadata-eval96.5%
associate-*l*96.5%
associate-/r*97.1%
associate-/l/97.1%
Simplified97.1%
fma-udef97.1%
associate-/l/97.1%
Applied egg-rr97.1%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.4e+95)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= z 7e+64)
(* -0.3333333333333333 (/ (- y (/ t y)) z))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.4e+95) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (z <= 7e+64) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-5.4d+95)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (z <= 7d+64) then
tmp = (-0.3333333333333333d0) * ((y - (t / y)) / z)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.4e+95) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (z <= 7e+64) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.4e+95: tmp = x + (y * (-0.3333333333333333 / z)) elif z <= 7e+64: tmp = -0.3333333333333333 * ((y - (t / y)) / z) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.4e+95) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (z <= 7e+64) tmp = Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.4e+95) tmp = x + (y * (-0.3333333333333333 / z)); elseif (z <= 7e+64) tmp = -0.3333333333333333 * ((y - (t / y)) / z); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.4e+95], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+64], N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+95}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+64}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if z < -5.4e95Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
times-frac90.6%
distribute-lft-out--90.6%
*-commutative90.6%
associate-/r*90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in y around inf 81.5%
if -5.4e95 < z < 6.9999999999999997e64Initial program 95.8%
associate-+l-95.8%
sub-neg95.8%
sub-neg95.8%
distribute-neg-in95.8%
unsub-neg95.8%
neg-mul-195.8%
associate-*r/95.8%
associate-*l/95.8%
distribute-neg-frac95.8%
neg-mul-195.8%
times-frac99.0%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 88.5%
if 6.9999999999999997e64 < z Initial program 96.0%
Taylor expanded in t around 0 78.7%
Final simplification85.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.5e+58)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 3.85e-47)
(+ x (* t (/ 0.3333333333333333 (* y z))))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+58) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 3.85e-47) {
tmp = x + (t * (0.3333333333333333 / (y * z)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 * ((-0.3333333333333333d0) / z))
else if (y <= 3.85d-47) then
tmp = x + (t * (0.3333333333333333d0 / (y * z)))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
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 * (-0.3333333333333333 / z));
} else if (y <= 3.85e-47) {
tmp = x + (t * (0.3333333333333333 / (y * z)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+58: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 3.85e-47: tmp = x + (t * (0.3333333333333333 / (y * z))) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e+58) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 3.85e-47) tmp = Float64(x + Float64(t * Float64(0.3333333333333333 / Float64(y * z)))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e+58) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 3.85e-47) tmp = x + (t * (0.3333333333333333 / (y * z))); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+58], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.85e-47], N[(x + N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.85 \cdot 10^{-47}:\\
\;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -3.4999999999999997e58Initial program 96.8%
associate-+l-96.8%
sub-neg96.8%
sub-neg96.8%
distribute-neg-in96.8%
unsub-neg96.8%
neg-mul-196.8%
associate-*r/96.8%
associate-*l/96.7%
distribute-neg-frac96.7%
neg-mul-196.7%
times-frac98.2%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 96.9%
if -3.4999999999999997e58 < y < 3.85e-47Initial program 95.5%
associate-+l-95.5%
sub-neg95.5%
sub-neg95.5%
distribute-neg-in95.5%
distribute-neg-frac95.5%
neg-mul-195.5%
*-commutative95.5%
times-frac95.5%
remove-double-neg95.5%
fma-def95.5%
metadata-eval95.5%
associate-*l*95.5%
associate-/r*99.1%
associate-/l/99.1%
Simplified99.1%
Taylor expanded in y around 0 90.2%
metadata-eval90.2%
times-frac90.3%
associate-*r*90.3%
*-commutative90.3%
associate-*l/88.7%
*-commutative88.7%
associate-*r*88.7%
associate-/r*88.7%
*-commutative88.7%
associate-/r*88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in z around 0 88.7%
if 3.85e-47 < y Initial program 98.2%
Taylor expanded in t around 0 87.7%
Final simplification90.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.5e+58)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 3.55e-47)
(+ x (/ t (* y (* z 3.0))))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+58) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 3.55e-47) {
tmp = x + (t / (y * (z * 3.0)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.5d+58)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 3.55d-47) then
tmp = x + (t / (y * (z * 3.0d0)))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+58) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 3.55e-47) {
tmp = x + (t / (y * (z * 3.0)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e+58: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 3.55e-47: tmp = x + (t / (y * (z * 3.0))) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e+58) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 3.55e-47) tmp = Float64(x + Float64(t / Float64(y * Float64(z * 3.0)))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.5e+58) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 3.55e-47) tmp = x + (t / (y * (z * 3.0))); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e+58], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.55e-47], N[(x + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.55 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -5.4999999999999999e58Initial program 96.8%
associate-+l-96.8%
sub-neg96.8%
sub-neg96.8%
distribute-neg-in96.8%
unsub-neg96.8%
neg-mul-196.8%
associate-*r/96.8%
associate-*l/96.7%
distribute-neg-frac96.7%
neg-mul-196.7%
times-frac98.2%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 96.9%
if -5.4999999999999999e58 < y < 3.5500000000000001e-47Initial program 95.5%
associate-+l-95.5%
sub-neg95.5%
sub-neg95.5%
distribute-neg-in95.5%
distribute-neg-frac95.5%
neg-mul-195.5%
*-commutative95.5%
times-frac95.5%
remove-double-neg95.5%
fma-def95.5%
metadata-eval95.5%
associate-*l*95.5%
associate-/r*99.1%
associate-/l/99.1%
Simplified99.1%
Taylor expanded in y around 0 90.2%
metadata-eval90.2%
times-frac90.3%
associate-*r*90.3%
*-commutative90.3%
associate-*l/88.7%
*-commutative88.7%
associate-*r*88.7%
associate-/r*88.7%
*-commutative88.7%
associate-/r*88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in z around 0 88.7%
clear-num88.7%
un-div-inv90.2%
div-inv90.3%
metadata-eval90.3%
Applied egg-rr90.3%
associate-*l*90.2%
Simplified90.2%
if 3.5500000000000001e-47 < y Initial program 98.2%
Taylor expanded in t around 0 87.7%
Final simplification91.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.5e+58)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 3.85e-47)
(+ x (/ (* t (/ 0.3333333333333333 z)) y))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+58) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 3.85e-47) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 * ((-0.3333333333333333d0) / z))
else if (y <= 3.85d-47) then
tmp = x + ((t * (0.3333333333333333d0 / z)) / y)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
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 * (-0.3333333333333333 / z));
} else if (y <= 3.85e-47) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+58: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 3.85e-47: tmp = x + ((t * (0.3333333333333333 / z)) / y) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e+58) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 3.85e-47) tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / y)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e+58) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 3.85e-47) tmp = x + ((t * (0.3333333333333333 / z)) / y); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+58], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.85e-47], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 3.85 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -3.4999999999999997e58Initial program 96.8%
associate-+l-96.8%
sub-neg96.8%
sub-neg96.8%
distribute-neg-in96.8%
unsub-neg96.8%
neg-mul-196.8%
associate-*r/96.8%
associate-*l/96.7%
distribute-neg-frac96.7%
neg-mul-196.7%
times-frac98.2%
distribute-lft-out--99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 96.9%
if -3.4999999999999997e58 < y < 3.85e-47Initial program 95.5%
associate-+l-95.5%
sub-neg95.5%
sub-neg95.5%
distribute-neg-in95.5%
distribute-neg-frac95.5%
neg-mul-195.5%
*-commutative95.5%
times-frac95.5%
remove-double-neg95.5%
fma-def95.5%
metadata-eval95.5%
associate-*l*95.5%
associate-/r*99.1%
associate-/l/99.1%
Simplified99.1%
Taylor expanded in y around 0 90.2%
metadata-eval90.2%
times-frac90.3%
associate-*r*90.3%
*-commutative90.3%
associate-*l/88.7%
*-commutative88.7%
associate-*r*88.7%
associate-/r*88.7%
*-commutative88.7%
associate-/r*88.7%
metadata-eval88.7%
Simplified88.7%
associate-*r/93.7%
Applied egg-rr93.7%
if 3.85e-47 < y Initial program 98.2%
Taylor expanded in t around 0 87.7%
Final simplification93.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.3e-106) (not (<= y 2.15e-166))) (+ x (* y (/ -0.3333333333333333 z))) (* t (/ 0.3333333333333333 (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.3e-106) || !(y <= 2.15e-166)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = t * (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 <= (-3.3d-106)) .or. (.not. (y <= 2.15d-166))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = t * (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 <= -3.3e-106) || !(y <= 2.15e-166)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = t * (0.3333333333333333 / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.3e-106) or not (y <= 2.15e-166): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = t * (0.3333333333333333 / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.3e-106) || !(y <= 2.15e-166)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(t * Float64(0.3333333333333333 / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.3e-106) || ~((y <= 2.15e-166))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = t * (0.3333333333333333 / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.3e-106], N[Not[LessEqual[y, 2.15e-166]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-106} \lor \neg \left(y \leq 2.15 \cdot 10^{-166}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\end{array}
\end{array}
if y < -3.30000000000000016e-106 or 2.15e-166 < y Initial program 98.2%
associate-+l-98.2%
sub-neg98.2%
sub-neg98.2%
distribute-neg-in98.2%
unsub-neg98.2%
neg-mul-198.2%
associate-*r/98.2%
associate-*l/98.1%
distribute-neg-frac98.1%
neg-mul-198.1%
times-frac98.1%
distribute-lft-out--98.6%
*-commutative98.6%
associate-/r*98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in y around inf 82.2%
if -3.30000000000000016e-106 < y < 2.15e-166Initial program 92.0%
associate-+l-92.0%
sub-neg92.0%
sub-neg92.0%
distribute-neg-in92.0%
unsub-neg92.0%
neg-mul-192.0%
associate-*r/92.0%
associate-*l/92.0%
distribute-neg-frac92.0%
neg-mul-192.0%
times-frac90.4%
distribute-lft-out--90.4%
*-commutative90.4%
associate-/r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in x around 0 90.3%
Taylor expanded in z around 0 73.8%
Taylor expanded in y around 0 75.2%
associate-*r/75.3%
*-commutative75.3%
associate-*r/72.6%
Simplified72.6%
Final simplification79.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.25e-104)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 2.15e-166)
(* t (/ 0.3333333333333333 (* y z)))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.25e-104) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.15e-166) {
tmp = t * (0.3333333333333333 / (y * z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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.25d-104)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 2.15d-166) then
tmp = t * (0.3333333333333333d0 / (y * z))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.25e-104) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.15e-166) {
tmp = t * (0.3333333333333333 / (y * z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.25e-104: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 2.15e-166: tmp = t * (0.3333333333333333 / (y * z)) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.25e-104) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 2.15e-166) tmp = Float64(t * Float64(0.3333333333333333 / Float64(y * z))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.25e-104) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 2.15e-166) tmp = t * (0.3333333333333333 / (y * z)); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.25e-104], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e-166], N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{-104}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-166}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -2.2499999999999999e-104Initial program 97.8%
associate-+l-97.8%
sub-neg97.8%
sub-neg97.8%
distribute-neg-in97.8%
unsub-neg97.8%
neg-mul-197.8%
associate-*r/97.8%
associate-*l/97.7%
distribute-neg-frac97.7%
neg-mul-197.7%
times-frac98.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 85.4%
if -2.2499999999999999e-104 < y < 2.15e-166Initial program 92.0%
associate-+l-92.0%
sub-neg92.0%
sub-neg92.0%
distribute-neg-in92.0%
unsub-neg92.0%
neg-mul-192.0%
associate-*r/92.0%
associate-*l/92.0%
distribute-neg-frac92.0%
neg-mul-192.0%
times-frac90.4%
distribute-lft-out--90.4%
*-commutative90.4%
associate-/r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in x around 0 90.3%
Taylor expanded in z around 0 73.8%
Taylor expanded in y around 0 75.2%
associate-*r/75.3%
*-commutative75.3%
associate-*r/72.6%
Simplified72.6%
if 2.15e-166 < y Initial program 98.6%
Taylor expanded in t around 0 78.8%
Final simplification79.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.02e-104)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= y 2.2e-166)
(/ 0.3333333333333333 (/ (* y z) t))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e-104) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.2e-166) {
tmp = 0.3333333333333333 / ((y * z) / t);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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.02d-104)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if (y <= 2.2d-166) then
tmp = 0.3333333333333333d0 / ((y * z) / t)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e-104) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if (y <= 2.2e-166) {
tmp = 0.3333333333333333 / ((y * z) / t);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e-104: tmp = x + (y * (-0.3333333333333333 / z)) elif y <= 2.2e-166: tmp = 0.3333333333333333 / ((y * z) / t) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e-104) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (y <= 2.2e-166) tmp = Float64(0.3333333333333333 / Float64(Float64(y * z) / t)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.02e-104) tmp = x + (y * (-0.3333333333333333 / z)); elseif (y <= 2.2e-166) tmp = 0.3333333333333333 / ((y * z) / t); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e-104], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-166], N[(0.3333333333333333 / N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-104}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-166}:\\
\;\;\;\;\frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -1.02000000000000001e-104Initial program 97.8%
associate-+l-97.8%
sub-neg97.8%
sub-neg97.8%
distribute-neg-in97.8%
unsub-neg97.8%
neg-mul-197.8%
associate-*r/97.8%
associate-*l/97.7%
distribute-neg-frac97.7%
neg-mul-197.7%
times-frac98.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 85.4%
if -1.02000000000000001e-104 < y < 2.2000000000000001e-166Initial program 92.0%
associate-+l-92.0%
sub-neg92.0%
sub-neg92.0%
distribute-neg-in92.0%
unsub-neg92.0%
neg-mul-192.0%
associate-*r/92.0%
associate-*l/92.0%
distribute-neg-frac92.0%
neg-mul-192.0%
times-frac90.4%
distribute-lft-out--90.4%
*-commutative90.4%
associate-/r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in x around 0 90.3%
Taylor expanded in z around 0 73.8%
Taylor expanded in y around 0 75.2%
associate-*r/75.3%
associate-/l*75.3%
Simplified75.3%
if 2.2000000000000001e-166 < y Initial program 98.6%
Taylor expanded in t around 0 78.8%
Final simplification80.4%
(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 96.5%
associate-+l-96.5%
sub-neg96.5%
sub-neg96.5%
distribute-neg-in96.5%
unsub-neg96.5%
neg-mul-196.5%
associate-*r/96.5%
associate-*l/96.5%
distribute-neg-frac96.5%
neg-mul-196.5%
times-frac96.0%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (+ x (/ -0.3333333333333333 (/ z (- y (/ t y))))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 / (z / (y - (t / 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 + ((-0.3333333333333333d0) / (z / (y - (t / y))))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 / (z / (y - (t / y))));
}
def code(x, y, z, t): return x + (-0.3333333333333333 / (z / (y - (t / y))))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 / Float64(z / Float64(y - Float64(t / y))))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 / (z / (y - (t / y)))); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 / N[(z / N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-0.3333333333333333}{\frac{z}{y - \frac{t}{y}}}
\end{array}
Initial program 96.5%
associate-+l-96.5%
sub-neg96.5%
sub-neg96.5%
distribute-neg-in96.5%
unsub-neg96.5%
neg-mul-196.5%
associate-*r/96.5%
associate-*l/96.5%
distribute-neg-frac96.5%
neg-mul-196.5%
times-frac96.0%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in x around 0 96.4%
clear-num96.3%
un-div-inv96.4%
Applied egg-rr96.4%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.55e+101) x (if (<= z 2.1e+62) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+101) {
tmp = x;
} else if (z <= 2.1e+62) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = 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 (z <= (-1.55d+101)) then
tmp = x
else if (z <= 2.1d+62) then
tmp = y * ((-0.3333333333333333d0) / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+101) {
tmp = x;
} else if (z <= 2.1e+62) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+101: tmp = x elif z <= 2.1e+62: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+101) tmp = x; elseif (z <= 2.1e+62) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.55e+101) tmp = x; elseif (z <= 2.1e+62) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+101], x, If[LessEqual[z, 2.1e+62], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+101}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+62}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.55e101 or 2.1e62 < z Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
distribute-neg-frac97.7%
neg-mul-197.7%
*-commutative97.7%
times-frac97.7%
remove-double-neg97.7%
fma-def97.7%
metadata-eval97.7%
associate-*l*97.8%
associate-/r*98.8%
associate-/l/98.9%
Simplified98.9%
Taylor expanded in x around inf 64.1%
if -1.55e101 < z < 2.1e62Initial program 95.8%
Taylor expanded in z around 0 88.4%
Taylor expanded in t around 0 47.2%
*-commutative47.2%
Simplified47.2%
associate-/l*47.2%
div-inv47.2%
div-inv47.2%
metadata-eval47.2%
Applied egg-rr47.2%
Taylor expanded in z around 0 47.3%
Final simplification53.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e+96) x (if (<= z 1.2e+61) (/ (/ y z) -3.0) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+96) {
tmp = x;
} else if (z <= 1.2e+61) {
tmp = (y / z) / -3.0;
} else {
tmp = 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 (z <= (-2.2d+96)) then
tmp = x
else if (z <= 1.2d+61) then
tmp = (y / z) / (-3.0d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+96) {
tmp = x;
} else if (z <= 1.2e+61) {
tmp = (y / z) / -3.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+96: tmp = x elif z <= 1.2e+61: tmp = (y / z) / -3.0 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+96) tmp = x; elseif (z <= 1.2e+61) tmp = Float64(Float64(y / z) / -3.0); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e+96) tmp = x; elseif (z <= 1.2e+61) tmp = (y / z) / -3.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+96], x, If[LessEqual[z, 1.2e+61], N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+61}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.1999999999999999e96 or 1.1999999999999999e61 < z Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
distribute-neg-frac97.7%
neg-mul-197.7%
*-commutative97.7%
times-frac97.7%
remove-double-neg97.7%
fma-def97.7%
metadata-eval97.7%
associate-*l*97.8%
associate-/r*98.8%
associate-/l/98.9%
Simplified98.9%
Taylor expanded in x around inf 64.1%
if -2.1999999999999999e96 < z < 1.1999999999999999e61Initial program 95.8%
Taylor expanded in z around 0 88.4%
Taylor expanded in t around 0 47.2%
*-commutative47.2%
Simplified47.2%
associate-/l*47.2%
div-inv47.2%
div-inv47.2%
metadata-eval47.2%
Applied egg-rr47.2%
un-div-inv47.2%
associate-/r*47.3%
Applied egg-rr47.3%
Final simplification53.4%
(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 96.5%
associate-+l-96.5%
sub-neg96.5%
sub-neg96.5%
distribute-neg-in96.5%
distribute-neg-frac96.5%
neg-mul-196.5%
*-commutative96.5%
times-frac96.5%
remove-double-neg96.5%
fma-def96.5%
metadata-eval96.5%
associate-*l*96.5%
associate-/r*97.1%
associate-/l/97.1%
Simplified97.1%
Taylor expanded in x around inf 31.7%
Final simplification31.7%
(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 2023215
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))