
(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 10 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(Float64(y / 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[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z - a} \cdot \left(z - t\right)
\end{array}
Initial program 84.7%
associate-*l/98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ y (/ a (- z t))))) (t_2 (- x (* y (/ (- t z) z)))))
(if (<= z -4.6e+49)
t_2
(if (<= z -3.3e-56)
t_1
(if (<= z -4.2e-74)
(+ x (/ (- z t) (/ z y)))
(if (<= z -8.3e-274)
(+ x (* t (/ y a)))
(if (<= z 9.8e-60) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y / (a / (z - t)));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -4.6e+49) {
tmp = t_2;
} else if (z <= -3.3e-56) {
tmp = t_1;
} else if (z <= -4.2e-74) {
tmp = x + ((z - t) / (z / y));
} else if (z <= -8.3e-274) {
tmp = x + (t * (y / a));
} else if (z <= 9.8e-60) {
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 / (a / (z - t)))
t_2 = x - (y * ((t - z) / z))
if (z <= (-4.6d+49)) then
tmp = t_2
else if (z <= (-3.3d-56)) then
tmp = t_1
else if (z <= (-4.2d-74)) then
tmp = x + ((z - t) / (z / y))
else if (z <= (-8.3d-274)) then
tmp = x + (t * (y / a))
else if (z <= 9.8d-60) 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 / (a / (z - t)));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -4.6e+49) {
tmp = t_2;
} else if (z <= -3.3e-56) {
tmp = t_1;
} else if (z <= -4.2e-74) {
tmp = x + ((z - t) / (z / y));
} else if (z <= -8.3e-274) {
tmp = x + (t * (y / a));
} else if (z <= 9.8e-60) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y / (a / (z - t))) t_2 = x - (y * ((t - z) / z)) tmp = 0 if z <= -4.6e+49: tmp = t_2 elif z <= -3.3e-56: tmp = t_1 elif z <= -4.2e-74: tmp = x + ((z - t) / (z / y)) elif z <= -8.3e-274: tmp = x + (t * (y / a)) elif z <= 9.8e-60: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y / Float64(a / Float64(z - t)))) t_2 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -4.6e+49) tmp = t_2; elseif (z <= -3.3e-56) tmp = t_1; elseif (z <= -4.2e-74) tmp = Float64(x + Float64(Float64(z - t) / Float64(z / y))); elseif (z <= -8.3e-274) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 9.8e-60) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y / (a / (z - t))); t_2 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -4.6e+49) tmp = t_2; elseif (z <= -3.3e-56) tmp = t_1; elseif (z <= -4.2e-74) tmp = x + ((z - t) / (z / y)); elseif (z <= -8.3e-274) tmp = x + (t * (y / a)); elseif (z <= 9.8e-60) 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[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+49], t$95$2, If[LessEqual[z, -3.3e-56], t$95$1, If[LessEqual[z, -4.2e-74], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.3e-274], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e-60], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{\frac{a}{z - t}}\\
t_2 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-74}:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -8.3 \cdot 10^{-274}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.60000000000000004e49 or 9.79999999999999977e-60 < z Initial program 73.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in a around 0 67.5%
+-commutative67.5%
associate-/l*84.8%
Simplified84.8%
associate-/r/86.6%
Applied egg-rr86.6%
if -4.60000000000000004e49 < z < -3.29999999999999984e-56 or -8.29999999999999976e-274 < z < 9.79999999999999977e-60Initial program 95.1%
associate-/l*98.9%
Simplified98.9%
clear-num98.8%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in a around inf 83.3%
+-commutative83.3%
mul-1-neg83.3%
*-commutative83.3%
unsub-neg83.3%
associate-/l*88.0%
Simplified88.0%
if -3.29999999999999984e-56 < z < -4.2e-74Initial program 99.2%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in a around 0 83.3%
+-commutative83.3%
associate-/l*84.1%
Simplified84.1%
if -4.2e-74 < z < -8.29999999999999976e-274Initial program 86.7%
associate-/l*92.4%
Simplified92.4%
clear-num91.0%
associate-/r/92.3%
Applied egg-rr92.3%
Taylor expanded in z around 0 77.5%
associate-*r/82.9%
Simplified82.9%
Taylor expanded in y around 0 77.5%
associate-*l/90.6%
Simplified90.6%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- t z) z)))))
(if (<= z -2.4e+43)
t_1
(if (<= z -8.8e-10)
(- x (/ y (/ a (- z t))))
(if (<= z -1.7e-41)
(+ x (/ y (/ (- z a) z)))
(if (<= z -4.5e-92)
(/ (* y (- z t)) (- z a))
(if (<= z 7.4e-60) (+ x (/ (- t z) (/ a y))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t - z) / z));
double tmp;
if (z <= -2.4e+43) {
tmp = t_1;
} else if (z <= -8.8e-10) {
tmp = x - (y / (a / (z - t)));
} else if (z <= -1.7e-41) {
tmp = x + (y / ((z - a) / z));
} else if (z <= -4.5e-92) {
tmp = (y * (z - t)) / (z - a);
} else if (z <= 7.4e-60) {
tmp = x + ((t - z) / (a / y));
} 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 * ((t - z) / z))
if (z <= (-2.4d+43)) then
tmp = t_1
else if (z <= (-8.8d-10)) then
tmp = x - (y / (a / (z - t)))
else if (z <= (-1.7d-41)) then
tmp = x + (y / ((z - a) / z))
else if (z <= (-4.5d-92)) then
tmp = (y * (z - t)) / (z - a)
else if (z <= 7.4d-60) then
tmp = x + ((t - z) / (a / y))
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 * ((t - z) / z));
double tmp;
if (z <= -2.4e+43) {
tmp = t_1;
} else if (z <= -8.8e-10) {
tmp = x - (y / (a / (z - t)));
} else if (z <= -1.7e-41) {
tmp = x + (y / ((z - a) / z));
} else if (z <= -4.5e-92) {
tmp = (y * (z - t)) / (z - a);
} else if (z <= 7.4e-60) {
tmp = x + ((t - z) / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t - z) / z)) tmp = 0 if z <= -2.4e+43: tmp = t_1 elif z <= -8.8e-10: tmp = x - (y / (a / (z - t))) elif z <= -1.7e-41: tmp = x + (y / ((z - a) / z)) elif z <= -4.5e-92: tmp = (y * (z - t)) / (z - a) elif z <= 7.4e-60: tmp = x + ((t - z) / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -2.4e+43) tmp = t_1; elseif (z <= -8.8e-10) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (z <= -1.7e-41) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= -4.5e-92) tmp = Float64(Float64(y * Float64(z - t)) / Float64(z - a)); elseif (z <= 7.4e-60) tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -2.4e+43) tmp = t_1; elseif (z <= -8.8e-10) tmp = x - (y / (a / (z - t))); elseif (z <= -1.7e-41) tmp = x + (y / ((z - a) / z)); elseif (z <= -4.5e-92) tmp = (y * (z - t)) / (z - a); elseif (z <= 7.4e-60) tmp = x + ((t - z) / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+43], t$95$1, If[LessEqual[z, -8.8e-10], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.7e-41], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.5e-92], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e-60], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-41}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-60}:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.40000000000000023e43 or 7.4000000000000005e-60 < z Initial program 73.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in a around 0 67.5%
+-commutative67.5%
associate-/l*84.8%
Simplified84.8%
associate-/r/86.6%
Applied egg-rr86.6%
if -2.40000000000000023e43 < z < -8.7999999999999996e-10Initial program 89.5%
associate-/l*100.0%
Simplified100.0%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 78.0%
+-commutative78.0%
mul-1-neg78.0%
*-commutative78.0%
unsub-neg78.0%
associate-/l*88.4%
Simplified88.4%
if -8.7999999999999996e-10 < z < -1.6999999999999999e-41Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
if -1.6999999999999999e-41 < z < -4.5e-92Initial program 99.6%
associate-*l/99.6%
Simplified99.6%
Taylor expanded in x around 0 76.8%
if -4.5e-92 < z < 7.4000000000000005e-60Initial program 91.9%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in a around inf 83.7%
+-commutative83.7%
*-commutative83.7%
mul-1-neg83.7%
unsub-neg83.7%
*-commutative83.7%
associate-/l*90.0%
Simplified90.0%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- t z) z)))))
(if (<= z -2.6e+43)
t_1
(if (<= z -1.02e-9)
(- x (/ y (/ a (- z t))))
(if (<= z -2.1e-41)
(+ x (/ y (/ (- z a) z)))
(if (<= z -7.4e-91)
(/ (* y (- z t)) (- z a))
(if (<= z 9e-60) (- x (* (- z t) (/ y a))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t - z) / z));
double tmp;
if (z <= -2.6e+43) {
tmp = t_1;
} else if (z <= -1.02e-9) {
tmp = x - (y / (a / (z - t)));
} else if (z <= -2.1e-41) {
tmp = x + (y / ((z - a) / z));
} else if (z <= -7.4e-91) {
tmp = (y * (z - t)) / (z - a);
} else if (z <= 9e-60) {
tmp = x - ((z - t) * (y / a));
} 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 * ((t - z) / z))
if (z <= (-2.6d+43)) then
tmp = t_1
else if (z <= (-1.02d-9)) then
tmp = x - (y / (a / (z - t)))
else if (z <= (-2.1d-41)) then
tmp = x + (y / ((z - a) / z))
else if (z <= (-7.4d-91)) then
tmp = (y * (z - t)) / (z - a)
else if (z <= 9d-60) then
tmp = x - ((z - t) * (y / a))
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 * ((t - z) / z));
double tmp;
if (z <= -2.6e+43) {
tmp = t_1;
} else if (z <= -1.02e-9) {
tmp = x - (y / (a / (z - t)));
} else if (z <= -2.1e-41) {
tmp = x + (y / ((z - a) / z));
} else if (z <= -7.4e-91) {
tmp = (y * (z - t)) / (z - a);
} else if (z <= 9e-60) {
tmp = x - ((z - t) * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t - z) / z)) tmp = 0 if z <= -2.6e+43: tmp = t_1 elif z <= -1.02e-9: tmp = x - (y / (a / (z - t))) elif z <= -2.1e-41: tmp = x + (y / ((z - a) / z)) elif z <= -7.4e-91: tmp = (y * (z - t)) / (z - a) elif z <= 9e-60: tmp = x - ((z - t) * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -2.6e+43) tmp = t_1; elseif (z <= -1.02e-9) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (z <= -2.1e-41) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= -7.4e-91) tmp = Float64(Float64(y * Float64(z - t)) / Float64(z - a)); elseif (z <= 9e-60) tmp = Float64(x - Float64(Float64(z - t) * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -2.6e+43) tmp = t_1; elseif (z <= -1.02e-9) tmp = x - (y / (a / (z - t))); elseif (z <= -2.1e-41) tmp = x + (y / ((z - a) / z)); elseif (z <= -7.4e-91) tmp = (y * (z - t)) / (z - a); elseif (z <= 9e-60) tmp = x - ((z - t) * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+43], t$95$1, If[LessEqual[z, -1.02e-9], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-41], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.4e-91], N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-60], N[(x - N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-9}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-41}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-91}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-60}:\\
\;\;\;\;x - \left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.60000000000000021e43 or 9.00000000000000001e-60 < z Initial program 73.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in a around 0 67.5%
+-commutative67.5%
associate-/l*84.8%
Simplified84.8%
associate-/r/86.6%
Applied egg-rr86.6%
if -2.60000000000000021e43 < z < -1.01999999999999999e-9Initial program 89.5%
associate-/l*100.0%
Simplified100.0%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 78.0%
+-commutative78.0%
mul-1-neg78.0%
*-commutative78.0%
unsub-neg78.0%
associate-/l*88.4%
Simplified88.4%
if -1.01999999999999999e-9 < z < -2.10000000000000013e-41Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
if -2.10000000000000013e-41 < z < -7.4000000000000004e-91Initial program 99.6%
associate-*l/99.6%
Simplified99.6%
Taylor expanded in x around 0 76.8%
if -7.4000000000000004e-91 < z < 9.00000000000000001e-60Initial program 91.9%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around 0 90.1%
associate-*r/90.1%
neg-mul-190.1%
Simplified90.1%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.6e-74) (not (<= z 2.9e-91))) (+ x (/ y (/ (- z a) z))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e-74) || !(z <= 2.9e-91)) {
tmp = x + (y / ((z - a) / z));
} 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 <= (-3.6d-74)) .or. (.not. (z <= 2.9d-91))) then
tmp = x + (y / ((z - a) / z))
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 <= -3.6e-74) || !(z <= 2.9e-91)) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.6e-74) or not (z <= 2.9e-91): tmp = x + (y / ((z - a) / z)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.6e-74) || !(z <= 2.9e-91)) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); 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 <= -3.6e-74) || ~((z <= 2.9e-91))) tmp = x + (y / ((z - a) / z)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.6e-74], N[Not[LessEqual[z, 2.9e-91]], $MachinePrecision]], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-74} \lor \neg \left(z \leq 2.9 \cdot 10^{-91}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.6000000000000002e-74 or 2.9000000000000001e-91 < z Initial program 80.7%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in t around 0 80.2%
if -3.6000000000000002e-74 < z < 2.9000000000000001e-91Initial program 91.3%
associate-/l*95.6%
Simplified95.6%
clear-num95.0%
associate-/r/95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 81.4%
associate-*r/86.6%
Simplified86.6%
Taylor expanded in y around 0 81.4%
associate-*l/89.1%
Simplified89.1%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+46) (not (<= z 9.8e-60))) (- x (* y (/ (- t z) z))) (+ x (/ (- t z) (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+46) || !(z <= 9.8e-60)) {
tmp = x - (y * ((t - z) / z));
} 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.85d+46)) .or. (.not. (z <= 9.8d-60))) then
tmp = x - (y * ((t - z) / z))
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.85e+46) || !(z <= 9.8e-60)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((t - z) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e+46) or not (z <= 9.8e-60): tmp = x - (y * ((t - z) / z)) else: tmp = x + ((t - z) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+46) || !(z <= 9.8e-60)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); 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.85e+46) || ~((z <= 9.8e-60))) tmp = x - (y * ((t - z) / z)); else tmp = x + ((t - z) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+46], N[Not[LessEqual[z, 9.8e-60]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $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.85 \cdot 10^{+46} \lor \neg \left(z \leq 9.8 \cdot 10^{-60}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.84999999999999995e46 or 9.79999999999999977e-60 < z Initial program 73.8%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in a around 0 67.5%
+-commutative67.5%
associate-/l*84.8%
Simplified84.8%
associate-/r/86.6%
Applied egg-rr86.6%
if -1.84999999999999995e46 < z < 9.79999999999999977e-60Initial program 92.8%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in a around inf 80.3%
+-commutative80.3%
*-commutative80.3%
mul-1-neg80.3%
unsub-neg80.3%
*-commutative80.3%
associate-/l*86.0%
Simplified86.0%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+56) (not (<= z 9e-60))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+56) || !(z <= 9e-60)) {
tmp = x + y;
} 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.5d+56)) .or. (.not. (z <= 9d-60))) then
tmp = x + y
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.5e+56) || !(z <= 9e-60)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+56) or not (z <= 9e-60): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+56) || !(z <= 9e-60)) tmp = Float64(x + y); 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.5e+56) || ~((z <= 9e-60))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+56], N[Not[LessEqual[z, 9e-60]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+56} \lor \neg \left(z \leq 9 \cdot 10^{-60}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.50000000000000003e56 or 9.00000000000000001e-60 < z Initial program 73.6%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 76.7%
if -1.50000000000000003e56 < z < 9.00000000000000001e-60Initial program 92.9%
associate-/l*96.4%
Simplified96.4%
clear-num95.9%
associate-/r/96.3%
Applied egg-rr96.3%
Taylor expanded in z around 0 74.7%
associate-*r/79.4%
Simplified79.4%
Taylor expanded in y around 0 74.7%
associate-*l/80.5%
Simplified80.5%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.8e+56) (+ x y) (if (<= z 9.5e-60) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e+56) {
tmp = x + y;
} else if (z <= 9.5e-60) {
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 <= (-1.8d+56)) then
tmp = x + y
else if (z <= 9.5d-60) 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 <= -1.8e+56) {
tmp = x + y;
} else if (z <= 9.5e-60) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e+56: tmp = x + y elif z <= 9.5e-60: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e+56) tmp = Float64(x + y); elseif (z <= 9.5e-60) 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 <= -1.8e+56) tmp = x + y; elseif (z <= 9.5e-60) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e+56], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.5e-60], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+56}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-60}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.79999999999999999e56 or 9.49999999999999958e-60 < z Initial program 73.6%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 76.7%
if -1.79999999999999999e56 < z < 9.49999999999999958e-60Initial program 92.9%
associate-/l*96.4%
Simplified96.4%
clear-num95.9%
associate-/r/96.3%
Applied egg-rr96.3%
Taylor expanded in z around 0 74.7%
associate-*r/79.4%
Simplified79.4%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.4e-182) (+ x y) (if (<= z 3.9e-94) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e-182) {
tmp = x + y;
} else if (z <= 3.9e-94) {
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 <= (-5.4d-182)) then
tmp = x + y
else if (z <= 3.9d-94) 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 <= -5.4e-182) {
tmp = x + y;
} else if (z <= 3.9e-94) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.4e-182: tmp = x + y elif z <= 3.9e-94: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.4e-182) tmp = Float64(x + y); elseif (z <= 3.9e-94) 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 <= -5.4e-182) tmp = x + y; elseif (z <= 3.9e-94) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.4e-182], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.9e-94], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-182}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-94}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.39999999999999999e-182 or 3.9000000000000002e-94 < z Initial program 81.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 65.5%
if -5.39999999999999999e-182 < z < 3.9000000000000002e-94Initial program 93.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in x around inf 53.0%
Final simplification61.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 84.7%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in x around inf 47.7%
Final simplification47.7%
(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 2023238
(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))))