
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / 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)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / 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)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= y -3.3e-74) (+ x (/ y (/ a (- z t)))) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.3e-74) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + ((z - t) * (y / a));
}
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 (y <= (-3.3d-74)) then
tmp = x + (y / (a / (z - t)))
else
tmp = x + ((z - t) * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.3e-74) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.3e-74: tmp = x + (y / (a / (z - t))) else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.3e-74) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.3e-74) tmp = x + (y / (a / (z - t))); else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.3e-74], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-74}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -3.29999999999999996e-74Initial program 88.3%
associate-/l*99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
if -3.29999999999999996e-74 < y Initial program 95.0%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in y around 0 95.0%
*-commutative95.0%
associate-*r/98.6%
Simplified98.6%
Final simplification99.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (/ a (- z t)))) (t_2 (/ (* y (- z t)) a)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e+91) t_2 (if (<= t_2 1e+247) (- x (/ t (/ a y))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a / (z - t));
double t_2 = (y * (z - t)) / a;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e+91) {
tmp = t_2;
} else if (t_2 <= 1e+247) {
tmp = x - (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a / (z - t));
double t_2 = (y * (z - t)) / a;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -5e+91) {
tmp = t_2;
} else if (t_2 <= 1e+247) {
tmp = x - (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a / (z - t)) t_2 = (y * (z - t)) / a tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -5e+91: tmp = t_2 elif t_2 <= 1e+247: tmp = x - (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a / Float64(z - t))) t_2 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e+91) tmp = t_2; elseif (t_2 <= 1e+247) tmp = Float64(x - Float64(t / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a / (z - t)); t_2 = (y * (z - t)) / a; tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -5e+91) tmp = t_2; elseif (t_2 <= 1e+247) tmp = x - (t / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e+91], t$95$2, If[LessEqual[t$95$2, 1e+247], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{a}{z - t}}\\
t_2 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+91}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 10^{+247}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0 or 9.99999999999999952e246 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 82.9%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in a around 0 82.7%
Taylor expanded in a around 0 82.9%
associate-*r/97.3%
*-commutative97.3%
Applied egg-rr97.3%
*-commutative97.3%
clear-num97.3%
un-div-inv97.4%
Applied egg-rr97.4%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < -5.0000000000000002e91Initial program 99.7%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in a around 0 96.4%
Taylor expanded in a around 0 83.5%
if -5.0000000000000002e91 < (/.f64 (*.f64 y (-.f64 z t)) a) < 9.99999999999999952e246Initial program 99.7%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
associate-*r/96.4%
Simplified96.4%
Taylor expanded in z around 0 88.0%
associate-*l/82.3%
*-commutative82.3%
neg-mul-182.3%
sub-neg82.3%
*-commutative82.3%
associate-*l/88.0%
associate-*r/86.1%
Simplified86.1%
clear-num85.5%
un-div-inv86.4%
Applied egg-rr86.4%
Final simplification90.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (/ a (- z t)))) (t_2 (/ (* y (- z t)) a)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e+106) t_2 (if (<= t_2 1e+247) (- x (/ (* y t) a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a / (z - t));
double t_2 = (y * (z - t)) / a;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e+106) {
tmp = t_2;
} else if (t_2 <= 1e+247) {
tmp = x - ((y * t) / a);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a / (z - t));
double t_2 = (y * (z - t)) / a;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e+106) {
tmp = t_2;
} else if (t_2 <= 1e+247) {
tmp = x - ((y * t) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a / (z - t)) t_2 = (y * (z - t)) / a tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e+106: tmp = t_2 elif t_2 <= 1e+247: tmp = x - ((y * t) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a / Float64(z - t))) t_2 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e+106) tmp = t_2; elseif (t_2 <= 1e+247) tmp = Float64(x - Float64(Float64(y * t) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a / (z - t)); t_2 = (y * (z - t)) / a; tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e+106) tmp = t_2; elseif (t_2 <= 1e+247) tmp = x - ((y * t) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e+106], t$95$2, If[LessEqual[t$95$2, 1e+247], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{a}{z - t}}\\
t_2 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 10^{+247}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0 or 9.99999999999999952e246 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 82.9%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in a around 0 82.7%
Taylor expanded in a around 0 82.9%
associate-*r/97.3%
*-commutative97.3%
Applied egg-rr97.3%
*-commutative97.3%
clear-num97.3%
un-div-inv97.4%
Applied egg-rr97.4%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < -1.00000000000000009e106Initial program 99.6%
associate-/l*67.4%
Simplified67.4%
Taylor expanded in a around 0 96.2%
Taylor expanded in a around 0 82.9%
if -1.00000000000000009e106 < (/.f64 (*.f64 y (-.f64 z t)) a) < 9.99999999999999952e246Initial program 99.7%
associate-/l*92.4%
Simplified92.4%
Taylor expanded in z around 0 88.1%
+-commutative88.1%
associate-*r/88.1%
mul-1-neg88.1%
distribute-lft-neg-out88.1%
*-commutative88.1%
Simplified88.1%
Final simplification91.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (- (/ y a)))) (t_2 (* z (/ y a))))
(if (<= z -3.2e+23)
t_2
(if (<= z -1.35e-108)
t_1
(if (<= z -6e-272)
x
(if (<= z 1.8e-171)
(* y (/ (- t) a))
(if (<= z 7.8e-10) x (if (<= z 6.8e+86) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * -(y / a);
double t_2 = z * (y / a);
double tmp;
if (z <= -3.2e+23) {
tmp = t_2;
} else if (z <= -1.35e-108) {
tmp = t_1;
} else if (z <= -6e-272) {
tmp = x;
} else if (z <= 1.8e-171) {
tmp = y * (-t / a);
} else if (z <= 7.8e-10) {
tmp = x;
} else if (z <= 6.8e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = t * -(y / a)
t_2 = z * (y / a)
if (z <= (-3.2d+23)) then
tmp = t_2
else if (z <= (-1.35d-108)) then
tmp = t_1
else if (z <= (-6d-272)) then
tmp = x
else if (z <= 1.8d-171) then
tmp = y * (-t / a)
else if (z <= 7.8d-10) then
tmp = x
else if (z <= 6.8d+86) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * -(y / a);
double t_2 = z * (y / a);
double tmp;
if (z <= -3.2e+23) {
tmp = t_2;
} else if (z <= -1.35e-108) {
tmp = t_1;
} else if (z <= -6e-272) {
tmp = x;
} else if (z <= 1.8e-171) {
tmp = y * (-t / a);
} else if (z <= 7.8e-10) {
tmp = x;
} else if (z <= 6.8e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * -(y / a) t_2 = z * (y / a) tmp = 0 if z <= -3.2e+23: tmp = t_2 elif z <= -1.35e-108: tmp = t_1 elif z <= -6e-272: tmp = x elif z <= 1.8e-171: tmp = y * (-t / a) elif z <= 7.8e-10: tmp = x elif z <= 6.8e+86: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(-Float64(y / a))) t_2 = Float64(z * Float64(y / a)) tmp = 0.0 if (z <= -3.2e+23) tmp = t_2; elseif (z <= -1.35e-108) tmp = t_1; elseif (z <= -6e-272) tmp = x; elseif (z <= 1.8e-171) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (z <= 7.8e-10) tmp = x; elseif (z <= 6.8e+86) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * -(y / a); t_2 = z * (y / a); tmp = 0.0; if (z <= -3.2e+23) tmp = t_2; elseif (z <= -1.35e-108) tmp = t_1; elseif (z <= -6e-272) tmp = x; elseif (z <= 1.8e-171) tmp = y * (-t / a); elseif (z <= 7.8e-10) tmp = x; elseif (z <= 6.8e+86) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * (-N[(y / a), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+23], t$95$2, If[LessEqual[z, -1.35e-108], t$95$1, If[LessEqual[z, -6e-272], x, If[LessEqual[z, 1.8e-171], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e-10], x, If[LessEqual[z, 6.8e+86], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-\frac{y}{a}\right)\\
t_2 := z \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-272}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-171}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.2e23 or 6.7999999999999995e86 < z Initial program 91.5%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in a around 0 84.9%
Taylor expanded in z around inf 57.6%
*-commutative57.6%
associate-/l*62.3%
Applied egg-rr62.3%
if -3.2e23 < z < -1.35000000000000002e-108 or 7.7999999999999999e-10 < z < 6.7999999999999995e86Initial program 92.4%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in y around 0 92.4%
*-commutative92.4%
associate-*r/97.2%
Simplified97.2%
Taylor expanded in z around 0 71.6%
associate-*l/69.6%
*-commutative69.6%
neg-mul-169.6%
sub-neg69.6%
*-commutative69.6%
associate-*l/71.6%
associate-*r/81.8%
Simplified81.8%
Taylor expanded in x around 0 49.8%
associate-*r/49.8%
neg-mul-149.8%
distribute-rgt-neg-in49.8%
associate-/l*60.0%
Simplified60.0%
if -1.35000000000000002e-108 < z < -6.0000000000000006e-272 or 1.80000000000000002e-171 < z < 7.7999999999999999e-10Initial program 94.5%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around inf 56.7%
if -6.0000000000000006e-272 < z < 1.80000000000000002e-171Initial program 95.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 79.1%
Taylor expanded in t around inf 59.2%
mul-1-neg59.2%
*-commutative59.2%
distribute-rgt-neg-in59.2%
Simplified59.2%
frac-2neg59.2%
distribute-frac-neg59.2%
add-sqr-sqrt20.4%
sqrt-unprod16.3%
sqr-neg16.3%
sqrt-unprod0.9%
add-sqr-sqrt1.3%
remove-double-neg1.3%
distribute-rgt-neg-out1.3%
frac-2neg1.3%
associate-/l*1.3%
add-sqr-sqrt0.5%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod43.0%
add-sqr-sqrt63.5%
Applied egg-rr63.5%
Final simplification60.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t) a))) (t_2 (* z (/ y a))))
(if (<= z -1.16e-21)
t_2
(if (<= z -1.55e-108)
t_1
(if (<= z -2.5e-271)
x
(if (<= z 6.2e-171) t_1 (if (<= z 4.6e-10) x t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (-t / a);
double t_2 = z * (y / a);
double tmp;
if (z <= -1.16e-21) {
tmp = t_2;
} else if (z <= -1.55e-108) {
tmp = t_1;
} else if (z <= -2.5e-271) {
tmp = x;
} else if (z <= 6.2e-171) {
tmp = t_1;
} else if (z <= 4.6e-10) {
tmp = x;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = y * (-t / a)
t_2 = z * (y / a)
if (z <= (-1.16d-21)) then
tmp = t_2
else if (z <= (-1.55d-108)) then
tmp = t_1
else if (z <= (-2.5d-271)) then
tmp = x
else if (z <= 6.2d-171) then
tmp = t_1
else if (z <= 4.6d-10) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (-t / a);
double t_2 = z * (y / a);
double tmp;
if (z <= -1.16e-21) {
tmp = t_2;
} else if (z <= -1.55e-108) {
tmp = t_1;
} else if (z <= -2.5e-271) {
tmp = x;
} else if (z <= 6.2e-171) {
tmp = t_1;
} else if (z <= 4.6e-10) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (-t / a) t_2 = z * (y / a) tmp = 0 if z <= -1.16e-21: tmp = t_2 elif z <= -1.55e-108: tmp = t_1 elif z <= -2.5e-271: tmp = x elif z <= 6.2e-171: tmp = t_1 elif z <= 4.6e-10: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(-t) / a)) t_2 = Float64(z * Float64(y / a)) tmp = 0.0 if (z <= -1.16e-21) tmp = t_2; elseif (z <= -1.55e-108) tmp = t_1; elseif (z <= -2.5e-271) tmp = x; elseif (z <= 6.2e-171) tmp = t_1; elseif (z <= 4.6e-10) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (-t / a); t_2 = z * (y / a); tmp = 0.0; if (z <= -1.16e-21) tmp = t_2; elseif (z <= -1.55e-108) tmp = t_1; elseif (z <= -2.5e-271) tmp = x; elseif (z <= 6.2e-171) tmp = t_1; elseif (z <= 4.6e-10) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.16e-21], t$95$2, If[LessEqual[z, -1.55e-108], t$95$1, If[LessEqual[z, -2.5e-271], x, If[LessEqual[z, 6.2e-171], t$95$1, If[LessEqual[z, 4.6e-10], x, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-t}{a}\\
t_2 := z \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -1.16 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-271}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.1600000000000001e-21 or 4.60000000000000014e-10 < z Initial program 91.0%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in a around 0 84.2%
Taylor expanded in z around inf 53.7%
*-commutative53.7%
associate-/l*57.6%
Applied egg-rr57.6%
if -1.1600000000000001e-21 < z < -1.55000000000000007e-108 or -2.5000000000000001e-271 < z < 6.2000000000000001e-171Initial program 95.7%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in a around 0 84.0%
Taylor expanded in t around inf 59.7%
mul-1-neg59.7%
*-commutative59.7%
distribute-rgt-neg-in59.7%
Simplified59.7%
frac-2neg59.7%
distribute-frac-neg59.7%
add-sqr-sqrt19.3%
sqrt-unprod13.8%
sqr-neg13.8%
sqrt-unprod0.8%
add-sqr-sqrt1.4%
remove-double-neg1.4%
distribute-rgt-neg-out1.4%
frac-2neg1.4%
associate-/l*1.4%
add-sqr-sqrt0.7%
sqrt-unprod32.4%
sqr-neg32.4%
sqrt-unprod40.0%
add-sqr-sqrt60.9%
Applied egg-rr60.9%
if -1.55000000000000007e-108 < z < -2.5000000000000001e-271 or 6.2000000000000001e-171 < z < 4.60000000000000014e-10Initial program 94.5%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around inf 56.7%
Final simplification58.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y a)))) (t_2 (+ x (* z (/ y a)))))
(if (<= z -4.8e+23)
t_2
(if (<= z -5.5e-73)
t_1
(if (<= z 6e-16) (- x (* y (/ t a))) (if (<= z 3.8e+86) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / a));
double t_2 = x + (z * (y / a));
double tmp;
if (z <= -4.8e+23) {
tmp = t_2;
} else if (z <= -5.5e-73) {
tmp = t_1;
} else if (z <= 6e-16) {
tmp = x - (y * (t / a));
} else if (z <= 3.8e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x - (t * (y / a))
t_2 = x + (z * (y / a))
if (z <= (-4.8d+23)) then
tmp = t_2
else if (z <= (-5.5d-73)) then
tmp = t_1
else if (z <= 6d-16) then
tmp = x - (y * (t / a))
else if (z <= 3.8d+86) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / a));
double t_2 = x + (z * (y / a));
double tmp;
if (z <= -4.8e+23) {
tmp = t_2;
} else if (z <= -5.5e-73) {
tmp = t_1;
} else if (z <= 6e-16) {
tmp = x - (y * (t / a));
} else if (z <= 3.8e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / a)) t_2 = x + (z * (y / a)) tmp = 0 if z <= -4.8e+23: tmp = t_2 elif z <= -5.5e-73: tmp = t_1 elif z <= 6e-16: tmp = x - (y * (t / a)) elif z <= 3.8e+86: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / a))) t_2 = Float64(x + Float64(z * Float64(y / a))) tmp = 0.0 if (z <= -4.8e+23) tmp = t_2; elseif (z <= -5.5e-73) tmp = t_1; elseif (z <= 6e-16) tmp = Float64(x - Float64(y * Float64(t / a))); elseif (z <= 3.8e+86) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / a)); t_2 = x + (z * (y / a)); tmp = 0.0; if (z <= -4.8e+23) tmp = t_2; elseif (z <= -5.5e-73) tmp = t_1; elseif (z <= 6e-16) tmp = x - (y * (t / a)); elseif (z <= 3.8e+86) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+23], t$95$2, If[LessEqual[z, -5.5e-73], t$95$1, If[LessEqual[z, 6e-16], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+86], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{a}\\
t_2 := x + z \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-16}:\\
\;\;\;\;x - y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.8e23 or 3.79999999999999978e86 < z Initial program 91.5%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in y around 0 91.5%
*-commutative91.5%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around inf 84.9%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
if -4.8e23 < z < -5.50000000000000006e-73 or 5.99999999999999987e-16 < z < 3.79999999999999978e86Initial program 93.1%
associate-/l*88.6%
Simplified88.6%
Taylor expanded in y around 0 93.1%
*-commutative93.1%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around 0 70.4%
associate-*l/65.8%
*-commutative65.8%
neg-mul-165.8%
sub-neg65.8%
*-commutative65.8%
associate-*l/70.4%
associate-*r/82.6%
Simplified82.6%
if -5.50000000000000006e-73 < z < 5.99999999999999987e-16Initial program 94.4%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in z around 0 88.5%
mul-1-neg88.5%
unsub-neg88.5%
*-commutative88.5%
associate-/l*93.4%
Simplified93.4%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.3e-164) (not (<= a 2e-132))) (+ x (* y (/ (- z t) a))) (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.3e-164) || !(a <= 2e-132)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = (y * (z - t)) / a;
}
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 ((a <= (-1.3d-164)) .or. (.not. (a <= 2d-132))) then
tmp = x + (y * ((z - t) / a))
else
tmp = (y * (z - t)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.3e-164) || !(a <= 2e-132)) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = (y * (z - t)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.3e-164) or not (a <= 2e-132): tmp = x + (y * ((z - t) / a)) else: tmp = (y * (z - t)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.3e-164) || !(a <= 2e-132)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(Float64(y * Float64(z - t)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.3e-164) || ~((a <= 2e-132))) tmp = x + (y * ((z - t) / a)); else tmp = (y * (z - t)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.3e-164], N[Not[LessEqual[a, 2e-132]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-164} \lor \neg \left(a \leq 2 \cdot 10^{-132}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a}\\
\end{array}
\end{array}
if a < -1.3000000000000001e-164 or 2e-132 < a Initial program 90.5%
associate-/l*96.8%
Simplified96.8%
if -1.3000000000000001e-164 < a < 2e-132Initial program 99.6%
associate-/l*80.7%
Simplified80.7%
Taylor expanded in a around 0 99.6%
Taylor expanded in a around 0 94.5%
Final simplification96.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.2e-35) (not (<= y 2.9e-145))) (* y (/ (- z t) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.2e-35) || !(y <= 2.9e-145)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
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 ((y <= (-6.2d-35)) .or. (.not. (y <= 2.9d-145))) then
tmp = y * ((z - t) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.2e-35) || !(y <= 2.9e-145)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.2e-35) or not (y <= 2.9e-145): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.2e-35) || !(y <= 2.9e-145)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -6.2e-35) || ~((y <= 2.9e-145))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.2e-35], N[Not[LessEqual[y, 2.9e-145]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-35} \lor \neg \left(y \leq 2.9 \cdot 10^{-145}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.20000000000000024e-35 or 2.89999999999999984e-145 < y Initial program 89.5%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in a around 0 85.1%
Taylor expanded in a around 0 71.2%
associate-*r/78.3%
*-commutative78.3%
Applied egg-rr78.3%
if -6.20000000000000024e-35 < y < 2.89999999999999984e-145Initial program 99.6%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in x around inf 63.2%
Final simplification73.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -10500000.0) (not (<= y 2e+22))) (* y (/ (- z t) a)) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -10500000.0) || !(y <= 2e+22)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z * (y / a));
}
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 ((y <= (-10500000.0d0)) .or. (.not. (y <= 2d+22))) then
tmp = y * ((z - t) / a)
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -10500000.0) || !(y <= 2e+22)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -10500000.0) or not (y <= 2e+22): tmp = y * ((z - t) / a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -10500000.0) || !(y <= 2e+22)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -10500000.0) || ~((y <= 2e+22))) tmp = y * ((z - t) / a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -10500000.0], N[Not[LessEqual[y, 2e+22]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -10500000 \lor \neg \left(y \leq 2 \cdot 10^{+22}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -1.05e7 or 2e22 < y Initial program 86.9%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in a around 0 83.4%
Taylor expanded in a around 0 73.1%
associate-*r/84.0%
*-commutative84.0%
Applied egg-rr84.0%
if -1.05e7 < y < 2e22Initial program 99.7%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
associate-*r/97.9%
Simplified97.9%
Taylor expanded in z around inf 79.1%
associate-*l/78.4%
*-commutative78.4%
Simplified78.4%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1700000.0) (not (<= y 2.7e+21))) (* y (/ (- z t) a)) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1700000.0) || !(y <= 2.7e+21)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((y * z) / a);
}
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 ((y <= (-1700000.0d0)) .or. (.not. (y <= 2.7d+21))) then
tmp = y * ((z - t) / a)
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1700000.0) || !(y <= 2.7e+21)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1700000.0) or not (y <= 2.7e+21): tmp = y * ((z - t) / a) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1700000.0) || !(y <= 2.7e+21)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1700000.0) || ~((y <= 2.7e+21))) tmp = y * ((z - t) / a); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1700000.0], N[Not[LessEqual[y, 2.7e+21]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1700000 \lor \neg \left(y \leq 2.7 \cdot 10^{+21}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if y < -1.7e6 or 2.7e21 < y Initial program 87.0%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in a around 0 83.5%
Taylor expanded in a around 0 73.3%
associate-*r/84.1%
*-commutative84.1%
Applied egg-rr84.1%
if -1.7e6 < y < 2.7e21Initial program 99.7%
associate-/l*84.9%
Simplified84.9%
Taylor expanded in z around inf 79.0%
Final simplification81.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e+24) (not (<= z 3e+86))) (+ x (* z (/ y a))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+24) || !(z <= 3e+86)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
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 <= (-1.15d+24)) .or. (.not. (z <= 3d+86))) then
tmp = x + (z * (y / a))
else
tmp = x - (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+24) || !(z <= 3e+86)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e+24) or not (z <= 3e+86): tmp = x + (z * (y / a)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e+24) || !(z <= 3e+86)) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e+24) || ~((z <= 3e+86))) tmp = x + (z * (y / a)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e+24], N[Not[LessEqual[z, 3e+86]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+24} \lor \neg \left(z \leq 3 \cdot 10^{+86}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.15e24 or 2.99999999999999977e86 < z Initial program 91.5%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in y around 0 91.5%
*-commutative91.5%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around inf 84.9%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
if -1.15e24 < z < 2.99999999999999977e86Initial program 94.0%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around 0 94.0%
*-commutative94.0%
associate-*r/95.7%
Simplified95.7%
Taylor expanded in z around 0 83.2%
associate-*l/85.3%
*-commutative85.3%
neg-mul-185.3%
sub-neg85.3%
*-commutative85.3%
associate-*l/83.2%
associate-*r/87.3%
Simplified87.3%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e+23) (not (<= z 3.9e+87))) (+ x (* z (/ y a))) (- x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e+23) || !(z <= 3.9e+87)) {
tmp = x + (z * (y / a));
} 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 ((z <= (-9.5d+23)) .or. (.not. (z <= 3.9d+87))) then
tmp = x + (z * (y / a))
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 ((z <= -9.5e+23) || !(z <= 3.9e+87)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e+23) or not (z <= 3.9e+87): tmp = x + (z * (y / a)) else: tmp = x - (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e+23) || !(z <= 3.9e+87)) tmp = Float64(x + Float64(z * Float64(y / a))); 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 ((z <= -9.5e+23) || ~((z <= 3.9e+87))) tmp = x + (z * (y / a)); else tmp = x - (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e+23], N[Not[LessEqual[z, 3.9e+87]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+23} \lor \neg \left(z \leq 3.9 \cdot 10^{+87}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -9.50000000000000038e23 or 3.9000000000000002e87 < z Initial program 91.5%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in y around 0 91.5%
*-commutative91.5%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around inf 84.9%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
if -9.50000000000000038e23 < z < 3.9000000000000002e87Initial program 94.0%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around 0 94.0%
*-commutative94.0%
associate-*r/95.7%
Simplified95.7%
Taylor expanded in z around 0 83.2%
associate-*l/85.3%
*-commutative85.3%
neg-mul-185.3%
sub-neg85.3%
*-commutative85.3%
associate-*l/83.2%
associate-*r/87.3%
Simplified87.3%
clear-num86.8%
un-div-inv87.5%
Applied egg-rr87.5%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.9e-44) x (if (<= a 9.8e-5) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.9e-44) {
tmp = x;
} else if (a <= 9.8e-5) {
tmp = z * (y / a);
} else {
tmp = x;
}
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 (a <= (-3.9d-44)) then
tmp = x
else if (a <= 9.8d-5) then
tmp = z * (y / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.9e-44) {
tmp = x;
} else if (a <= 9.8e-5) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.9e-44: tmp = x elif a <= 9.8e-5: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.9e-44) tmp = x; elseif (a <= 9.8e-5) tmp = Float64(z * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.9e-44) tmp = x; elseif (a <= 9.8e-5) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.9e-44], x, If[LessEqual[a, 9.8e-5], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.8 \cdot 10^{-5}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.9000000000000002e-44 or 9.8e-5 < a Initial program 85.8%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 55.1%
if -3.9000000000000002e-44 < a < 9.8e-5Initial program 99.7%
associate-/l*86.3%
Simplified86.3%
Taylor expanded in a around 0 99.7%
Taylor expanded in z around inf 51.7%
*-commutative51.7%
associate-/l*52.6%
Applied egg-rr52.6%
Final simplification53.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1e-44) (+ x (* y (/ (- z t) a))) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e-44) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((z - t) * (y / a));
}
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 (y <= (-1d-44)) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + ((z - t) * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e-44) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1e-44: tmp = x + (y * ((z - t) / a)) else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1e-44) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1e-44) tmp = x + (y * ((z - t) / a)); else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1e-44], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-44}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -9.99999999999999953e-45Initial program 87.8%
associate-/l*99.8%
Simplified99.8%
if -9.99999999999999953e-45 < y Initial program 95.1%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 95.1%
*-commutative95.1%
associate-*r/98.6%
Simplified98.6%
Final simplification98.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 92.9%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in x around inf 35.6%
Final simplification35.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / 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 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / 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 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024057
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))