
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (+ (* (* z a) b) (+ t_1 (* t a)))))
(if (<= t_2 (- INFINITY))
(+ t_1 (* z (* a (+ b (/ t z)))))
(if (<= t_2 INFINITY)
t_2
(* y (+ z (+ (/ x y) (/ (* a (+ t (* z b))) y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = ((z * a) * b) + (t_1 + (t * a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 + (z * (a * (b + (t / z))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = y * (z + ((x / y) + ((a * (t + (z * b))) / y)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = ((z * a) * b) + (t_1 + (t * a));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 + (z * (a * (b + (t / z))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = y * (z + ((x / y) + ((a * (t + (z * b))) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = ((z * a) * b) + (t_1 + (t * a)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 + (z * (a * (b + (t / z)))) elif t_2 <= math.inf: tmp = t_2 else: tmp = y * (z + ((x / y) + ((a * (t + (z * b))) / y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(Float64(Float64(z * a) * b) + Float64(t_1 + Float64(t * a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 + Float64(z * Float64(a * Float64(b + Float64(t / z))))); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(y * Float64(z + Float64(Float64(x / y) + Float64(Float64(a * Float64(t + Float64(z * b))) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = ((z * a) * b) + (t_1 + (t * a)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1 + (z * (a * (b + (t / z)))); elseif (t_2 <= Inf) tmp = t_2; else tmp = y * (z + ((x / y) + ((a * (t + (z * b))) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(t$95$1 + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(y * N[(z + N[(N[(x / y), $MachinePrecision] + N[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := \left(z \cdot a\right) \cdot b + \left(t\_1 + t \cdot a\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1 + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z + \left(\frac{x}{y} + \frac{a \cdot \left(t + z \cdot b\right)}{y}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < -inf.0Initial program 86.9%
associate-+l+86.9%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in z around inf 97.7%
associate-/l*97.7%
distribute-lft-out99.9%
Simplified99.9%
if -inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
+-commutative0.0%
fma-define0.0%
associate-*l*10.0%
*-commutative10.0%
*-commutative10.0%
distribute-rgt-out60.0%
remove-double-neg60.0%
*-commutative60.0%
distribute-lft-neg-out60.0%
sub-neg60.0%
sub-neg60.0%
distribute-lft-neg-out60.0%
*-commutative60.0%
remove-double-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y around inf 90.0%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (+ (* (* z a) b) (+ t_1 (* t a)))))
(if (<= t_2 (- INFINITY))
(+ t_1 (* z (* a (+ b (/ t z)))))
(if (<= t_2 INFINITY) t_2 (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = ((z * a) * b) + (t_1 + (t * a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1 + (z * (a * (b + (t / z))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = ((z * a) * b) + (t_1 + (t * a));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1 + (z * (a * (b + (t / z))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = ((z * a) * b) + (t_1 + (t * a)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 + (z * (a * (b + (t / z)))) elif t_2 <= math.inf: tmp = t_2 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(Float64(Float64(z * a) * b) + Float64(t_1 + Float64(t * a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_1 + Float64(z * Float64(a * Float64(b + Float64(t / z))))); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = ((z * a) * b) + (t_1 + (t * a)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1 + (z * (a * (b + (t / z)))); elseif (t_2 <= Inf) tmp = t_2; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(t$95$1 + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := \left(z \cdot a\right) \cdot b + \left(t\_1 + t \cdot a\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1 + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < -inf.0Initial program 86.9%
associate-+l+86.9%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in z around inf 97.7%
associate-/l*97.7%
distribute-lft-out99.9%
Simplified99.9%
if -inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*10.0%
Simplified10.0%
Taylor expanded in z around inf 90.0%
+-commutative90.0%
Simplified90.0%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -3.8e-160)
t_1
(if (<= a 1.76e-184)
(+ x (* y z))
(if (or (<= a 5.6e-59) (not (<= a 1.25e+40)))
t_1
(* z (+ y (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -3.8e-160) {
tmp = t_1;
} else if (a <= 1.76e-184) {
tmp = x + (y * z);
} else if ((a <= 5.6e-59) || !(a <= 1.25e+40)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (a * (t + (z * b)))
if (a <= (-3.8d-160)) then
tmp = t_1
else if (a <= 1.76d-184) then
tmp = x + (y * z)
else if ((a <= 5.6d-59) .or. (.not. (a <= 1.25d+40))) then
tmp = t_1
else
tmp = z * (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -3.8e-160) {
tmp = t_1;
} else if (a <= 1.76e-184) {
tmp = x + (y * z);
} else if ((a <= 5.6e-59) || !(a <= 1.25e+40)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if a <= -3.8e-160: tmp = t_1 elif a <= 1.76e-184: tmp = x + (y * z) elif (a <= 5.6e-59) or not (a <= 1.25e+40): tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -3.8e-160) tmp = t_1; elseif (a <= 1.76e-184) tmp = Float64(x + Float64(y * z)); elseif ((a <= 5.6e-59) || !(a <= 1.25e+40)) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -3.8e-160) tmp = t_1; elseif (a <= 1.76e-184) tmp = x + (y * z); elseif ((a <= 5.6e-59) || ~((a <= 1.25e+40))) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e-160], t$95$1, If[LessEqual[a, 1.76e-184], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 5.6e-59], N[Not[LessEqual[a, 1.25e+40]], $MachinePrecision]], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{-160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.76 \cdot 10^{-184}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-59} \lor \neg \left(a \leq 1.25 \cdot 10^{+40}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if a < -3.7999999999999998e-160 or 1.76e-184 < a < 5.59999999999999961e-59 or 1.25000000000000001e40 < a Initial program 91.9%
associate-+l+91.9%
+-commutative91.9%
fma-define91.9%
associate-*l*94.0%
*-commutative94.0%
*-commutative94.0%
distribute-rgt-out96.7%
remove-double-neg96.7%
*-commutative96.7%
distribute-lft-neg-out96.7%
sub-neg96.7%
sub-neg96.7%
distribute-lft-neg-out96.7%
*-commutative96.7%
remove-double-neg96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 87.4%
if -3.7999999999999998e-160 < a < 1.76e-184Initial program 99.9%
associate-+l+99.9%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in a around 0 86.8%
if 5.59999999999999961e-59 < a < 1.25000000000000001e40Initial program 89.1%
associate-+l+89.1%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in z around inf 83.8%
+-commutative83.8%
Simplified83.8%
Final simplification87.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -8e+166)
(not (or (<= z -5.5e+137) (and (not (<= z -7e+56)) (<= z 2.5e-27)))))
(* z (+ y (* a b)))
(+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e+166) || !((z <= -5.5e+137) || (!(z <= -7e+56) && (z <= 2.5e-27)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((z <= (-8d+166)) .or. (.not. (z <= (-5.5d+137)) .or. (.not. (z <= (-7d+56))) .and. (z <= 2.5d-27))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8e+166) || !((z <= -5.5e+137) || (!(z <= -7e+56) && (z <= 2.5e-27)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8e+166) or not ((z <= -5.5e+137) or (not (z <= -7e+56) and (z <= 2.5e-27))): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8e+166) || !((z <= -5.5e+137) || (!(z <= -7e+56) && (z <= 2.5e-27)))) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8e+166) || ~(((z <= -5.5e+137) || (~((z <= -7e+56)) && (z <= 2.5e-27))))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8e+166], N[Not[Or[LessEqual[z, -5.5e+137], And[N[Not[LessEqual[z, -7e+56]], $MachinePrecision], LessEqual[z, 2.5e-27]]]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+166} \lor \neg \left(z \leq -5.5 \cdot 10^{+137} \lor \neg \left(z \leq -7 \cdot 10^{+56}\right) \land z \leq 2.5 \cdot 10^{-27}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -7.99999999999999952e166 or -5.5000000000000002e137 < z < -6.99999999999999999e56 or 2.5000000000000001e-27 < z Initial program 88.8%
associate-+l+88.8%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in z around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -7.99999999999999952e166 < z < -5.5000000000000002e137 or -6.99999999999999999e56 < z < 2.5000000000000001e-27Initial program 97.8%
associate-+l+97.8%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in z around 0 79.3%
+-commutative79.3%
Simplified79.3%
Final simplification80.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -2.55e+57)
t_1
(if (<= z 1.55e-13)
x
(if (or (<= z 9.2e+138) (not (<= z 6.8e+208))) t_1 (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -2.55e+57) {
tmp = t_1;
} else if (z <= 1.55e-13) {
tmp = x;
} else if ((z <= 9.2e+138) || !(z <= 6.8e+208)) {
tmp = t_1;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (z <= (-2.55d+57)) then
tmp = t_1
else if (z <= 1.55d-13) then
tmp = x
else if ((z <= 9.2d+138) .or. (.not. (z <= 6.8d+208))) then
tmp = t_1
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -2.55e+57) {
tmp = t_1;
} else if (z <= 1.55e-13) {
tmp = x;
} else if ((z <= 9.2e+138) || !(z <= 6.8e+208)) {
tmp = t_1;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -2.55e+57: tmp = t_1 elif z <= 1.55e-13: tmp = x elif (z <= 9.2e+138) or not (z <= 6.8e+208): tmp = t_1 else: tmp = y * z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -2.55e+57) tmp = t_1; elseif (z <= 1.55e-13) tmp = x; elseif ((z <= 9.2e+138) || !(z <= 6.8e+208)) tmp = t_1; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -2.55e+57) tmp = t_1; elseif (z <= 1.55e-13) tmp = x; elseif ((z <= 9.2e+138) || ~((z <= 6.8e+208))) tmp = t_1; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+57], t$95$1, If[LessEqual[z, 1.55e-13], x, If[Or[LessEqual[z, 9.2e+138], N[Not[LessEqual[z, 6.8e+208]], $MachinePrecision]], t$95$1, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.55 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+138} \lor \neg \left(z \leq 6.8 \cdot 10^{+208}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -2.55000000000000011e57 or 1.55e-13 < z < 9.2000000000000003e138 or 6.7999999999999997e208 < z Initial program 87.9%
associate-+l+87.9%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in z around inf 77.3%
+-commutative77.3%
Simplified77.3%
Taylor expanded in a around inf 49.7%
if -2.55000000000000011e57 < z < 1.55e-13Initial program 98.5%
associate-+l+98.5%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in x around inf 41.4%
if 9.2000000000000003e138 < z < 6.7999999999999997e208Initial program 89.4%
associate-+l+89.4%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
Simplified59.1%
Final simplification46.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.6e-70) (not (<= z 6.2e-43))) (+ (+ x (* y z)) (* z (* a (+ b (/ t z))))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.6e-70) || !(z <= 6.2e-43)) {
tmp = (x + (y * z)) + (z * (a * (b + (t / z))));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.6d-70)) .or. (.not. (z <= 6.2d-43))) then
tmp = (x + (y * z)) + (z * (a * (b + (t / z))))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.6e-70) || !(z <= 6.2e-43)) {
tmp = (x + (y * z)) + (z * (a * (b + (t / z))));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.6e-70) or not (z <= 6.2e-43): tmp = (x + (y * z)) + (z * (a * (b + (t / z)))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.6e-70) || !(z <= 6.2e-43)) tmp = Float64(Float64(x + Float64(y * z)) + Float64(z * Float64(a * Float64(b + Float64(t / z))))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.6e-70) || ~((z <= 6.2e-43))) tmp = (x + (y * z)) + (z * (a * (b + (t / z)))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.6e-70], N[Not[LessEqual[z, 6.2e-43]], $MachinePrecision]], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-70} \lor \neg \left(z \leq 6.2 \cdot 10^{-43}\right):\\
\;\;\;\;\left(x + y \cdot z\right) + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.5999999999999999e-70 or 6.1999999999999999e-43 < z Initial program 89.6%
associate-+l+89.6%
associate-*l*87.6%
Simplified87.6%
Taylor expanded in z around inf 95.3%
associate-/l*96.6%
distribute-lft-out96.6%
Simplified96.6%
if -1.5999999999999999e-70 < z < 6.1999999999999999e-43Initial program 99.0%
associate-+l+99.0%
+-commutative99.0%
fma-define99.0%
associate-*l*99.0%
*-commutative99.0%
*-commutative99.0%
distribute-rgt-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 90.8%
Final simplification94.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (or (<= z -2e+132) (not (<= z 1.7e-14)))
(+ t_1 (* z (* a (+ b (/ t z)))))
(+ t_1 (+ (* a (* z b)) (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if ((z <= -2e+132) || !(z <= 1.7e-14)) {
tmp = t_1 + (z * (a * (b + (t / z))));
} else {
tmp = t_1 + ((a * (z * b)) + (t * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * z)
if ((z <= (-2d+132)) .or. (.not. (z <= 1.7d-14))) then
tmp = t_1 + (z * (a * (b + (t / z))))
else
tmp = t_1 + ((a * (z * b)) + (t * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if ((z <= -2e+132) || !(z <= 1.7e-14)) {
tmp = t_1 + (z * (a * (b + (t / z))));
} else {
tmp = t_1 + ((a * (z * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if (z <= -2e+132) or not (z <= 1.7e-14): tmp = t_1 + (z * (a * (b + (t / z)))) else: tmp = t_1 + ((a * (z * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if ((z <= -2e+132) || !(z <= 1.7e-14)) tmp = Float64(t_1 + Float64(z * Float64(a * Float64(b + Float64(t / z))))); else tmp = Float64(t_1 + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if ((z <= -2e+132) || ~((z <= 1.7e-14))) tmp = t_1 + (z * (a * (b + (t / z)))); else tmp = t_1 + ((a * (z * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -2e+132], N[Not[LessEqual[z, 1.7e-14]], $MachinePrecision]], N[(t$95$1 + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -2 \cdot 10^{+132} \lor \neg \left(z \leq 1.7 \cdot 10^{-14}\right):\\
\;\;\;\;t\_1 + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if z < -1.99999999999999998e132 or 1.70000000000000001e-14 < z Initial program 86.7%
associate-+l+86.7%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in z around inf 93.6%
associate-/l*96.3%
distribute-lft-out96.3%
Simplified96.3%
if -1.99999999999999998e132 < z < 1.70000000000000001e-14Initial program 98.6%
associate-+l+98.6%
associate-*l*99.3%
Simplified99.3%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.8e+78) (not (<= b 1.4e+46))) (+ x (* b (* a (+ z (/ t b))))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.8e+78) || !(b <= 1.4e+46)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((b <= (-5.8d+78)) .or. (.not. (b <= 1.4d+46))) then
tmp = x + (b * (a * (z + (t / b))))
else
tmp = (x + (y * z)) + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.8e+78) || !(b <= 1.4e+46)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.8e+78) or not (b <= 1.4e+46): tmp = x + (b * (a * (z + (t / b)))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.8e+78) || !(b <= 1.4e+46)) tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.8e+78) || ~((b <= 1.4e+46))) tmp = x + (b * (a * (z + (t / b)))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.8e+78], N[Not[LessEqual[b, 1.4e+46]], $MachinePrecision]], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.8 \cdot 10^{+78} \lor \neg \left(b \leq 1.4 \cdot 10^{+46}\right):\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if b < -5.80000000000000034e78 or 1.40000000000000009e46 < b Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
fma-define92.6%
associate-*l*83.6%
*-commutative83.6%
*-commutative83.6%
distribute-rgt-out87.7%
remove-double-neg87.7%
*-commutative87.7%
distribute-lft-neg-out87.7%
sub-neg87.7%
sub-neg87.7%
distribute-lft-neg-out87.7%
*-commutative87.7%
remove-double-neg87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y around 0 83.3%
Taylor expanded in b around inf 83.5%
associate-/l*87.7%
distribute-lft-out87.7%
Simplified87.7%
if -5.80000000000000034e78 < b < 1.40000000000000009e46Initial program 94.0%
associate-+l+94.0%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in t around inf 90.9%
Final simplification89.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7.2e-8) (not (<= a 1.9e+41))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7.2e-8) || !(a <= 1.9e+41)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((a <= (-7.2d-8)) .or. (.not. (a <= 1.9d+41))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7.2e-8) || !(a <= 1.9e+41)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7.2e-8) or not (a <= 1.9e+41): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7.2e-8) || !(a <= 1.9e+41)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -7.2e-8) || ~((a <= 1.9e+41))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7.2e-8], N[Not[LessEqual[a, 1.9e+41]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-8} \lor \neg \left(a \leq 1.9 \cdot 10^{+41}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if a < -7.19999999999999962e-8 or 1.9000000000000001e41 < a Initial program 88.2%
associate-+l+88.2%
+-commutative88.2%
fma-define88.2%
associate-*l*93.5%
*-commutative93.5%
*-commutative93.5%
distribute-rgt-out97.5%
remove-double-neg97.5%
*-commutative97.5%
distribute-lft-neg-out97.5%
sub-neg97.5%
sub-neg97.5%
distribute-lft-neg-out97.5%
*-commutative97.5%
remove-double-neg97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in y around 0 92.3%
if -7.19999999999999962e-8 < a < 1.9000000000000001e41Initial program 98.5%
associate-+l+98.5%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in t around inf 87.8%
Final simplification90.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.7e+70) (not (<= a 2.7e+159))) (* z (* a b)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.7e+70) || !(a <= 2.7e+159)) {
tmp = z * (a * b);
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((a <= (-4.7d+70)) .or. (.not. (a <= 2.7d+159))) then
tmp = z * (a * b)
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.7e+70) || !(a <= 2.7e+159)) {
tmp = z * (a * b);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.7e+70) or not (a <= 2.7e+159): tmp = z * (a * b) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.7e+70) || !(a <= 2.7e+159)) tmp = Float64(z * Float64(a * b)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.7e+70) || ~((a <= 2.7e+159))) tmp = z * (a * b); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.7e+70], N[Not[LessEqual[a, 2.7e+159]], $MachinePrecision]], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{+70} \lor \neg \left(a \leq 2.7 \cdot 10^{+159}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -4.6999999999999998e70 or 2.70000000000000008e159 < a Initial program 85.2%
associate-+l+85.2%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in z around inf 52.7%
+-commutative52.7%
Simplified52.7%
Taylor expanded in a around inf 49.3%
if -4.6999999999999998e70 < a < 2.70000000000000008e159Initial program 97.6%
associate-+l+97.6%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in a around 0 68.2%
Final simplification61.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e-47) (not (<= y 7e+56))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e-47) || !(y <= 7e+56)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.7d-47)) .or. (.not. (y <= 7d+56))) then
tmp = x + (y * z)
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e-47) || !(y <= 7e+56)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e-47) or not (y <= 7e+56): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e-47) || !(y <= 7e+56)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.7e-47) || ~((y <= 7e+56))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e-47], N[Not[LessEqual[y, 7e+56]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-47} \lor \neg \left(y \leq 7 \cdot 10^{+56}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -1.7000000000000001e-47 or 6.99999999999999999e56 < y Initial program 92.8%
associate-+l+92.8%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in a around 0 67.0%
if -1.7000000000000001e-47 < y < 6.99999999999999999e56Initial program 94.1%
associate-+l+94.1%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in z around 0 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.1e+91) x (if (<= x 5.6e-71) (* y z) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.1e+91) {
tmp = x;
} else if (x <= 5.6e-71) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (x <= (-3.1d+91)) then
tmp = x
else if (x <= 5.6d-71) then
tmp = y * z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.1e+91) {
tmp = x;
} else if (x <= 5.6e-71) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.1e+91: tmp = x elif x <= 5.6e-71: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.1e+91) tmp = x; elseif (x <= 5.6e-71) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.1e+91) tmp = x; elseif (x <= 5.6e-71) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.1e+91], x, If[LessEqual[x, 5.6e-71], N[(y * z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-71}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.09999999999999998e91 or 5.60000000000000001e-71 < x Initial program 94.1%
associate-+l+94.1%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in x around inf 47.5%
if -3.09999999999999998e91 < x < 5.60000000000000001e-71Initial program 92.9%
associate-+l+92.9%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in y around inf 35.7%
*-commutative35.7%
Simplified35.7%
Final simplification41.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.5%
associate-+l+93.5%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around inf 27.5%
Final simplification27.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * 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 b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024130
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))