
(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 17 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
(if (<= a -1e+34)
(* a (+ t (+ (* b z) (+ (/ x a) (/ (* z y) a)))))
(if (<= a 1e-71)
(+ x (+ (* a t) (* z (+ y (* a b)))))
(+ (fma y z x) (* a (+ t (* b z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1e+34) {
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))));
} else if (a <= 1e-71) {
tmp = x + ((a * t) + (z * (y + (a * b))));
} else {
tmp = fma(y, z, x) + (a * (t + (b * z)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1e+34) tmp = Float64(a * Float64(t + Float64(Float64(b * z) + Float64(Float64(x / a) + Float64(Float64(z * y) / a))))); elseif (a <= 1e-71) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b))))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(b * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1e+34], N[(a * N[(t + N[(N[(b * z), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e-71], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+34}:\\
\;\;\;\;a \cdot \left(t + \left(b \cdot z + \left(\frac{x}{a} + \frac{z \cdot y}{a}\right)\right)\right)\\
\mathbf{elif}\;a \leq 10^{-71}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + b \cdot z\right)\\
\end{array}
\end{array}
if a < -9.99999999999999946e33Initial program 79.3%
associate-+l+79.3%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in a around inf 96.2%
if -9.99999999999999946e33 < a < 9.9999999999999992e-72Initial program 97.5%
associate-+l+97.5%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in z around 0 99.9%
if 9.9999999999999992e-72 < a Initial program 88.2%
associate-+l+88.2%
+-commutative88.2%
fma-define88.2%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
distribute-rgt-out98.7%
remove-double-neg98.7%
*-commutative98.7%
distribute-lft-neg-out98.7%
sub-neg98.7%
sub-neg98.7%
distribute-lft-neg-out98.7%
*-commutative98.7%
remove-double-neg98.7%
*-commutative98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* z y))) (* b (* a z))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (a * z));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} 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 = ((a * t) + (x + (z * y))) + (b * (a * z));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((a * t) + (x + (z * y))) + (b * (a * z)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(z * y))) + Float64(b * Float64(a * z))) tmp = 0.0 if (t_1 <= Inf) 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 = ((a * t) + (x + (z * y))) + (b * (a * z)); tmp = 0.0; if (t_1 <= Inf) 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[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\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 97.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*22.2%
Simplified22.2%
Taylor expanded in z around inf 88.9%
Final simplification96.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.2e+28) (not (<= a 1e+46))) (* a (+ t (+ (* b z) (+ (/ x a) (/ (* z y) a))))) (+ x (+ (* a t) (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.2e+28) || !(a <= 1e+46)) {
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))));
} else {
tmp = x + ((a * t) + (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) :: tmp
if ((a <= (-3.2d+28)) .or. (.not. (a <= 1d+46))) then
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))))
else
tmp = x + ((a * t) + (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 tmp;
if ((a <= -3.2e+28) || !(a <= 1e+46)) {
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))));
} else {
tmp = x + ((a * t) + (z * (y + (a * b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.2e+28) or not (a <= 1e+46): tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a)))) else: tmp = x + ((a * t) + (z * (y + (a * b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.2e+28) || !(a <= 1e+46)) tmp = Float64(a * Float64(t + Float64(Float64(b * z) + Float64(Float64(x / a) + Float64(Float64(z * y) / a))))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.2e+28) || ~((a <= 1e+46))) tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a)))); else tmp = x + ((a * t) + (z * (y + (a * b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.2e+28], N[Not[LessEqual[a, 1e+46]], $MachinePrecision]], N[(a * N[(t + N[(N[(b * z), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+28} \lor \neg \left(a \leq 10^{+46}\right):\\
\;\;\;\;a \cdot \left(t + \left(b \cdot z + \left(\frac{x}{a} + \frac{z \cdot y}{a}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -3.2e28 or 9.9999999999999999e45 < a Initial program 81.4%
associate-+l+81.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in a around inf 97.2%
if -3.2e28 < a < 9.9999999999999999e45Initial program 97.9%
associate-+l+97.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in z around 0 99.9%
Final simplification98.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.4e+165)
(* z (+ y (* a b)))
(if (or (<= b -6.5e+44) (not (<= b 7e+88)))
(+ x (* b (* a (+ z (/ t b)))))
(+ x (+ (* a t) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.4e+165) {
tmp = z * (y + (a * b));
} else if ((b <= -6.5e+44) || !(b <= 7e+88)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = x + ((a * t) + (z * y));
}
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 <= (-1.4d+165)) then
tmp = z * (y + (a * b))
else if ((b <= (-6.5d+44)) .or. (.not. (b <= 7d+88))) then
tmp = x + (b * (a * (z + (t / b))))
else
tmp = x + ((a * t) + (z * y))
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 <= -1.4e+165) {
tmp = z * (y + (a * b));
} else if ((b <= -6.5e+44) || !(b <= 7e+88)) {
tmp = x + (b * (a * (z + (t / b))));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.4e+165: tmp = z * (y + (a * b)) elif (b <= -6.5e+44) or not (b <= 7e+88): tmp = x + (b * (a * (z + (t / b)))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.4e+165) tmp = Float64(z * Float64(y + Float64(a * b))); elseif ((b <= -6.5e+44) || !(b <= 7e+88)) tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.4e+165) tmp = z * (y + (a * b)); elseif ((b <= -6.5e+44) || ~((b <= 7e+88))) tmp = x + (b * (a * (z + (t / b)))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.4e+165], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -6.5e+44], N[Not[LessEqual[b, 7e+88]], $MachinePrecision]], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{+165}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq -6.5 \cdot 10^{+44} \lor \neg \left(b \leq 7 \cdot 10^{+88}\right):\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if b < -1.3999999999999999e165Initial program 91.3%
associate-+l+91.3%
associate-*l*75.1%
Simplified75.1%
Taylor expanded in z around inf 91.8%
if -1.3999999999999999e165 < b < -6.50000000000000018e44 or 6.9999999999999995e88 < b Initial program 87.6%
associate-+l+87.6%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in y around 0 75.4%
Taylor expanded in b around inf 78.3%
associate-/l*82.9%
distribute-lft-out86.1%
Simplified86.1%
if -6.50000000000000018e44 < b < 6.9999999999999995e88Initial program 91.8%
associate-+l+91.8%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in b around 0 91.4%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -9.2e+199)
(* z (+ y (* a b)))
(if (or (<= b -1.05e+44) (not (<= b 3e+91)))
(+ x (* a (+ t (* b z))))
(+ x (+ (* a t) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.2e+199) {
tmp = z * (y + (a * b));
} else if ((b <= -1.05e+44) || !(b <= 3e+91)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (z * y));
}
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 <= (-9.2d+199)) then
tmp = z * (y + (a * b))
else if ((b <= (-1.05d+44)) .or. (.not. (b <= 3d+91))) then
tmp = x + (a * (t + (b * z)))
else
tmp = x + ((a * t) + (z * y))
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 <= -9.2e+199) {
tmp = z * (y + (a * b));
} else if ((b <= -1.05e+44) || !(b <= 3e+91)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.2e+199: tmp = z * (y + (a * b)) elif (b <= -1.05e+44) or not (b <= 3e+91): tmp = x + (a * (t + (b * z))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.2e+199) tmp = Float64(z * Float64(y + Float64(a * b))); elseif ((b <= -1.05e+44) || !(b <= 3e+91)) tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -9.2e+199) tmp = z * (y + (a * b)); elseif ((b <= -1.05e+44) || ~((b <= 3e+91))) tmp = x + (a * (t + (b * z))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.2e+199], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -1.05e+44], N[Not[LessEqual[b, 3e+91]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{+199}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq -1.05 \cdot 10^{+44} \lor \neg \left(b \leq 3 \cdot 10^{+91}\right):\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if b < -9.19999999999999979e199Initial program 93.4%
associate-+l+93.4%
associate-*l*75.1%
Simplified75.1%
Taylor expanded in z around inf 90.8%
if -9.19999999999999979e199 < b < -1.04999999999999993e44 or 3.00000000000000006e91 < b Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
fma-define86.8%
associate-*l*82.5%
*-commutative82.5%
*-commutative82.5%
distribute-rgt-out91.3%
remove-double-neg91.3%
*-commutative91.3%
distribute-lft-neg-out91.3%
sub-neg91.3%
sub-neg91.3%
distribute-lft-neg-out91.3%
*-commutative91.3%
remove-double-neg91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in y around 0 84.1%
if -1.04999999999999993e44 < b < 3.00000000000000006e91Initial program 91.8%
associate-+l+91.8%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in b around 0 91.4%
Final simplification89.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.9e+147) (not (<= a 3.5e+179))) (+ x (* a (+ t (* b z)))) (+ x (+ (* a t) (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.9e+147) || !(a <= 3.5e+179)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (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) :: tmp
if ((a <= (-1.9d+147)) .or. (.not. (a <= 3.5d+179))) then
tmp = x + (a * (t + (b * z)))
else
tmp = x + ((a * t) + (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 tmp;
if ((a <= -1.9e+147) || !(a <= 3.5e+179)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (z * (y + (a * b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.9e+147) or not (a <= 3.5e+179): tmp = x + (a * (t + (b * z))) else: tmp = x + ((a * t) + (z * (y + (a * b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.9e+147) || !(a <= 3.5e+179)) tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.9e+147) || ~((a <= 3.5e+179))) tmp = x + (a * (t + (b * z))); else tmp = x + ((a * t) + (z * (y + (a * b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.9e+147], N[Not[LessEqual[a, 3.5e+179]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+147} \lor \neg \left(a \leq 3.5 \cdot 10^{+179}\right):\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -1.89999999999999985e147 or 3.50000000000000015e179 < a Initial program 75.4%
associate-+l+75.4%
+-commutative75.4%
fma-define75.4%
associate-*l*80.3%
*-commutative80.3%
*-commutative80.3%
distribute-rgt-out93.4%
remove-double-neg93.4%
*-commutative93.4%
distribute-lft-neg-out93.4%
sub-neg93.4%
sub-neg93.4%
distribute-lft-neg-out93.4%
*-commutative93.4%
remove-double-neg93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in y around 0 95.2%
if -1.89999999999999985e147 < a < 3.50000000000000015e179Initial program 95.5%
associate-+l+95.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in z around 0 98.4%
Final simplification97.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.2e+59) (not (<= z 2.15e+61))) (* z (+ y (* a b))) (+ x (* a (+ t (* b z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.2e+59) || !(z <= 2.15e+61)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (b * 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 ((z <= (-6.2d+59)) .or. (.not. (z <= 2.15d+61))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (b * 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 ((z <= -6.2e+59) || !(z <= 2.15e+61)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (b * z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.2e+59) or not (z <= 2.15e+61): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (b * z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.2e+59) || !(z <= 2.15e+61)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.2e+59) || ~((z <= 2.15e+61))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (b * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.2e+59], N[Not[LessEqual[z, 2.15e+61]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+59} \lor \neg \left(z \leq 2.15 \cdot 10^{+61}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\end{array}
\end{array}
if z < -6.20000000000000029e59 or 2.1500000000000001e61 < z Initial program 82.8%
associate-+l+82.8%
associate-*l*80.5%
Simplified80.5%
Taylor expanded in z around inf 84.4%
if -6.20000000000000029e59 < z < 2.1500000000000001e61Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
fma-define97.8%
associate-*l*99.3%
*-commutative99.3%
*-commutative99.3%
distribute-rgt-out99.2%
remove-double-neg99.2%
*-commutative99.2%
distribute-lft-neg-out99.2%
sub-neg99.2%
sub-neg99.2%
distribute-lft-neg-out99.2%
*-commutative99.2%
remove-double-neg99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in y around 0 84.1%
Final simplification84.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.5e+92) (* z y) (if (<= y 4e-107) (* b (* a z)) (if (<= y 0.0022) x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.5e+92) {
tmp = z * y;
} else if (y <= 4e-107) {
tmp = b * (a * z);
} else if (y <= 0.0022) {
tmp = x;
} else {
tmp = z * y;
}
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 <= (-6.5d+92)) then
tmp = z * y
else if (y <= 4d-107) then
tmp = b * (a * z)
else if (y <= 0.0022d0) then
tmp = x
else
tmp = z * y
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 <= -6.5e+92) {
tmp = z * y;
} else if (y <= 4e-107) {
tmp = b * (a * z);
} else if (y <= 0.0022) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.5e+92: tmp = z * y elif y <= 4e-107: tmp = b * (a * z) elif y <= 0.0022: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.5e+92) tmp = Float64(z * y); elseif (y <= 4e-107) tmp = Float64(b * Float64(a * z)); elseif (y <= 0.0022) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.5e+92) tmp = z * y; elseif (y <= 4e-107) tmp = b * (a * z); elseif (y <= 0.0022) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.5e+92], N[(z * y), $MachinePrecision], If[LessEqual[y, 4e-107], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0022], x, N[(z * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+92}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-107}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;y \leq 0.0022:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -6.49999999999999999e92 or 0.00220000000000000013 < y Initial program 90.5%
associate-+l+90.5%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in z around inf 70.4%
Taylor expanded in y around inf 58.2%
*-commutative58.2%
Simplified58.2%
if -6.49999999999999999e92 < y < 4e-107Initial program 90.5%
associate-+l+90.5%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in a around inf 84.8%
Taylor expanded in z around inf 45.8%
Taylor expanded in a around inf 40.4%
*-commutative40.4%
associate-*r*43.6%
*-commutative43.6%
*-commutative43.6%
Simplified43.6%
if 4e-107 < y < 0.00220000000000000013Initial program 92.3%
associate-+l+92.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in z around 0 64.4%
Taylor expanded in x around inf 43.3%
Final simplification49.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.08e+77) (* z y) (if (<= y 8e-163) (* a (* b z)) (if (<= y 1.12e-7) x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.08e+77) {
tmp = z * y;
} else if (y <= 8e-163) {
tmp = a * (b * z);
} else if (y <= 1.12e-7) {
tmp = x;
} else {
tmp = z * y;
}
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.08d+77)) then
tmp = z * y
else if (y <= 8d-163) then
tmp = a * (b * z)
else if (y <= 1.12d-7) then
tmp = x
else
tmp = z * y
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.08e+77) {
tmp = z * y;
} else if (y <= 8e-163) {
tmp = a * (b * z);
} else if (y <= 1.12e-7) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.08e+77: tmp = z * y elif y <= 8e-163: tmp = a * (b * z) elif y <= 1.12e-7: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.08e+77) tmp = Float64(z * y); elseif (y <= 8e-163) tmp = Float64(a * Float64(b * z)); elseif (y <= 1.12e-7) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.08e+77) tmp = z * y; elseif (y <= 8e-163) tmp = a * (b * z); elseif (y <= 1.12e-7) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.08e+77], N[(z * y), $MachinePrecision], If[LessEqual[y, 8e-163], N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e-7], x, N[(z * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+77}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-163}:\\
\;\;\;\;a \cdot \left(b \cdot z\right)\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -1.07999999999999996e77 or 1.12e-7 < y Initial program 90.9%
associate-+l+90.9%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around inf 67.3%
Taylor expanded in y around inf 55.7%
*-commutative55.7%
Simplified55.7%
if -1.07999999999999996e77 < y < 7.99999999999999939e-163Initial program 89.4%
associate-+l+89.4%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in a around inf 85.6%
Taylor expanded in z around inf 49.0%
Taylor expanded in b around inf 43.0%
*-commutative43.0%
Simplified43.0%
if 7.99999999999999939e-163 < y < 1.12e-7Initial program 94.1%
associate-+l+94.1%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in z around 0 61.5%
Taylor expanded in x around inf 42.4%
Final simplification48.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.15e+55) (not (<= z 2e-48))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.15e+55) || !(z <= 2e-48)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
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.15d+55)) .or. (.not. (z <= 2d-48))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
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.15e+55) || !(z <= 2e-48)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.15e+55) or not (z <= 2e-48): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.15e+55) || !(z <= 2e-48)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.15e+55) || ~((z <= 2e-48))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.15e+55], N[Not[LessEqual[z, 2e-48]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+55} \lor \neg \left(z \leq 2 \cdot 10^{-48}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1.14999999999999994e55 or 1.9999999999999999e-48 < z Initial program 84.6%
associate-+l+84.6%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in z around inf 80.9%
if -1.14999999999999994e55 < z < 1.9999999999999999e-48Initial program 98.3%
associate-+l+98.3%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 71.6%
Final simplification76.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.1e+19) (not (<= a 0.054))) (* a (+ t (* b z))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.1e+19) || !(a <= 0.054)) {
tmp = a * (t + (b * z));
} else {
tmp = x + (z * y);
}
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.1d+19)) .or. (.not. (a <= 0.054d0))) then
tmp = a * (t + (b * z))
else
tmp = x + (z * y)
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.1e+19) || !(a <= 0.054)) {
tmp = a * (t + (b * z));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.1e+19) or not (a <= 0.054): tmp = a * (t + (b * z)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.1e+19) || !(a <= 0.054)) tmp = Float64(a * Float64(t + Float64(b * z))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.1e+19) || ~((a <= 0.054))) tmp = a * (t + (b * z)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.1e+19], N[Not[LessEqual[a, 0.054]], $MachinePrecision]], N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+19} \lor \neg \left(a \leq 0.054\right):\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -4.1e19 or 0.0539999999999999994 < a Initial program 82.3%
associate-+l+82.3%
+-commutative82.3%
fma-define82.3%
associate-*l*88.7%
*-commutative88.7%
*-commutative88.7%
distribute-rgt-out95.9%
remove-double-neg95.9%
*-commutative95.9%
distribute-lft-neg-out95.9%
sub-neg95.9%
sub-neg95.9%
distribute-lft-neg-out95.9%
*-commutative95.9%
remove-double-neg95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in y around 0 88.1%
Taylor expanded in x around 0 74.4%
if -4.1e19 < a < 0.0539999999999999994Initial program 98.5%
associate-+l+98.5%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in a around 0 73.2%
*-commutative73.2%
Simplified73.2%
Final simplification73.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.2e-13) (not (<= a 1.27e+73))) (+ x (* a t)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.2e-13) || !(a <= 1.27e+73)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
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 <= (-2.2d-13)) .or. (.not. (a <= 1.27d+73))) then
tmp = x + (a * t)
else
tmp = x + (z * y)
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 <= -2.2e-13) || !(a <= 1.27e+73)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.2e-13) or not (a <= 1.27e+73): tmp = x + (a * t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.2e-13) || !(a <= 1.27e+73)) tmp = Float64(x + Float64(a * t)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.2e-13) || ~((a <= 1.27e+73))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.2e-13], N[Not[LessEqual[a, 1.27e+73]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-13} \lor \neg \left(a \leq 1.27 \cdot 10^{+73}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -2.19999999999999997e-13 or 1.2700000000000001e73 < a Initial program 81.0%
associate-+l+81.0%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in z around 0 59.0%
if -2.19999999999999997e-13 < a < 1.2700000000000001e73Initial program 98.6%
associate-+l+98.6%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in z around 0 99.2%
Taylor expanded in a around 0 70.8%
*-commutative70.8%
Simplified70.8%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.6e+76) (not (<= y 0.00135))) (* z y) (* z (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.6e+76) || !(y <= 0.00135)) {
tmp = z * y;
} else {
tmp = z * (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) :: tmp
if ((y <= (-6.6d+76)) .or. (.not. (y <= 0.00135d0))) then
tmp = z * y
else
tmp = z * (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 tmp;
if ((y <= -6.6e+76) || !(y <= 0.00135)) {
tmp = z * y;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.6e+76) or not (y <= 0.00135): tmp = z * y else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.6e+76) || !(y <= 0.00135)) tmp = Float64(z * y); else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.6e+76) || ~((y <= 0.00135))) tmp = z * y; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.6e+76], N[Not[LessEqual[y, 0.00135]], $MachinePrecision]], N[(z * y), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+76} \lor \neg \left(y \leq 0.00135\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -6.6000000000000001e76 or 0.0013500000000000001 < y Initial program 90.9%
associate-+l+90.9%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around inf 67.3%
Taylor expanded in y around inf 55.7%
*-commutative55.7%
Simplified55.7%
if -6.6000000000000001e76 < y < 0.0013500000000000001Initial program 90.5%
associate-+l+90.5%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in z around inf 51.3%
Taylor expanded in y around 0 42.3%
Final simplification48.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z -7e+84) (* b (* a z)) (if (<= z 1.8e+61) (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7e+84) {
tmp = b * (a * z);
} else if (z <= 1.8e+61) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
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 <= (-7d+84)) then
tmp = b * (a * z)
else if (z <= 1.8d+61) then
tmp = x + (a * t)
else
tmp = z * y
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 <= -7e+84) {
tmp = b * (a * z);
} else if (z <= 1.8e+61) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7e+84: tmp = b * (a * z) elif z <= 1.8e+61: tmp = x + (a * t) else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7e+84) tmp = Float64(b * Float64(a * z)); elseif (z <= 1.8e+61) tmp = Float64(x + Float64(a * t)); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7e+84) tmp = b * (a * z); elseif (z <= 1.8e+61) tmp = x + (a * t); else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7e+84], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+61], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+84}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+61}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -6.9999999999999998e84Initial program 78.3%
associate-+l+78.3%
associate-*l*78.6%
Simplified78.6%
Taylor expanded in a around inf 72.8%
Taylor expanded in z around inf 69.7%
Taylor expanded in a around inf 47.8%
*-commutative47.8%
associate-*r*54.1%
*-commutative54.1%
*-commutative54.1%
Simplified54.1%
if -6.9999999999999998e84 < z < 1.80000000000000005e61Initial program 97.9%
associate-+l+97.9%
associate-*l*99.3%
Simplified99.3%
Taylor expanded in z around 0 65.7%
if 1.80000000000000005e61 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in z around inf 87.2%
Taylor expanded in y around inf 54.1%
*-commutative54.1%
Simplified54.1%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.6e-13) (not (<= a 2.05e+73))) (* a t) (* z y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.6e-13) || !(a <= 2.05e+73)) {
tmp = a * t;
} else {
tmp = z * y;
}
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 <= (-5.6d-13)) .or. (.not. (a <= 2.05d+73))) then
tmp = a * t
else
tmp = z * y
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 <= -5.6e-13) || !(a <= 2.05e+73)) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.6e-13) or not (a <= 2.05e+73): tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5.6e-13) || !(a <= 2.05e+73)) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -5.6e-13) || ~((a <= 2.05e+73))) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.6e-13], N[Not[LessEqual[a, 2.05e+73]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{-13} \lor \neg \left(a \leq 2.05 \cdot 10^{+73}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if a < -5.6000000000000004e-13 or 2.0499999999999999e73 < a Initial program 80.8%
associate-+l+80.8%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in z around 0 58.6%
Taylor expanded in x around 0 43.4%
if -5.6000000000000004e-13 < a < 2.0499999999999999e73Initial program 98.6%
associate-+l+98.6%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in z around inf 63.6%
Taylor expanded in y around inf 44.3%
*-commutative44.3%
Simplified44.3%
Final simplification43.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.06e+92) (not (<= t 1800000000.0))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.06e+92) || !(t <= 1800000000.0)) {
tmp = a * t;
} 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 ((t <= (-1.06d+92)) .or. (.not. (t <= 1800000000.0d0))) then
tmp = a * t
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 ((t <= -1.06e+92) || !(t <= 1800000000.0)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.06e+92) or not (t <= 1800000000.0): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.06e+92) || !(t <= 1800000000.0)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.06e+92) || ~((t <= 1800000000.0))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.06e+92], N[Not[LessEqual[t, 1800000000.0]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.06 \cdot 10^{+92} \lor \neg \left(t \leq 1800000000\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.05999999999999999e92 or 1.8e9 < t Initial program 88.0%
associate-+l+88.0%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around 0 58.1%
Taylor expanded in x around 0 45.2%
if -1.05999999999999999e92 < t < 1.8e9Initial program 92.8%
associate-+l+92.8%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in z around 0 37.3%
Taylor expanded in x around inf 30.8%
Final simplification37.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 90.7%
associate-+l+90.7%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in z around 0 46.6%
Taylor expanded in x around inf 23.6%
(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 2024165
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))