
(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 14 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 (/ (- 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}
Initial program 86.4%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- z a))))))
(if (<= z -1.35e-153)
t_1
(if (<= z 2.4e-64)
(+ x (/ t (/ a y)))
(if (<= z 8.5e-12)
t_1
(if (<= z 2.35e+23)
(+ x (/ y (/ a t)))
(if (<= z 2.3e+87) (- x (* y (/ t z))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double tmp;
if (z <= -1.35e-153) {
tmp = t_1;
} else if (z <= 2.4e-64) {
tmp = x + (t / (a / y));
} else if (z <= 8.5e-12) {
tmp = t_1;
} else if (z <= 2.35e+23) {
tmp = x + (y / (a / t));
} else if (z <= 2.3e+87) {
tmp = x - (y * (t / z));
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / (z - a)))
if (z <= (-1.35d-153)) then
tmp = t_1
else if (z <= 2.4d-64) then
tmp = x + (t / (a / y))
else if (z <= 8.5d-12) then
tmp = t_1
else if (z <= 2.35d+23) then
tmp = x + (y / (a / t))
else if (z <= 2.3d+87) then
tmp = x - (y * (t / z))
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 t_1 = x + (z * (y / (z - a)));
double tmp;
if (z <= -1.35e-153) {
tmp = t_1;
} else if (z <= 2.4e-64) {
tmp = x + (t / (a / y));
} else if (z <= 8.5e-12) {
tmp = t_1;
} else if (z <= 2.35e+23) {
tmp = x + (y / (a / t));
} else if (z <= 2.3e+87) {
tmp = x - (y * (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (z - a))) tmp = 0 if z <= -1.35e-153: tmp = t_1 elif z <= 2.4e-64: tmp = x + (t / (a / y)) elif z <= 8.5e-12: tmp = t_1 elif z <= 2.35e+23: tmp = x + (y / (a / t)) elif z <= 2.3e+87: tmp = x - (y * (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) tmp = 0.0 if (z <= -1.35e-153) tmp = t_1; elseif (z <= 2.4e-64) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 8.5e-12) tmp = t_1; elseif (z <= 2.35e+23) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 2.3e+87) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (z - a))); tmp = 0.0; if (z <= -1.35e-153) tmp = t_1; elseif (z <= 2.4e-64) tmp = x + (t / (a / y)); elseif (z <= 8.5e-12) tmp = t_1; elseif (z <= 2.35e+23) tmp = x + (y / (a / t)); elseif (z <= 2.3e+87) tmp = x - (y * (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e-153], t$95$1, If[LessEqual[z, 2.4e-64], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-12], t$95$1, If[LessEqual[z, 2.35e+23], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+87], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-64}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+87}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.35000000000000005e-153 or 2.39999999999999998e-64 < z < 8.4999999999999997e-12Initial program 88.4%
associate-/l*99.9%
Simplified99.9%
associate-/l*88.4%
clear-num88.4%
associate-/r/88.4%
Applied egg-rr88.4%
Taylor expanded in t around 0 75.0%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
if -1.35000000000000005e-153 < z < 2.39999999999999998e-64Initial program 95.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 86.4%
*-commutative86.4%
associate-/l*90.8%
associate-/r/88.7%
Applied egg-rr88.7%
associate-*l/86.4%
associate-/l*90.8%
Applied egg-rr90.8%
if 8.4999999999999997e-12 < z < 2.3499999999999999e23Initial program 99.7%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
associate-/l*100.0%
Simplified100.0%
if 2.3499999999999999e23 < z < 2.3000000000000002e87Initial program 92.9%
associate-*l/93.4%
Simplified93.4%
Taylor expanded in a around 0 92.3%
*-commutative92.3%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in z around 0 84.4%
mul-1-neg84.4%
*-commutative84.4%
associate-*r/84.3%
distribute-rgt-neg-in84.3%
Simplified84.3%
Taylor expanded in x around 0 84.4%
+-commutative84.4%
mul-1-neg84.4%
unsub-neg84.4%
*-commutative84.4%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
if 2.3000000000000002e87 < z Initial program 63.2%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 90.2%
Final simplification86.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- z a))))))
(if (<= z -2.9e-153)
t_1
(if (<= z 9e-69)
(+ x (/ t (/ a y)))
(if (<= z 9.5e-12)
t_1
(if (<= z 9.2e+22) (+ x (/ y (/ a t))) (+ x (* (- z t) (/ y z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double tmp;
if (z <= -2.9e-153) {
tmp = t_1;
} else if (z <= 9e-69) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e-12) {
tmp = t_1;
} else if (z <= 9.2e+22) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) * (y / 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / (z - a)))
if (z <= (-2.9d-153)) then
tmp = t_1
else if (z <= 9d-69) then
tmp = x + (t / (a / y))
else if (z <= 9.5d-12) then
tmp = t_1
else if (z <= 9.2d+22) then
tmp = x + (y / (a / t))
else
tmp = x + ((z - t) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double tmp;
if (z <= -2.9e-153) {
tmp = t_1;
} else if (z <= 9e-69) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e-12) {
tmp = t_1;
} else if (z <= 9.2e+22) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (z - a))) tmp = 0 if z <= -2.9e-153: tmp = t_1 elif z <= 9e-69: tmp = x + (t / (a / y)) elif z <= 9.5e-12: tmp = t_1 elif z <= 9.2e+22: tmp = x + (y / (a / t)) else: tmp = x + ((z - t) * (y / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) tmp = 0.0 if (z <= -2.9e-153) tmp = t_1; elseif (z <= 9e-69) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 9.5e-12) tmp = t_1; elseif (z <= 9.2e+22) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (z - a))); tmp = 0.0; if (z <= -2.9e-153) tmp = t_1; elseif (z <= 9e-69) tmp = x + (t / (a / y)); elseif (z <= 9.5e-12) tmp = t_1; elseif (z <= 9.2e+22) tmp = x + (y / (a / t)); else tmp = x + ((z - t) * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-153], t$95$1, If[LessEqual[z, 9e-69], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-12], t$95$1, If[LessEqual[z, 9.2e+22], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-69}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -2.90000000000000002e-153 or 9.00000000000000019e-69 < z < 9.4999999999999995e-12Initial program 88.4%
associate-/l*99.9%
Simplified99.9%
associate-/l*88.4%
clear-num88.4%
associate-/r/88.4%
Applied egg-rr88.4%
Taylor expanded in t around 0 75.0%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
if -2.90000000000000002e-153 < z < 9.00000000000000019e-69Initial program 95.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 86.4%
*-commutative86.4%
associate-/l*90.8%
associate-/r/88.7%
Applied egg-rr88.7%
associate-*l/86.4%
associate-/l*90.8%
Applied egg-rr90.8%
if 9.4999999999999995e-12 < z < 9.2000000000000008e22Initial program 99.7%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
associate-/l*100.0%
Simplified100.0%
if 9.2000000000000008e22 < z Initial program 69.8%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 90.3%
Final simplification87.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ z (- z t))))))
(if (<= z -5.8e-111)
t_1
(if (<= z 3.5e-67)
(+ x (/ t (/ a y)))
(if (<= z 7.2e-13)
(+ x (* z (/ y (- z a))))
(if (<= z 9.2e+22) (+ 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 <= -5.8e-111) {
tmp = t_1;
} else if (z <= 3.5e-67) {
tmp = x + (t / (a / y));
} else if (z <= 7.2e-13) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 9.2e+22) {
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 <= (-5.8d-111)) then
tmp = t_1
else if (z <= 3.5d-67) then
tmp = x + (t / (a / y))
else if (z <= 7.2d-13) then
tmp = x + (z * (y / (z - a)))
else if (z <= 9.2d+22) 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 <= -5.8e-111) {
tmp = t_1;
} else if (z <= 3.5e-67) {
tmp = x + (t / (a / y));
} else if (z <= 7.2e-13) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 9.2e+22) {
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 <= -5.8e-111: tmp = t_1 elif z <= 3.5e-67: tmp = x + (t / (a / y)) elif z <= 7.2e-13: tmp = x + (z * (y / (z - a))) elif z <= 9.2e+22: 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 <= -5.8e-111) tmp = t_1; elseif (z <= 3.5e-67) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 7.2e-13) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 9.2e+22) 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 <= -5.8e-111) tmp = t_1; elseif (z <= 3.5e-67) tmp = x + (t / (a / y)); elseif (z <= 7.2e-13) tmp = x + (z * (y / (z - a))); elseif (z <= 9.2e+22) 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, -5.8e-111], t$95$1, If[LessEqual[z, 3.5e-67], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-13], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+22], 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 -5.8 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-67}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-13}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.80000000000000003e-111 or 9.2000000000000008e22 < z Initial program 80.3%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in a around 0 70.1%
*-commutative70.1%
associate-/l*86.8%
Simplified86.8%
if -5.80000000000000003e-111 < z < 3.5e-67Initial program 95.5%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around 0 85.3%
*-commutative85.3%
associate-/l*89.4%
associate-/r/87.4%
Applied egg-rr87.4%
associate-*l/85.3%
associate-/l*89.4%
Applied egg-rr89.4%
if 3.5e-67 < z < 7.1999999999999996e-13Initial program 92.3%
associate-/l*99.9%
Simplified99.9%
associate-/l*92.3%
clear-num92.2%
associate-/r/92.3%
Applied egg-rr92.3%
Taylor expanded in t around 0 87.8%
associate-*l/87.8%
*-commutative87.8%
Simplified87.8%
if 7.1999999999999996e-13 < z < 9.2000000000000008e22Initial program 99.7%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
associate-/l*100.0%
Simplified100.0%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- z a) z)))))
(if (<= z -2.9e-153)
t_1
(if (<= z 7.4e-65)
(+ x (/ t (/ a y)))
(if (<= z 1.15e-12)
t_1
(if (<= z 9.5e+22) (+ x (/ y (/ a t))) (+ x (/ y (/ z (- z t))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -2.9e-153) {
tmp = t_1;
} else if (z <= 7.4e-65) {
tmp = x + (t / (a / y));
} else if (z <= 1.15e-12) {
tmp = t_1;
} else if (z <= 9.5e+22) {
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) :: t_1
real(8) :: tmp
t_1 = x + (y / ((z - a) / z))
if (z <= (-2.9d-153)) then
tmp = t_1
else if (z <= 7.4d-65) then
tmp = x + (t / (a / y))
else if (z <= 1.15d-12) then
tmp = t_1
else if (z <= 9.5d+22) 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 t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -2.9e-153) {
tmp = t_1;
} else if (z <= 7.4e-65) {
tmp = x + (t / (a / y));
} else if (z <= 1.15e-12) {
tmp = t_1;
} else if (z <= 9.5e+22) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / z)) tmp = 0 if z <= -2.9e-153: tmp = t_1 elif z <= 7.4e-65: tmp = x + (t / (a / y)) elif z <= 1.15e-12: tmp = t_1 elif z <= 9.5e+22: tmp = x + (y / (a / t)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / z))) tmp = 0.0 if (z <= -2.9e-153) tmp = t_1; elseif (z <= 7.4e-65) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 1.15e-12) tmp = t_1; elseif (z <= 9.5e+22) 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) t_1 = x + (y / ((z - a) / z)); tmp = 0.0; if (z <= -2.9e-153) tmp = t_1; elseif (z <= 7.4e-65) tmp = x + (t / (a / y)); elseif (z <= 1.15e-12) tmp = t_1; elseif (z <= 9.5e+22) tmp = x + (y / (a / t)); 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[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-153], t$95$1, If[LessEqual[z, 7.4e-65], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-12], t$95$1, If[LessEqual[z, 9.5e+22], 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}
t_1 := x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -2.90000000000000002e-153 or 7.4e-65 < z < 1.14999999999999995e-12Initial program 88.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around 0 75.0%
associate-/l*82.4%
Simplified82.4%
if -2.90000000000000002e-153 < z < 7.4e-65Initial program 95.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around 0 86.4%
*-commutative86.4%
associate-/l*90.8%
associate-/r/88.7%
Applied egg-rr88.7%
associate-*l/86.4%
associate-/l*90.8%
Applied egg-rr90.8%
if 1.14999999999999995e-12 < z < 9.49999999999999937e22Initial program 99.7%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
associate-/l*100.0%
Simplified100.0%
if 9.49999999999999937e22 < z Initial program 69.8%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in a around 0 68.0%
*-commutative68.0%
associate-/l*93.9%
Simplified93.9%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* y t) (- z a)))) (t_2 (+ x (/ y (/ z (- z t))))))
(if (<= z -5.2e-38)
t_2
(if (<= z -8.5e-146)
t_1
(if (<= z 4.2e-206)
(+ x (/ (- t z) (/ a y)))
(if (<= z 5.8e+24) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y * t) / (z - a));
double t_2 = x + (y / (z / (z - t)));
double tmp;
if (z <= -5.2e-38) {
tmp = t_2;
} else if (z <= -8.5e-146) {
tmp = t_1;
} else if (z <= 4.2e-206) {
tmp = x + ((t - z) / (a / y));
} else if (z <= 5.8e+24) {
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 - ((y * t) / (z - a))
t_2 = x + (y / (z / (z - t)))
if (z <= (-5.2d-38)) then
tmp = t_2
else if (z <= (-8.5d-146)) then
tmp = t_1
else if (z <= 4.2d-206) then
tmp = x + ((t - z) / (a / y))
else if (z <= 5.8d+24) 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 - ((y * t) / (z - a));
double t_2 = x + (y / (z / (z - t)));
double tmp;
if (z <= -5.2e-38) {
tmp = t_2;
} else if (z <= -8.5e-146) {
tmp = t_1;
} else if (z <= 4.2e-206) {
tmp = x + ((t - z) / (a / y));
} else if (z <= 5.8e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - ((y * t) / (z - a)) t_2 = x + (y / (z / (z - t))) tmp = 0 if z <= -5.2e-38: tmp = t_2 elif z <= -8.5e-146: tmp = t_1 elif z <= 4.2e-206: tmp = x + ((t - z) / (a / y)) elif z <= 5.8e+24: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(y * t) / Float64(z - a))) t_2 = Float64(x + Float64(y / Float64(z / Float64(z - t)))) tmp = 0.0 if (z <= -5.2e-38) tmp = t_2; elseif (z <= -8.5e-146) tmp = t_1; elseif (z <= 4.2e-206) tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); elseif (z <= 5.8e+24) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - ((y * t) / (z - a)); t_2 = x + (y / (z / (z - t))); tmp = 0.0; if (z <= -5.2e-38) tmp = t_2; elseif (z <= -8.5e-146) tmp = t_1; elseif (z <= 4.2e-206) tmp = x + ((t - z) / (a / y)); elseif (z <= 5.8e+24) 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[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-38], t$95$2, If[LessEqual[z, -8.5e-146], t$95$1, If[LessEqual[z, 4.2e-206], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+24], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y \cdot t}{z - a}\\
t_2 := x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-206}:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.20000000000000022e-38 or 5.79999999999999958e24 < z Initial program 77.9%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in a around 0 72.0%
*-commutative72.0%
associate-/l*90.8%
Simplified90.8%
if -5.20000000000000022e-38 < z < -8.4999999999999997e-146 or 4.2000000000000002e-206 < z < 5.79999999999999958e24Initial program 98.6%
associate-*l/99.4%
Simplified99.4%
Taylor expanded in t around inf 88.9%
associate-*r/88.9%
mul-1-neg88.9%
distribute-rgt-neg-out88.9%
Simplified88.9%
if -8.4999999999999997e-146 < z < 4.2000000000000002e-206Initial program 92.7%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in a around inf 91.0%
mul-1-neg91.0%
*-commutative91.0%
associate-/l*97.6%
Simplified97.6%
Final simplification91.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.7e-80)
(+ x y)
(if (<= z -6.5e-138)
(- x (/ y (/ a t)))
(if (<= z 6e+24) (+ x (/ t (/ a y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-80) {
tmp = x + y;
} else if (z <= -6.5e-138) {
tmp = x - (y / (a / t));
} else if (z <= 6e+24) {
tmp = x + (t / (a / y));
} 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 <= (-2.7d-80)) then
tmp = x + y
else if (z <= (-6.5d-138)) then
tmp = x - (y / (a / t))
else if (z <= 6d+24) then
tmp = x + (t / (a / y))
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 <= -2.7e-80) {
tmp = x + y;
} else if (z <= -6.5e-138) {
tmp = x - (y / (a / t));
} else if (z <= 6e+24) {
tmp = x + (t / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-80: tmp = x + y elif z <= -6.5e-138: tmp = x - (y / (a / t)) elif z <= 6e+24: tmp = x + (t / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e-80) tmp = Float64(x + y); elseif (z <= -6.5e-138) tmp = Float64(x - Float64(y / Float64(a / t))); elseif (z <= 6e+24) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e-80) tmp = x + y; elseif (z <= -6.5e-138) tmp = x - (y / (a / t)); elseif (z <= 6e+24) tmp = x + (t / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e-80], N[(x + y), $MachinePrecision], If[LessEqual[z, -6.5e-138], N[(x - N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+24], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-80}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-138}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+24}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.7000000000000002e-80 or 5.9999999999999999e24 < z Initial program 79.0%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 80.3%
if -2.7000000000000002e-80 < z < -6.4999999999999999e-138Initial program 99.9%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in z around 0 54.0%
*-commutative54.0%
associate-/l*51.7%
associate-/r/54.0%
Applied egg-rr54.0%
frac-2neg54.0%
distribute-frac-neg54.0%
add-sqr-sqrt27.3%
sqrt-unprod48.3%
sqr-neg48.3%
sqrt-unprod38.1%
add-sqr-sqrt79.1%
frac-2neg79.1%
cancel-sign-sub-inv79.1%
*-commutative79.1%
clear-num79.1%
div-inv79.1%
Applied egg-rr79.1%
if -6.4999999999999999e-138 < z < 5.9999999999999999e24Initial program 95.1%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in z around 0 81.6%
*-commutative81.6%
associate-/l*86.1%
associate-/r/84.4%
Applied egg-rr84.4%
associate-*l/81.6%
associate-/l*86.1%
Applied egg-rr86.1%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e-99) (not (<= z 1.6e+23))) (+ x (/ y (/ z (- z t)))) (+ x (/ (- t z) (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e-99) || !(z <= 1.6e+23)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + ((t - z) / (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 <= (-1.45d-99)) .or. (.not. (z <= 1.6d+23))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + ((t - z) / (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 <= -1.45e-99) || !(z <= 1.6e+23)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + ((t - z) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e-99) or not (z <= 1.6e+23): tmp = x + (y / (z / (z - t))) else: tmp = x + ((t - z) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e-99) || !(z <= 1.6e+23)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e-99) || ~((z <= 1.6e+23))) tmp = x + (y / (z / (z - t))); else tmp = x + ((t - z) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e-99], N[Not[LessEqual[z, 1.6e+23]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-99} \lor \neg \left(z \leq 1.6 \cdot 10^{+23}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.44999999999999993e-99 or 1.6e23 < z Initial program 79.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in a around 0 71.1%
*-commutative71.1%
associate-/l*88.2%
Simplified88.2%
if -1.44999999999999993e-99 < z < 1.6e23Initial program 95.5%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in a around inf 85.6%
mul-1-neg85.6%
*-commutative85.6%
associate-/l*89.4%
Simplified89.4%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-38) (not (<= z 1.6e+23))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-38) || !(z <= 1.6e+23)) {
tmp = x + 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 ((z <= (-1.75d-38)) .or. (.not. (z <= 1.6d+23))) then
tmp = x + 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 ((z <= -1.75e-38) || !(z <= 1.6e+23)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-38) or not (z <= 1.6e+23): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-38) || !(z <= 1.6e+23)) tmp = Float64(x + 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 ((z <= -1.75e-38) || ~((z <= 1.6e+23))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-38], N[Not[LessEqual[z, 1.6e+23]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-38} \lor \neg \left(z \leq 1.6 \cdot 10^{+23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.7500000000000001e-38 or 1.6e23 < z Initial program 77.9%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around inf 81.4%
if -1.7500000000000001e-38 < z < 1.6e23Initial program 96.0%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in z around 0 76.8%
*-commutative76.8%
associate-/l*80.2%
associate-/r/79.1%
Applied egg-rr79.1%
associate-*l/76.8%
associate-/l*80.2%
Applied egg-rr80.2%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.8e-38) (+ x y) (if (<= z 2.05e+24) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e-38) {
tmp = x + y;
} else if (z <= 2.05e+24) {
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 <= (-5.8d-38)) then
tmp = x + y
else if (z <= 2.05d+24) 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 <= -5.8e-38) {
tmp = x + y;
} else if (z <= 2.05e+24) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e-38: tmp = x + y elif z <= 2.05e+24: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e-38) tmp = Float64(x + y); elseif (z <= 2.05e+24) 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 <= -5.8e-38) tmp = x + y; elseif (z <= 2.05e+24) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e-38], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.05e+24], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+24}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.79999999999999988e-38 or 2.05e24 < z Initial program 77.9%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around inf 81.4%
if -5.79999999999999988e-38 < z < 2.05e24Initial program 96.0%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in z around 0 76.8%
*-commutative76.8%
associate-/l*80.2%
associate-/r/79.1%
Applied egg-rr79.1%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.46e-39) (+ x y) (if (<= z 4.1e+23) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.46e-39) {
tmp = x + y;
} else if (z <= 4.1e+23) {
tmp = x + (t * (y / 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 <= (-1.46d-39)) then
tmp = x + y
else if (z <= 4.1d+23) then
tmp = x + (t * (y / 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 <= -1.46e-39) {
tmp = x + y;
} else if (z <= 4.1e+23) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.46e-39: tmp = x + y elif z <= 4.1e+23: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.46e-39) tmp = Float64(x + y); elseif (z <= 4.1e+23) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.46e-39) tmp = x + y; elseif (z <= 4.1e+23) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.46e-39], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.1e+23], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{-39}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+23}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.46000000000000001e-39 or 4.09999999999999996e23 < z Initial program 77.9%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around inf 81.4%
if -1.46000000000000001e-39 < z < 4.09999999999999996e23Initial program 96.0%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in z around 0 76.8%
associate-/l*80.0%
associate-/r/79.6%
Applied egg-rr79.6%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 86.4%
associate-*l/97.8%
Simplified97.8%
Final simplification97.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.9e-40) (+ x y) (if (<= z 1.85e+26) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.9e-40) {
tmp = x + y;
} else if (z <= 1.85e+26) {
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 <= (-6.9d-40)) then
tmp = x + y
else if (z <= 1.85d+26) 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 <= -6.9e-40) {
tmp = x + y;
} else if (z <= 1.85e+26) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.9e-40: tmp = x + y elif z <= 1.85e+26: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.9e-40) tmp = Float64(x + y); elseif (z <= 1.85e+26) 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 <= -6.9e-40) tmp = x + y; elseif (z <= 1.85e+26) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.9e-40], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.85e+26], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.9 \cdot 10^{-40}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.8999999999999996e-40 or 1.84999999999999994e26 < z Initial program 77.7%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around inf 82.0%
if -6.8999999999999996e-40 < z < 1.84999999999999994e26Initial program 96.0%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in z around 0 76.2%
Taylor expanded in x around inf 44.0%
Final simplification64.1%
(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 86.4%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around 0 60.2%
Taylor expanded in x around inf 50.6%
Final simplification50.6%
(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 2023185
(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))))