
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (y * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 89.2%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in y around 0 89.2%
associate-*r/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.5e+131)
(+ x y)
(if (<= z -7.5e+49)
(- x (* t (/ y z)))
(if (<= z -6.7e-32)
(+ x y)
(if (<= z 2.9e-217)
(+ x (/ t (/ a y)))
(if (<= z 6.8e-162)
(- x (/ (* y t) z))
(if (<= z 2.45e-27) (+ x (/ y (/ a t))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+131) {
tmp = x + y;
} else if (z <= -7.5e+49) {
tmp = x - (t * (y / z));
} else if (z <= -6.7e-32) {
tmp = x + y;
} else if (z <= 2.9e-217) {
tmp = x + (t / (a / y));
} else if (z <= 6.8e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 2.45e-27) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d+131)) then
tmp = x + y
else if (z <= (-7.5d+49)) then
tmp = x - (t * (y / z))
else if (z <= (-6.7d-32)) then
tmp = x + y
else if (z <= 2.9d-217) then
tmp = x + (t / (a / y))
else if (z <= 6.8d-162) then
tmp = x - ((y * t) / z)
else if (z <= 2.45d-27) then
tmp = x + (y / (a / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+131) {
tmp = x + y;
} else if (z <= -7.5e+49) {
tmp = x - (t * (y / z));
} else if (z <= -6.7e-32) {
tmp = x + y;
} else if (z <= 2.9e-217) {
tmp = x + (t / (a / y));
} else if (z <= 6.8e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 2.45e-27) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+131: tmp = x + y elif z <= -7.5e+49: tmp = x - (t * (y / z)) elif z <= -6.7e-32: tmp = x + y elif z <= 2.9e-217: tmp = x + (t / (a / y)) elif z <= 6.8e-162: tmp = x - ((y * t) / z) elif z <= 2.45e-27: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+131) tmp = Float64(x + y); elseif (z <= -7.5e+49) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= -6.7e-32) tmp = Float64(x + y); elseif (z <= 2.9e-217) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 6.8e-162) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 2.45e-27) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+131) tmp = x + y; elseif (z <= -7.5e+49) tmp = x - (t * (y / z)); elseif (z <= -6.7e-32) tmp = x + y; elseif (z <= 2.9e-217) tmp = x + (t / (a / y)); elseif (z <= 6.8e-162) tmp = x - ((y * t) / z); elseif (z <= 2.45e-27) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+131], N[(x + y), $MachinePrecision], If[LessEqual[z, -7.5e+49], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.7e-32], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.9e-217], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-162], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-27], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+131}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+49}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -6.7 \cdot 10^{-32}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-217}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-162}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-27}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.4999999999999999e131 or -7.4999999999999995e49 < z < -6.7e-32 or 2.44999999999999988e-27 < z Initial program 82.8%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in z around inf 77.2%
if -3.4999999999999999e131 < z < -7.4999999999999995e49Initial program 93.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 87.4%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around 0 87.9%
associate-*r/87.9%
associate-*r*87.9%
neg-mul-187.9%
Simplified87.9%
associate-/l*94.1%
associate-/r/94.1%
add-sqr-sqrt47.5%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod20.0%
add-sqr-sqrt66.8%
Applied egg-rr66.8%
frac-2neg66.8%
distribute-frac-neg66.8%
add-sqr-sqrt20.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod47.5%
add-sqr-sqrt94.1%
frac-2neg94.1%
cancel-sign-sub-inv94.1%
Applied egg-rr94.1%
if -6.7e-32 < z < 2.89999999999999982e-217Initial program 94.7%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in y around 0 94.7%
associate-*r/94.7%
Simplified94.7%
Taylor expanded in z around 0 83.3%
associate-*r/78.3%
*-commutative78.3%
associate-/l*83.5%
Applied egg-rr83.5%
if 2.89999999999999982e-217 < z < 6.8e-162Initial program 99.8%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in a around 0 80.1%
associate-/l*75.8%
Simplified75.8%
Taylor expanded in z around 0 80.1%
associate-*r/80.1%
associate-*r*80.1%
neg-mul-180.1%
Simplified80.1%
if 6.8e-162 < z < 2.44999999999999988e-27Initial program 96.1%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around 0 72.4%
associate-/l*76.1%
Simplified76.1%
Final simplification80.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ z (- z t))))))
(if (<= z -6.4e-28)
t_1
(if (<= z 2.9e-217)
(+ x (/ t (/ a y)))
(if (<= z 3e-162)
(- x (/ (* y t) z))
(if (<= z 1.8e-45) (+ x (/ y (/ a t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (z / (z - t)));
double tmp;
if (z <= -6.4e-28) {
tmp = t_1;
} else if (z <= 2.9e-217) {
tmp = x + (t / (a / y));
} else if (z <= 3e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 1.8e-45) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y / (z / (z - t)))
if (z <= (-6.4d-28)) then
tmp = t_1
else if (z <= 2.9d-217) then
tmp = x + (t / (a / y))
else if (z <= 3d-162) then
tmp = x - ((y * t) / z)
else if (z <= 1.8d-45) then
tmp = x + (y / (a / t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (z / (z - t)));
double tmp;
if (z <= -6.4e-28) {
tmp = t_1;
} else if (z <= 2.9e-217) {
tmp = x + (t / (a / y));
} else if (z <= 3e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 1.8e-45) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (z / (z - t))) tmp = 0 if z <= -6.4e-28: tmp = t_1 elif z <= 2.9e-217: tmp = x + (t / (a / y)) elif z <= 3e-162: tmp = x - ((y * t) / z) elif z <= 1.8e-45: tmp = x + (y / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(z / Float64(z - t)))) tmp = 0.0 if (z <= -6.4e-28) tmp = t_1; elseif (z <= 2.9e-217) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 3e-162) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 1.8e-45) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (z / (z - t))); tmp = 0.0; if (z <= -6.4e-28) tmp = t_1; elseif (z <= 2.9e-217) tmp = x + (t / (a / y)); elseif (z <= 3e-162) tmp = x - ((y * t) / z); elseif (z <= 1.8e-45) tmp = x + (y / (a / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e-28], t$95$1, If[LessEqual[z, 2.9e-217], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-162], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-45], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-217}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-162}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-45}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.39999999999999964e-28 or 1.8e-45 < z Initial program 84.7%
associate-*l/93.5%
Simplified93.5%
Taylor expanded in y around 0 84.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in a around 0 74.7%
*-commutative74.7%
associate-/l*88.0%
Simplified88.0%
if -6.39999999999999964e-28 < z < 2.89999999999999982e-217Initial program 93.5%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in y around 0 93.5%
associate-*r/94.9%
Simplified94.9%
Taylor expanded in z around 0 82.5%
associate-*r/76.3%
*-commutative76.3%
associate-/l*82.6%
Applied egg-rr82.6%
if 2.89999999999999982e-217 < z < 2.99999999999999999e-162Initial program 99.8%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in a around 0 80.1%
associate-/l*75.8%
Simplified75.8%
Taylor expanded in z around 0 80.1%
associate-*r/80.1%
associate-*r*80.1%
neg-mul-180.1%
Simplified80.1%
if 2.99999999999999999e-162 < z < 1.8e-45Initial program 95.8%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around 0 74.3%
associate-/l*78.4%
Simplified78.4%
Final simplification85.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e-107)
(+ x (/ y (/ (- z a) z)))
(if (<= z 2.9e-217)
(+ x (/ t (/ a y)))
(if (<= z 3e-162)
(- x (/ (* y t) z))
(if (<= z 4.3e-45) (+ x (/ y (/ a t))) (+ x (/ y (/ z (- z t)))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-107) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.9e-217) {
tmp = x + (t / (a / y));
} else if (z <= 3e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 4.3e-45) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.8d-107)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 2.9d-217) then
tmp = x + (t / (a / y))
else if (z <= 3d-162) then
tmp = x - ((y * t) / z)
else if (z <= 4.3d-45) then
tmp = x + (y / (a / t))
else
tmp = x + (y / (z / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-107) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.9e-217) {
tmp = x + (t / (a / y));
} else if (z <= 3e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 4.3e-45) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-107: tmp = x + (y / ((z - a) / z)) elif z <= 2.9e-217: tmp = x + (t / (a / y)) elif z <= 3e-162: tmp = x - ((y * t) / z) elif z <= 4.3e-45: tmp = x + (y / (a / t)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e-107) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 2.9e-217) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 3e-162) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 4.3e-45) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.8e-107) tmp = x + (y / ((z - a) / z)); elseif (z <= 2.9e-217) tmp = x + (t / (a / y)); elseif (z <= 3e-162) tmp = x - ((y * t) / z); elseif (z <= 4.3e-45) tmp = x + (y / (a / t)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e-107], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-217], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-162], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e-45], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-107}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-217}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-162}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-45}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -4.79999999999999989e-107Initial program 85.1%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in t around 0 76.8%
associate-/l*87.2%
Simplified87.2%
if -4.79999999999999989e-107 < z < 2.89999999999999982e-217Initial program 94.0%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in y around 0 94.0%
associate-*r/94.1%
Simplified94.1%
Taylor expanded in z around 0 84.5%
associate-*r/78.8%
*-commutative78.8%
associate-/l*84.6%
Applied egg-rr84.6%
if 2.89999999999999982e-217 < z < 2.99999999999999999e-162Initial program 99.8%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in a around 0 80.1%
associate-/l*75.8%
Simplified75.8%
Taylor expanded in z around 0 80.1%
associate-*r/80.1%
associate-*r*80.1%
neg-mul-180.1%
Simplified80.1%
if 2.99999999999999999e-162 < z < 4.2999999999999999e-45Initial program 95.8%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around 0 74.3%
associate-/l*78.4%
Simplified78.4%
if 4.2999999999999999e-45 < z Initial program 84.9%
associate-*l/91.9%
Simplified91.9%
Taylor expanded in y around 0 84.9%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in a around 0 74.2%
*-commutative74.2%
associate-/l*87.9%
Simplified87.9%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ y a) (- t z)))))
(if (<= z -4.55e-107)
(+ x (/ y (/ (- z a) z)))
(if (<= z 2.9e-217)
t_1
(if (<= z 3.1e-162)
(- x (/ (* y t) z))
(if (<= z 1.42e-106) t_1 (+ x (/ y (/ z (- z t))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y / a) * (t - z));
double tmp;
if (z <= -4.55e-107) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.9e-217) {
tmp = t_1;
} else if (z <= 3.1e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 1.42e-106) {
tmp = t_1;
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y / a) * (t - z))
if (z <= (-4.55d-107)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 2.9d-217) then
tmp = t_1
else if (z <= 3.1d-162) then
tmp = x - ((y * t) / z)
else if (z <= 1.42d-106) then
tmp = t_1
else
tmp = x + (y / (z / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y / a) * (t - z));
double tmp;
if (z <= -4.55e-107) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.9e-217) {
tmp = t_1;
} else if (z <= 3.1e-162) {
tmp = x - ((y * t) / z);
} else if (z <= 1.42e-106) {
tmp = t_1;
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y / a) * (t - z)) tmp = 0 if z <= -4.55e-107: tmp = x + (y / ((z - a) / z)) elif z <= 2.9e-217: tmp = t_1 elif z <= 3.1e-162: tmp = x - ((y * t) / z) elif z <= 1.42e-106: tmp = t_1 else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y / a) * Float64(t - z))) tmp = 0.0 if (z <= -4.55e-107) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 2.9e-217) tmp = t_1; elseif (z <= 3.1e-162) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 1.42e-106) tmp = t_1; else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y / a) * (t - z)); tmp = 0.0; if (z <= -4.55e-107) tmp = x + (y / ((z - a) / z)); elseif (z <= 2.9e-217) tmp = t_1; elseif (z <= 3.1e-162) tmp = x - ((y * t) / z); elseif (z <= 1.42e-106) tmp = t_1; else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.55e-107], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-217], t$95$1, If[LessEqual[z, 3.1e-162], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e-106], t$95$1, N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;z \leq -4.55 \cdot 10^{-107}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-162}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -4.5500000000000001e-107Initial program 85.1%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in t around 0 76.8%
associate-/l*87.2%
Simplified87.2%
if -4.5500000000000001e-107 < z < 2.89999999999999982e-217 or 3.0999999999999999e-162 < z < 1.4199999999999999e-106Initial program 94.8%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 87.3%
associate-*r/87.3%
neg-mul-187.3%
Simplified87.3%
if 2.89999999999999982e-217 < z < 3.0999999999999999e-162Initial program 99.8%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in a around 0 80.1%
associate-/l*75.8%
Simplified75.8%
Taylor expanded in z around 0 80.1%
associate-*r/80.1%
associate-*r*80.1%
neg-mul-180.1%
Simplified80.1%
if 1.4199999999999999e-106 < z Initial program 86.0%
associate-*l/91.9%
Simplified91.9%
Taylor expanded in y around 0 86.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in a around 0 74.4%
*-commutative74.4%
associate-/l*86.0%
Simplified86.0%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4e+131)
(+ x y)
(if (<= z -2.9e+47)
(- x (* t (/ y z)))
(if (<= z -5.1e-27)
(+ x y)
(if (<= z 1.06e-27) (+ x (/ y (/ a t))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+131) {
tmp = x + y;
} else if (z <= -2.9e+47) {
tmp = x - (t * (y / z));
} else if (z <= -5.1e-27) {
tmp = x + y;
} else if (z <= 1.06e-27) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d+131)) then
tmp = x + y
else if (z <= (-2.9d+47)) then
tmp = x - (t * (y / z))
else if (z <= (-5.1d-27)) then
tmp = x + y
else if (z <= 1.06d-27) then
tmp = x + (y / (a / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+131) {
tmp = x + y;
} else if (z <= -2.9e+47) {
tmp = x - (t * (y / z));
} else if (z <= -5.1e-27) {
tmp = x + y;
} else if (z <= 1.06e-27) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e+131: tmp = x + y elif z <= -2.9e+47: tmp = x - (t * (y / z)) elif z <= -5.1e-27: tmp = x + y elif z <= 1.06e-27: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+131) tmp = Float64(x + y); elseif (z <= -2.9e+47) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= -5.1e-27) tmp = Float64(x + y); elseif (z <= 1.06e-27) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e+131) tmp = x + y; elseif (z <= -2.9e+47) tmp = x - (t * (y / z)); elseif (z <= -5.1e-27) tmp = x + y; elseif (z <= 1.06e-27) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+131], N[(x + y), $MachinePrecision], If[LessEqual[z, -2.9e+47], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.1e-27], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.06e-27], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+131}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+47}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-27}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-27}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.9999999999999996e131 or -2.8999999999999998e47 < z < -5.0999999999999999e-27 or 1.05999999999999998e-27 < z Initial program 83.3%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in z around inf 77.7%
if -3.9999999999999996e131 < z < -2.8999999999999998e47Initial program 93.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 87.4%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around 0 87.9%
associate-*r/87.9%
associate-*r*87.9%
neg-mul-187.9%
Simplified87.9%
associate-/l*94.1%
associate-/r/94.1%
add-sqr-sqrt47.5%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod20.0%
add-sqr-sqrt66.8%
Applied egg-rr66.8%
frac-2neg66.8%
distribute-frac-neg66.8%
add-sqr-sqrt20.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod47.5%
add-sqr-sqrt94.1%
frac-2neg94.1%
cancel-sign-sub-inv94.1%
Applied egg-rr94.1%
if -5.0999999999999999e-27 < z < 1.05999999999999998e-27Initial program 94.9%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around 0 72.2%
associate-/l*77.1%
Simplified77.1%
Final simplification78.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.6e+72)
(- x (* t (/ y z)))
(if (<= t 6.9e+50)
(+ x (* z (/ y (- z a))))
(if (<= t 5.2e+124)
(+ x (* y (/ t a)))
(if (<= t 1.7e+185) (- x (/ t (/ z y))) (+ x (/ t (/ a y))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.6e+72) {
tmp = x - (t * (y / z));
} else if (t <= 6.9e+50) {
tmp = x + (z * (y / (z - a)));
} else if (t <= 5.2e+124) {
tmp = x + (y * (t / a));
} else if (t <= 1.7e+185) {
tmp = x - (t / (z / y));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.6d+72)) then
tmp = x - (t * (y / z))
else if (t <= 6.9d+50) then
tmp = x + (z * (y / (z - a)))
else if (t <= 5.2d+124) then
tmp = x + (y * (t / a))
else if (t <= 1.7d+185) then
tmp = x - (t / (z / y))
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.6e+72) {
tmp = x - (t * (y / z));
} else if (t <= 6.9e+50) {
tmp = x + (z * (y / (z - a)));
} else if (t <= 5.2e+124) {
tmp = x + (y * (t / a));
} else if (t <= 1.7e+185) {
tmp = x - (t / (z / y));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.6e+72: tmp = x - (t * (y / z)) elif t <= 6.9e+50: tmp = x + (z * (y / (z - a))) elif t <= 5.2e+124: tmp = x + (y * (t / a)) elif t <= 1.7e+185: tmp = x - (t / (z / y)) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.6e+72) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (t <= 6.9e+50) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (t <= 5.2e+124) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t <= 1.7e+185) tmp = Float64(x - Float64(t / Float64(z / y))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.6e+72) tmp = x - (t * (y / z)); elseif (t <= 6.9e+50) tmp = x + (z * (y / (z - a))); elseif (t <= 5.2e+124) tmp = x + (y * (t / a)); elseif (t <= 1.7e+185) tmp = x - (t / (z / y)); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.6e+72], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.9e+50], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e+124], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+185], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+72}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 6.9 \cdot 10^{+50}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+124}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+185}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -4.6e72Initial program 85.2%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in a around 0 68.1%
associate-/l*76.3%
Simplified76.3%
Taylor expanded in z around 0 68.1%
associate-*r/68.1%
associate-*r*68.1%
neg-mul-168.1%
Simplified68.1%
associate-/l*71.9%
associate-/r/73.9%
add-sqr-sqrt31.5%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod20.4%
add-sqr-sqrt34.1%
Applied egg-rr34.1%
frac-2neg34.1%
distribute-frac-neg34.1%
add-sqr-sqrt20.4%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod31.5%
add-sqr-sqrt73.9%
frac-2neg73.9%
cancel-sign-sub-inv73.9%
Applied egg-rr73.9%
if -4.6e72 < t < 6.90000000000000032e50Initial program 90.1%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in t around 0 80.1%
associate-/l*89.3%
Simplified89.3%
associate-/r/85.7%
Applied egg-rr85.7%
if 6.90000000000000032e50 < t < 5.2000000000000001e124Initial program 90.1%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 90.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around 0 84.5%
if 5.2000000000000001e124 < t < 1.70000000000000009e185Initial program 89.0%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in a around 0 77.9%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in z around 0 77.6%
associate-*r/77.6%
associate-*r*77.6%
neg-mul-177.6%
Simplified77.6%
associate-/l*56.9%
associate-/r/77.6%
add-sqr-sqrt22.2%
sqrt-unprod23.6%
sqr-neg23.6%
sqrt-unprod12.0%
add-sqr-sqrt12.3%
Applied egg-rr12.3%
frac-2neg12.3%
distribute-frac-neg12.3%
add-sqr-sqrt12.0%
sqrt-unprod23.6%
sqr-neg23.6%
sqrt-unprod22.2%
add-sqr-sqrt77.6%
frac-2neg77.6%
cancel-sign-sub-inv77.6%
Applied egg-rr77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/l*77.8%
Simplified77.8%
if 1.70000000000000009e185 < t Initial program 89.8%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in y around 0 89.8%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around 0 59.9%
associate-*r/56.6%
*-commutative56.6%
associate-/l*65.6%
Applied egg-rr65.6%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e-64) (not (<= t 4.2e+33))) (+ x (/ y (/ (- z a) (- t)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e-64) || !(t <= 4.2e+33)) {
tmp = x + (y / ((z - a) / -t));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4d-64)) .or. (.not. (t <= 4.2d+33))) then
tmp = x + (y / ((z - a) / -t))
else
tmp = x + (y / ((z - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e-64) || !(t <= 4.2e+33)) {
tmp = x + (y / ((z - a) / -t));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e-64) or not (t <= 4.2e+33): tmp = x + (y / ((z - a) / -t)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e-64) || !(t <= 4.2e+33)) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(-t)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4e-64) || ~((t <= 4.2e+33))) tmp = x + (y / ((z - a) / -t)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e-64], N[Not[LessEqual[t, 4.2e+33]], $MachinePrecision]], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-64} \lor \neg \left(t \leq 4.2 \cdot 10^{+33}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{-t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -3.99999999999999986e-64 or 4.2000000000000001e33 < t Initial program 89.8%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in t around inf 86.1%
associate-*r/86.1%
mul-1-neg86.1%
distribute-rgt-neg-out86.1%
associate-/l*88.9%
Simplified88.9%
if -3.99999999999999986e-64 < t < 4.2000000000000001e33Initial program 88.6%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in t around 0 81.1%
associate-/l*91.7%
Simplified91.7%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.2e-28) (+ x y) (if (<= z 6.6e-29) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-28) {
tmp = x + y;
} else if (z <= 6.6e-29) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.2d-28)) then
tmp = x + y
else if (z <= 6.6d-29) then
tmp = x + (y * (t / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-28) {
tmp = x + y;
} else if (z <= 6.6e-29) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.2e-28: tmp = x + y elif z <= 6.6e-29: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e-28) tmp = Float64(x + y); elseif (z <= 6.6e-29) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.2e-28) tmp = x + y; elseif (z <= 6.6e-29) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e-28], N[(x + y), $MachinePrecision], If[LessEqual[z, 6.6e-29], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-28}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-29}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.19999999999999982e-28 or 6.60000000000000055e-29 < z Initial program 84.5%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in z around inf 76.6%
if -3.19999999999999982e-28 < z < 6.60000000000000055e-29Initial program 94.9%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around 0 94.9%
associate-*r/94.1%
Simplified94.1%
Taylor expanded in z around 0 76.3%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e-26) (+ x y) (if (<= z 3.8e-27) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-26) {
tmp = x + y;
} else if (z <= 3.8e-27) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.2d-26)) then
tmp = x + y
else if (z <= 3.8d-27) then
tmp = x + (y / (a / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-26) {
tmp = x + y;
} else if (z <= 3.8e-27) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e-26: tmp = x + y elif z <= 3.8e-27: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e-26) tmp = Float64(x + y); elseif (z <= 3.8e-27) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e-26) tmp = x + y; elseif (z <= 3.8e-27) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e-26], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.8e-27], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-26}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.2000000000000002e-26 or 3.8e-27 < z Initial program 84.5%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in z around inf 76.6%
if -5.2000000000000002e-26 < z < 3.8e-27Initial program 94.9%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around 0 72.2%
associate-/l*77.1%
Simplified77.1%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e-32) (+ x y) (if (<= z 1.1e-28) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-32) {
tmp = x + y;
} else if (z <= 1.1e-28) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d-32)) then
tmp = x + y
else if (z <= 1.1d-28) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-32) {
tmp = x + y;
} else if (z <= 1.1e-28) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e-32: tmp = x + y elif z <= 1.1e-28: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-32) tmp = Float64(x + y); elseif (z <= 1.1e-28) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e-32) tmp = x + y; elseif (z <= 1.1e-28) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-32], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.1e-28], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-32}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.00000000000000011e-32 or 1.09999999999999998e-28 < z Initial program 84.0%
associate-*l/93.5%
Simplified93.5%
Taylor expanded in z around inf 76.2%
if -2.00000000000000011e-32 < z < 1.09999999999999998e-28Initial program 95.7%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in a around 0 53.1%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around 0 51.0%
associate-*r/51.0%
associate-*r*51.0%
neg-mul-151.0%
Simplified51.0%
associate-/l*47.5%
associate-/r/46.2%
add-sqr-sqrt24.6%
sqrt-unprod40.9%
sqr-neg40.9%
sqrt-unprod14.7%
add-sqr-sqrt30.4%
Applied egg-rr30.4%
Taylor expanded in x around inf 48.7%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.2%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in a around 0 65.0%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in z around 0 53.8%
associate-*r/53.8%
associate-*r*53.8%
neg-mul-153.8%
Simplified53.8%
associate-/l*53.3%
associate-/r/52.5%
add-sqr-sqrt25.8%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod20.1%
add-sqr-sqrt38.8%
Applied egg-rr38.8%
Taylor expanded in x around inf 47.9%
Final simplification47.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023266
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))