
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+260)))
(fma (/ y (- z a)) (- z t) x)
(+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+260)) {
tmp = fma((y / (z - a)), (z - t), x);
} else {
tmp = t_1 + x;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+260)) tmp = fma(Float64(y / Float64(z - a)), Float64(z - t), x); else tmp = Float64(t_1 + x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+260]], $MachinePrecision]], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+260}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 4.9999999999999996e260 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 44.9%
+-commutative44.9%
associate-*l/99.9%
fma-def99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.9999999999999996e260Initial program 99.1%
Final simplification99.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+260)))
(+ x (/ (- z t) (/ (- z a) y)))
(+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+260)) {
tmp = x + ((z - t) / ((z - a) / y));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+260)) {
tmp = x + ((z - t) / ((z - a) / y));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+260): tmp = x + ((z - t) / ((z - a) / y)) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+260)) tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+260))) tmp = x + ((z - t) / ((z - a) / y)); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+260]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+260}\right):\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 4.9999999999999996e260 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 44.9%
*-commutative44.9%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.9999999999999996e260Initial program 99.1%
Final simplification99.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- z a)))))
(t_2 (+ x (* y (/ (- z t) z))))
(t_3 (+ x (* y (/ t a)))))
(if (<= z -1.5e+186)
t_2
(if (<= z -1.05e-20)
t_1
(if (<= z 2.75e-176)
t_3
(if (<= z 6.4e-61) t_1 (if (<= z 2.2e+61) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double t_2 = x + (y * ((z - t) / z));
double t_3 = x + (y * (t / a));
double tmp;
if (z <= -1.5e+186) {
tmp = t_2;
} else if (z <= -1.05e-20) {
tmp = t_1;
} else if (z <= 2.75e-176) {
tmp = t_3;
} else if (z <= 6.4e-61) {
tmp = t_1;
} else if (z <= 2.2e+61) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = x + (z * (y / (z - a)))
t_2 = x + (y * ((z - t) / z))
t_3 = x + (y * (t / a))
if (z <= (-1.5d+186)) then
tmp = t_2
else if (z <= (-1.05d-20)) then
tmp = t_1
else if (z <= 2.75d-176) then
tmp = t_3
else if (z <= 6.4d-61) then
tmp = t_1
else if (z <= 2.2d+61) then
tmp = t_3
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 + (z * (y / (z - a)));
double t_2 = x + (y * ((z - t) / z));
double t_3 = x + (y * (t / a));
double tmp;
if (z <= -1.5e+186) {
tmp = t_2;
} else if (z <= -1.05e-20) {
tmp = t_1;
} else if (z <= 2.75e-176) {
tmp = t_3;
} else if (z <= 6.4e-61) {
tmp = t_1;
} else if (z <= 2.2e+61) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (z - a))) t_2 = x + (y * ((z - t) / z)) t_3 = x + (y * (t / a)) tmp = 0 if z <= -1.5e+186: tmp = t_2 elif z <= -1.05e-20: tmp = t_1 elif z <= 2.75e-176: tmp = t_3 elif z <= 6.4e-61: tmp = t_1 elif z <= 2.2e+61: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) t_2 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) t_3 = Float64(x + Float64(y * Float64(t / a))) tmp = 0.0 if (z <= -1.5e+186) tmp = t_2; elseif (z <= -1.05e-20) tmp = t_1; elseif (z <= 2.75e-176) tmp = t_3; elseif (z <= 6.4e-61) tmp = t_1; elseif (z <= 2.2e+61) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (z - a))); t_2 = x + (y * ((z - t) / z)); t_3 = x + (y * (t / a)); tmp = 0.0; if (z <= -1.5e+186) tmp = t_2; elseif (z <= -1.05e-20) tmp = t_1; elseif (z <= 2.75e-176) tmp = t_3; elseif (z <= 6.4e-61) tmp = t_1; elseif (z <= 2.2e+61) tmp = t_3; else tmp = t_2; 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]}, Block[{t$95$2 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+186], t$95$2, If[LessEqual[z, -1.05e-20], t$95$1, If[LessEqual[z, 2.75e-176], t$95$3, If[LessEqual[z, 6.4e-61], t$95$1, If[LessEqual[z, 2.2e+61], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{z - a}\\
t_2 := x + y \cdot \frac{z - t}{z}\\
t_3 := x + y \cdot \frac{t}{a}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+186}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+61}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.49999999999999991e186 or 2.2e61 < z Initial program 71.9%
*-commutative71.9%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in z around inf 82.6%
associate-/r/91.1%
Applied egg-rr91.1%
if -1.49999999999999991e186 < z < -1.0499999999999999e-20 or 2.75e-176 < z < 6.4000000000000003e-61Initial program 91.8%
Taylor expanded in t around 0 79.9%
+-commutative79.9%
associate-*l/86.8%
*-commutative86.8%
Simplified86.8%
if -1.0499999999999999e-20 < z < 2.75e-176 or 6.4000000000000003e-61 < z < 2.2e61Initial program 95.5%
Taylor expanded in z around 0 81.6%
+-commutative81.6%
associate-/l*85.9%
Simplified85.9%
associate-/r/86.0%
Applied egg-rr86.0%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- z a))))) (t_2 (+ x (* y (/ t a)))))
(if (<= z -2.2e+185)
(+ x (/ y (/ z (- z t))))
(if (<= z -1.9e-22)
t_1
(if (<= z 2.75e-176)
t_2
(if (<= z 8.6e-60)
t_1
(if (<= z 1.95e+61) t_2 (+ x (* y (/ (- z t) z))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (z - a)));
double t_2 = x + (y * (t / a));
double tmp;
if (z <= -2.2e+185) {
tmp = x + (y / (z / (z - t)));
} else if (z <= -1.9e-22) {
tmp = t_1;
} else if (z <= 2.75e-176) {
tmp = t_2;
} else if (z <= 8.6e-60) {
tmp = t_1;
} else if (z <= 1.95e+61) {
tmp = t_2;
} else {
tmp = x + (y * ((z - t) / 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) :: t_2
real(8) :: tmp
t_1 = x + (z * (y / (z - a)))
t_2 = x + (y * (t / a))
if (z <= (-2.2d+185)) then
tmp = x + (y / (z / (z - t)))
else if (z <= (-1.9d-22)) then
tmp = t_1
else if (z <= 2.75d-176) then
tmp = t_2
else if (z <= 8.6d-60) then
tmp = t_1
else if (z <= 1.95d+61) then
tmp = t_2
else
tmp = x + (y * ((z - t) / 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 t_2 = x + (y * (t / a));
double tmp;
if (z <= -2.2e+185) {
tmp = x + (y / (z / (z - t)));
} else if (z <= -1.9e-22) {
tmp = t_1;
} else if (z <= 2.75e-176) {
tmp = t_2;
} else if (z <= 8.6e-60) {
tmp = t_1;
} else if (z <= 1.95e+61) {
tmp = t_2;
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (z - a))) t_2 = x + (y * (t / a)) tmp = 0 if z <= -2.2e+185: tmp = x + (y / (z / (z - t))) elif z <= -1.9e-22: tmp = t_1 elif z <= 2.75e-176: tmp = t_2 elif z <= 8.6e-60: tmp = t_1 elif z <= 1.95e+61: tmp = t_2 else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) t_2 = Float64(x + Float64(y * Float64(t / a))) tmp = 0.0 if (z <= -2.2e+185) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= -1.9e-22) tmp = t_1; elseif (z <= 2.75e-176) tmp = t_2; elseif (z <= 8.6e-60) tmp = t_1; elseif (z <= 1.95e+61) tmp = t_2; else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (z - a))); t_2 = x + (y * (t / a)); tmp = 0.0; if (z <= -2.2e+185) tmp = x + (y / (z / (z - t))); elseif (z <= -1.9e-22) tmp = t_1; elseif (z <= 2.75e-176) tmp = t_2; elseif (z <= 8.6e-60) tmp = t_1; elseif (z <= 1.95e+61) tmp = t_2; else tmp = x + (y * ((z - t) / 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]}, Block[{t$95$2 = N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+185], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.9e-22], t$95$1, If[LessEqual[z, 2.75e-176], t$95$2, If[LessEqual[z, 8.6e-60], t$95$1, If[LessEqual[z, 1.95e+61], t$95$2, N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{z - a}\\
t_2 := x + y \cdot \frac{t}{a}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+185}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -2.2000000000000001e185Initial program 63.6%
Taylor expanded in a around 0 57.7%
+-commutative57.7%
associate-/l*91.2%
Simplified91.2%
if -2.2000000000000001e185 < z < -1.90000000000000012e-22 or 2.75e-176 < z < 8.6000000000000001e-60Initial program 91.8%
Taylor expanded in t around 0 79.9%
+-commutative79.9%
associate-*l/86.8%
*-commutative86.8%
Simplified86.8%
if -1.90000000000000012e-22 < z < 2.75e-176 or 8.6000000000000001e-60 < z < 1.94999999999999994e61Initial program 95.5%
Taylor expanded in z around 0 81.6%
+-commutative81.6%
associate-/l*85.9%
Simplified85.9%
associate-/r/86.0%
Applied egg-rr86.0%
if 1.94999999999999994e61 < z Initial program 77.1%
*-commutative77.1%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in z around inf 83.9%
associate-/r/91.0%
Applied egg-rr91.0%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y a) (- t z))))
(if (<= y -2.7e+134)
t_1
(if (<= y -7.2e+66)
(+ y x)
(if (<= y -5.4e+66)
t_1
(if (<= y -2.4e-242) x (if (<= y 1.15e+114) (+ y x) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (t - z);
double tmp;
if (y <= -2.7e+134) {
tmp = t_1;
} else if (y <= -7.2e+66) {
tmp = y + x;
} else if (y <= -5.4e+66) {
tmp = t_1;
} else if (y <= -2.4e-242) {
tmp = x;
} else if (y <= 1.15e+114) {
tmp = y + x;
} 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 = (y / a) * (t - z)
if (y <= (-2.7d+134)) then
tmp = t_1
else if (y <= (-7.2d+66)) then
tmp = y + x
else if (y <= (-5.4d+66)) then
tmp = t_1
else if (y <= (-2.4d-242)) then
tmp = x
else if (y <= 1.15d+114) then
tmp = y + x
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 = (y / a) * (t - z);
double tmp;
if (y <= -2.7e+134) {
tmp = t_1;
} else if (y <= -7.2e+66) {
tmp = y + x;
} else if (y <= -5.4e+66) {
tmp = t_1;
} else if (y <= -2.4e-242) {
tmp = x;
} else if (y <= 1.15e+114) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * (t - z) tmp = 0 if y <= -2.7e+134: tmp = t_1 elif y <= -7.2e+66: tmp = y + x elif y <= -5.4e+66: tmp = t_1 elif y <= -2.4e-242: tmp = x elif y <= 1.15e+114: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(t - z)) tmp = 0.0 if (y <= -2.7e+134) tmp = t_1; elseif (y <= -7.2e+66) tmp = Float64(y + x); elseif (y <= -5.4e+66) tmp = t_1; elseif (y <= -2.4e-242) tmp = x; elseif (y <= 1.15e+114) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * (t - z); tmp = 0.0; if (y <= -2.7e+134) tmp = t_1; elseif (y <= -7.2e+66) tmp = y + x; elseif (y <= -5.4e+66) tmp = t_1; elseif (y <= -2.4e-242) tmp = x; elseif (y <= 1.15e+114) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+134], t$95$1, If[LessEqual[y, -7.2e+66], N[(y + x), $MachinePrecision], If[LessEqual[y, -5.4e+66], t$95$1, If[LessEqual[y, -2.4e-242], x, If[LessEqual[y, 1.15e+114], N[(y + x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{+66}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;y \leq -5.4 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-242}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+114}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.7e134 or -7.2e66 < y < -5.4e66 or 1.15e114 < y Initial program 68.1%
Taylor expanded in a around inf 55.1%
mul-1-neg55.1%
unsub-neg55.1%
associate-/l*62.2%
Simplified62.2%
Taylor expanded in x around 0 47.8%
associate-*l/56.8%
sub-neg56.8%
distribute-rgt-out50.9%
+-commutative50.9%
*-commutative50.9%
associate-*l/50.3%
distribute-rgt-in50.3%
distribute-lft-neg-out50.3%
distribute-lft-neg-in50.3%
distribute-rgt-neg-in50.3%
metadata-eval50.3%
*-rgt-identity50.3%
*-commutative50.3%
mul-1-neg50.3%
sub-neg50.3%
associate-*l/50.9%
*-commutative50.9%
distribute-lft-out--56.8%
Simplified56.8%
if -2.7e134 < y < -7.2e66 or -2.4000000000000001e-242 < y < 1.15e114Initial program 91.7%
Taylor expanded in z around inf 81.8%
+-commutative81.8%
Simplified81.8%
if -5.4e66 < y < -2.4000000000000001e-242Initial program 99.9%
Taylor expanded in x around inf 75.3%
Final simplification72.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7e+133)
(+ x (/ y (/ z (- z t))))
(if (<= z 5.8e+111)
(+ (/ (* y (- z t)) (- z a)) x)
(+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+133) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 5.8e+111) {
tmp = ((y * (z - t)) / (z - a)) + x;
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7d+133)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 5.8d+111) then
tmp = ((y * (z - t)) / (z - a)) + x
else
tmp = x + (y * ((z - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+133) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 5.8e+111) {
tmp = ((y * (z - t)) / (z - a)) + x;
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e+133: tmp = x + (y / (z / (z - t))) elif z <= 5.8e+111: tmp = ((y * (z - t)) / (z - a)) + x else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+133) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 5.8e+111) tmp = Float64(Float64(Float64(y * Float64(z - t)) / Float64(z - a)) + x); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7e+133) tmp = x + (y / (z / (z - t))); elseif (z <= 5.8e+111) tmp = ((y * (z - t)) / (z - a)) + x; else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+133], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+111], N[(N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+133}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+111}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a} + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -6.9999999999999997e133Initial program 65.4%
Taylor expanded in a around 0 60.4%
+-commutative60.4%
associate-/l*92.7%
Simplified92.7%
if -6.9999999999999997e133 < z < 5.7999999999999999e111Initial program 94.6%
if 5.7999999999999999e111 < z Initial program 73.5%
*-commutative73.5%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in z around inf 86.6%
associate-/r/95.5%
Applied egg-rr95.5%
Final simplification94.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e-19) (not (<= z 1.6e+63))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e-19) || !(z <= 1.6e+63)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (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 ((z <= (-2.3d-19)) .or. (.not. (z <= 1.6d+63))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y * (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 ((z <= -2.3e-19) || !(z <= 1.6e+63)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e-19) or not (z <= 1.6e+63): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e-19) || !(z <= 1.6e+63)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.3e-19) || ~((z <= 1.6e+63))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e-19], N[Not[LessEqual[z, 1.6e+63]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-19} \lor \neg \left(z \leq 1.6 \cdot 10^{+63}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.2999999999999998e-19 or 1.60000000000000006e63 < z Initial program 76.3%
*-commutative76.3%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in z around inf 80.3%
associate-/r/85.7%
Applied egg-rr85.7%
if -2.2999999999999998e-19 < z < 1.60000000000000006e63Initial program 96.5%
Taylor expanded in z around 0 79.8%
+-commutative79.8%
associate-/l*83.3%
Simplified83.3%
associate-/r/83.3%
Applied egg-rr83.3%
Final simplification84.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- z a))))
(if (or (<= t -8.2e-13) (not (<= t 6.8e+62)))
(- x (* t t_1))
(+ x (* z t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (z - a);
double tmp;
if ((t <= -8.2e-13) || !(t <= 6.8e+62)) {
tmp = x - (t * t_1);
} else {
tmp = x + (z * 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 = y / (z - a)
if ((t <= (-8.2d-13)) .or. (.not. (t <= 6.8d+62))) then
tmp = x - (t * t_1)
else
tmp = x + (z * 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 = y / (z - a);
double tmp;
if ((t <= -8.2e-13) || !(t <= 6.8e+62)) {
tmp = x - (t * t_1);
} else {
tmp = x + (z * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (z - a) tmp = 0 if (t <= -8.2e-13) or not (t <= 6.8e+62): tmp = x - (t * t_1) else: tmp = x + (z * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(z - a)) tmp = 0.0 if ((t <= -8.2e-13) || !(t <= 6.8e+62)) tmp = Float64(x - Float64(t * t_1)); else tmp = Float64(x + Float64(z * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (z - a); tmp = 0.0; if ((t <= -8.2e-13) || ~((t <= 6.8e+62))) tmp = x - (t * t_1); else tmp = x + (z * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -8.2e-13], N[Not[LessEqual[t, 6.8e+62]], $MachinePrecision]], N[(x - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z - a}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{-13} \lor \neg \left(t \leq 6.8 \cdot 10^{+62}\right):\\
\;\;\;\;x - t \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t_1\\
\end{array}
\end{array}
if t < -8.2000000000000004e-13 or 6.80000000000000028e62 < t Initial program 91.0%
Taylor expanded in t around inf 85.5%
associate-*r/91.0%
neg-mul-191.0%
distribute-rgt-neg-in91.0%
distribute-neg-frac91.0%
Simplified91.0%
Taylor expanded in x around 0 85.5%
mul-1-neg85.5%
associate-*r/91.0%
sub-neg91.0%
Simplified91.0%
if -8.2000000000000004e-13 < t < 6.80000000000000028e62Initial program 83.2%
Taylor expanded in t around 0 77.6%
+-commutative77.6%
associate-*l/89.6%
*-commutative89.6%
Simplified89.6%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3e+81) (not (<= z 2.1e+61))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3e+81) || !(z <= 2.1e+61)) {
tmp = y + x;
} else {
tmp = x + ((y * 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 ((z <= (-3d+81)) .or. (.not. (z <= 2.1d+61))) then
tmp = y + x
else
tmp = x + ((y * 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 ((z <= -3e+81) || !(z <= 2.1e+61)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3e+81) or not (z <= 2.1e+61): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3e+81) || !(z <= 2.1e+61)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3e+81) || ~((z <= 2.1e+61))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e+81], N[Not[LessEqual[z, 2.1e+61]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+81} \lor \neg \left(z \leq 2.1 \cdot 10^{+61}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.99999999999999997e81 or 2.1000000000000001e61 < z Initial program 72.0%
Taylor expanded in z around inf 81.2%
+-commutative81.2%
Simplified81.2%
if -2.99999999999999997e81 < z < 2.1000000000000001e61Initial program 96.4%
Taylor expanded in z around 0 78.1%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e+81) (not (<= z 1.3e+62))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+81) || !(z <= 1.3e+62)) {
tmp = y + x;
} else {
tmp = x + (y * (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 ((z <= (-7.6d+81)) .or. (.not. (z <= 1.3d+62))) then
tmp = y + x
else
tmp = x + (y * (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 ((z <= -7.6e+81) || !(z <= 1.3e+62)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e+81) or not (z <= 1.3e+62): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e+81) || !(z <= 1.3e+62)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.6e+81) || ~((z <= 1.3e+62))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e+81], N[Not[LessEqual[z, 1.3e+62]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+81} \lor \neg \left(z \leq 1.3 \cdot 10^{+62}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -7.599999999999999e81 or 1.29999999999999992e62 < z Initial program 72.0%
Taylor expanded in z around inf 81.2%
+-commutative81.2%
Simplified81.2%
if -7.599999999999999e81 < z < 1.29999999999999992e62Initial program 96.4%
Taylor expanded in z around 0 78.1%
+-commutative78.1%
associate-/l*80.8%
Simplified80.8%
associate-/r/81.5%
Applied egg-rr81.5%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e+152) x (if (<= a 3.7e+135) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e+152) {
tmp = x;
} else if (a <= 3.7e+135) {
tmp = y + x;
} 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 <= (-6d+152)) then
tmp = x
else if (a <= 3.7d+135) then
tmp = y + x
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 <= -6e+152) {
tmp = x;
} else if (a <= 3.7e+135) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e+152: tmp = x elif a <= 3.7e+135: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e+152) tmp = x; elseif (a <= 3.7e+135) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6e+152) tmp = x; elseif (a <= 3.7e+135) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e+152], x, If[LessEqual[a, 3.7e+135], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+152}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+135}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.99999999999999981e152 or 3.69999999999999997e135 < a Initial program 87.9%
Taylor expanded in x around inf 64.4%
if -5.99999999999999981e152 < a < 3.69999999999999997e135Initial program 85.7%
Taylor expanded in z around inf 69.1%
+-commutative69.1%
Simplified69.1%
Final simplification67.6%
(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%
Taylor expanded in x around inf 53.5%
Final simplification53.5%
(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 2023332
(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))))