
(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 16 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 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (if (<= t_1 5e+284) t_1 (fma z (fma a b y) (fma t a x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 5e+284) tmp = t_1; else tmp = fma(z, fma(a, b, y), fma(t, a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+284], t$95$1, N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+284}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 4.9999999999999999e284Initial program 99.0%
if 4.9999999999999999e284 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 70.7%
+-commutative70.7%
+-commutative70.7%
associate-+l+70.7%
associate-+r+70.7%
*-commutative70.7%
associate-*l*84.1%
*-commutative84.1%
distribute-lft-out93.2%
fma-def97.7%
fma-def97.7%
+-commutative97.7%
fma-def97.7%
Simplified97.7%
Final simplification98.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (if (<= t_1 1e+200) t_1 (fma a (+ t (* z b)) (fma y z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 1e+200) {
tmp = t_1;
} else {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 1e+200) tmp = t_1; else tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+200], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq 10^{+200}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 9.9999999999999997e199Initial program 98.9%
if 9.9999999999999997e199 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 82.3%
associate-+l+82.3%
+-commutative82.3%
*-commutative82.3%
associate-*l*89.0%
distribute-lft-out91.8%
fma-def93.2%
+-commutative93.2%
fma-def93.2%
Simplified93.2%
Final simplification97.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
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 = ((t * a) + (x + (y * z))) + ((z * a) * b) 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(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) 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 = ((t * a) + (x + (y * z))) + ((z * a) * b); 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[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $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(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\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.6%
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 77.8%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.35e+128)
t_1
(if (<= a -1.8e+76)
(+ (* y z) (* a (* z b)))
(if (or (<= a -1.42e-14) (not (<= a 1.05e+54))) t_1 (+ x (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.35e+128) {
tmp = t_1;
} else if (a <= -1.8e+76) {
tmp = (y * z) + (a * (z * b));
} else if ((a <= -1.42e-14) || !(a <= 1.05e+54)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-1.35d+128)) then
tmp = t_1
else if (a <= (-1.8d+76)) then
tmp = (y * z) + (a * (z * b))
else if ((a <= (-1.42d-14)) .or. (.not. (a <= 1.05d+54))) then
tmp = t_1
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 t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.35e+128) {
tmp = t_1;
} else if (a <= -1.8e+76) {
tmp = (y * z) + (a * (z * b));
} else if ((a <= -1.42e-14) || !(a <= 1.05e+54)) {
tmp = t_1;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.35e+128: tmp = t_1 elif a <= -1.8e+76: tmp = (y * z) + (a * (z * b)) elif (a <= -1.42e-14) or not (a <= 1.05e+54): tmp = t_1 else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.35e+128) tmp = t_1; elseif (a <= -1.8e+76) tmp = Float64(Float64(y * z) + Float64(a * Float64(z * b))); elseif ((a <= -1.42e-14) || !(a <= 1.05e+54)) tmp = t_1; else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -1.35e+128) tmp = t_1; elseif (a <= -1.8e+76) tmp = (y * z) + (a * (z * b)); elseif ((a <= -1.42e-14) || ~((a <= 1.05e+54))) tmp = t_1; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.35e+128], t$95$1, If[LessEqual[a, -1.8e+76], N[(N[(y * z), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.42e-14], N[Not[LessEqual[a, 1.05e+54]], $MachinePrecision]], t$95$1, N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.35 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.8 \cdot 10^{+76}:\\
\;\;\;\;y \cdot z + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -1.42 \cdot 10^{-14} \lor \neg \left(a \leq 1.05 \cdot 10^{+54}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.35000000000000001e128 or -1.8000000000000001e76 < a < -1.42000000000000004e-14 or 1.04999999999999993e54 < a Initial program 90.1%
associate-+l+90.1%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around inf 80.6%
if -1.35000000000000001e128 < a < -1.8000000000000001e76Initial program 77.5%
associate-+l+77.5%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 99.9%
Taylor expanded in x around 0 77.5%
if -1.42000000000000004e-14 < a < 1.04999999999999993e54Initial program 98.5%
associate-+l+98.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around 0 73.3%
Final simplification76.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1e-85) (not (<= t 9e-22))) (+ (* y z) (+ x (* t a))) (+ (* a (* z b)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1e-85) || !(t <= 9e-22)) {
tmp = (y * z) + (x + (t * a));
} else {
tmp = (a * (z * b)) + (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 ((t <= (-1d-85)) .or. (.not. (t <= 9d-22))) then
tmp = (y * z) + (x + (t * a))
else
tmp = (a * (z * b)) + (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 ((t <= -1e-85) || !(t <= 9e-22)) {
tmp = (y * z) + (x + (t * a));
} else {
tmp = (a * (z * b)) + (x + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1e-85) or not (t <= 9e-22): tmp = (y * z) + (x + (t * a)) else: tmp = (a * (z * b)) + (x + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1e-85) || !(t <= 9e-22)) tmp = Float64(Float64(y * z) + Float64(x + Float64(t * a))); else tmp = Float64(Float64(a * Float64(z * b)) + Float64(x + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1e-85) || ~((t <= 9e-22))) tmp = (y * z) + (x + (t * a)); else tmp = (a * (z * b)) + (x + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1e-85], N[Not[LessEqual[t, 9e-22]], $MachinePrecision]], N[(N[(y * z), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-85} \lor \neg \left(t \leq 9 \cdot 10^{-22}\right):\\
\;\;\;\;y \cdot z + \left(x + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right) + \left(x + y \cdot z\right)\\
\end{array}
\end{array}
if t < -9.9999999999999998e-86 or 8.99999999999999973e-22 < t Initial program 93.9%
associate-+l+93.9%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in b around 0 83.8%
if -9.9999999999999998e-86 < t < 8.99999999999999973e-22Initial program 94.5%
associate-+l+94.5%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in t around 0 92.1%
Final simplification87.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9e+64) (not (<= b 2.25e+102))) (+ (* (* z a) b) (+ x (* y z))) (+ (* y z) (+ x (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9e+64) || !(b <= 2.25e+102)) {
tmp = ((z * a) * b) + (x + (y * z));
} else {
tmp = (y * z) + (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 ((b <= (-9d+64)) .or. (.not. (b <= 2.25d+102))) then
tmp = ((z * a) * b) + (x + (y * z))
else
tmp = (y * z) + (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 ((b <= -9e+64) || !(b <= 2.25e+102)) {
tmp = ((z * a) * b) + (x + (y * z));
} else {
tmp = (y * z) + (x + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9e+64) or not (b <= 2.25e+102): tmp = ((z * a) * b) + (x + (y * z)) else: tmp = (y * z) + (x + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9e+64) || !(b <= 2.25e+102)) tmp = Float64(Float64(Float64(z * a) * b) + Float64(x + Float64(y * z))); else tmp = Float64(Float64(y * z) + Float64(x + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -9e+64) || ~((b <= 2.25e+102))) tmp = ((z * a) * b) + (x + (y * z)); else tmp = (y * z) + (x + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9e+64], N[Not[LessEqual[b, 2.25e+102]], $MachinePrecision]], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{+64} \lor \neg \left(b \leq 2.25 \cdot 10^{+102}\right):\\
\;\;\;\;\left(z \cdot a\right) \cdot b + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z + \left(x + t \cdot a\right)\\
\end{array}
\end{array}
if b < -8.99999999999999946e64 or 2.2500000000000001e102 < b Initial program 95.5%
associate-+l+95.5%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in t around 0 75.6%
Taylor expanded in b around 0 75.6%
associate-*r*82.2%
*-commutative82.2%
associate-*r*85.0%
Simplified85.0%
if -8.99999999999999946e64 < b < 2.2500000000000001e102Initial program 93.4%
associate-+l+93.4%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in b around 0 92.3%
Final simplification89.7%
(FPCore (x y z t a b) :precision binary64 (+ (+ (* a (* z b)) (* t a)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
return ((a * (z * b)) + (t * a)) + (x + (y * z));
}
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 = ((a * (z * b)) + (t * a)) + (x + (y * z))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((a * (z * b)) + (t * a)) + (x + (y * z));
}
def code(x, y, z, t, a, b): return ((a * (z * b)) + (t * a)) + (x + (y * z))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(a * Float64(z * b)) + Float64(t * a)) + Float64(x + Float64(y * z))) end
function tmp = code(x, y, z, t, a, b) tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)
\end{array}
Initial program 94.1%
associate-+l+94.1%
associate-*l*93.5%
Simplified93.5%
Final simplification93.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -8.6e-64)
(* t a)
(if (<= t -1e-214)
(* a (* z b))
(if (<= t 1.5e-259)
x
(if (<= t 6.8e-156) (* y z) (if (<= t 7.6e+27) x (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.6e-64) {
tmp = t * a;
} else if (t <= -1e-214) {
tmp = a * (z * b);
} else if (t <= 1.5e-259) {
tmp = x;
} else if (t <= 6.8e-156) {
tmp = y * z;
} else if (t <= 7.6e+27) {
tmp = x;
} else {
tmp = 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 (t <= (-8.6d-64)) then
tmp = t * a
else if (t <= (-1d-214)) then
tmp = a * (z * b)
else if (t <= 1.5d-259) then
tmp = x
else if (t <= 6.8d-156) then
tmp = y * z
else if (t <= 7.6d+27) then
tmp = x
else
tmp = 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 (t <= -8.6e-64) {
tmp = t * a;
} else if (t <= -1e-214) {
tmp = a * (z * b);
} else if (t <= 1.5e-259) {
tmp = x;
} else if (t <= 6.8e-156) {
tmp = y * z;
} else if (t <= 7.6e+27) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8.6e-64: tmp = t * a elif t <= -1e-214: tmp = a * (z * b) elif t <= 1.5e-259: tmp = x elif t <= 6.8e-156: tmp = y * z elif t <= 7.6e+27: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8.6e-64) tmp = Float64(t * a); elseif (t <= -1e-214) tmp = Float64(a * Float64(z * b)); elseif (t <= 1.5e-259) tmp = x; elseif (t <= 6.8e-156) tmp = Float64(y * z); elseif (t <= 7.6e+27) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -8.6e-64) tmp = t * a; elseif (t <= -1e-214) tmp = a * (z * b); elseif (t <= 1.5e-259) tmp = x; elseif (t <= 6.8e-156) tmp = y * z; elseif (t <= 7.6e+27) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.6e-64], N[(t * a), $MachinePrecision], If[LessEqual[t, -1e-214], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-259], x, If[LessEqual[t, 6.8e-156], N[(y * z), $MachinePrecision], If[LessEqual[t, 7.6e+27], x, N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{-64}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-214}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-259}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-156}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -8.59999999999999947e-64 or 7.60000000000000043e27 < t Initial program 94.4%
associate-+l+94.4%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in t around inf 49.8%
if -8.59999999999999947e-64 < t < -9.99999999999999913e-215Initial program 95.1%
associate-+l+95.1%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in a around inf 46.6%
Taylor expanded in t around 0 46.5%
if -9.99999999999999913e-215 < t < 1.5000000000000001e-259 or 6.79999999999999981e-156 < t < 7.60000000000000043e27Initial program 95.8%
associate-+l+95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 48.6%
if 1.5000000000000001e-259 < t < 6.79999999999999981e-156Initial program 84.2%
associate-+l+84.2%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification49.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -9e-7)
t_1
(if (<= z 8.2e-233) (+ x (* y z)) (if (<= z 1.55e-46) (* t a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -9e-7) {
tmp = t_1;
} else if (z <= 8.2e-233) {
tmp = x + (y * z);
} else if (z <= 1.55e-46) {
tmp = t * a;
} 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 * (y + (a * b))
if (z <= (-9d-7)) then
tmp = t_1
else if (z <= 8.2d-233) then
tmp = x + (y * z)
else if (z <= 1.55d-46) then
tmp = t * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -9e-7) {
tmp = t_1;
} else if (z <= 8.2e-233) {
tmp = x + (y * z);
} else if (z <= 1.55e-46) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -9e-7: tmp = t_1 elif z <= 8.2e-233: tmp = x + (y * z) elif z <= 1.55e-46: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -9e-7) tmp = t_1; elseif (z <= 8.2e-233) tmp = Float64(x + Float64(y * z)); elseif (z <= 1.55e-46) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -9e-7) tmp = t_1; elseif (z <= 8.2e-233) tmp = x + (y * z); elseif (z <= 1.55e-46) tmp = t * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e-7], t$95$1, If[LessEqual[z, 8.2e-233], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-46], N[(t * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-233}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-46}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.99999999999999959e-7 or 1.55e-46 < z Initial program 89.1%
associate-+l+89.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around inf 73.5%
if -8.99999999999999959e-7 < z < 8.2000000000000009e-233Initial program 98.9%
associate-+l+98.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 62.1%
if 8.2000000000000009e-233 < z < 1.55e-46Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 56.5%
Final simplification67.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.5e+197) (not (<= b 1.65e+213))) (* z (+ y (* a b))) (+ (* y z) (+ x (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.5e+197) || !(b <= 1.65e+213)) {
tmp = z * (y + (a * b));
} else {
tmp = (y * z) + (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 ((b <= (-4.5d+197)) .or. (.not. (b <= 1.65d+213))) then
tmp = z * (y + (a * b))
else
tmp = (y * z) + (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 ((b <= -4.5e+197) || !(b <= 1.65e+213)) {
tmp = z * (y + (a * b));
} else {
tmp = (y * z) + (x + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.5e+197) or not (b <= 1.65e+213): tmp = z * (y + (a * b)) else: tmp = (y * z) + (x + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.5e+197) || !(b <= 1.65e+213)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(Float64(y * z) + Float64(x + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4.5e+197) || ~((b <= 1.65e+213))) tmp = z * (y + (a * b)); else tmp = (y * z) + (x + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.5e+197], N[Not[LessEqual[b, 1.65e+213]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+197} \lor \neg \left(b \leq 1.65 \cdot 10^{+213}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z + \left(x + t \cdot a\right)\\
\end{array}
\end{array}
if b < -4.5000000000000003e197 or 1.6500000000000001e213 < b Initial program 94.6%
associate-+l+94.6%
associate-*l*84.4%
Simplified84.4%
Taylor expanded in z around inf 71.6%
if -4.5000000000000003e197 < b < 1.6500000000000001e213Initial program 94.1%
associate-+l+94.1%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in b around 0 86.2%
Final simplification84.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4e+198) (* z (+ y (* a b))) (if (<= b 2.9e+213) (+ (* y z) (+ x (* t a))) (+ (* y z) (* (* z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4e+198) {
tmp = z * (y + (a * b));
} else if (b <= 2.9e+213) {
tmp = (y * z) + (x + (t * a));
} else {
tmp = (y * z) + ((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 (b <= (-4d+198)) then
tmp = z * (y + (a * b))
else if (b <= 2.9d+213) then
tmp = (y * z) + (x + (t * a))
else
tmp = (y * z) + ((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 (b <= -4e+198) {
tmp = z * (y + (a * b));
} else if (b <= 2.9e+213) {
tmp = (y * z) + (x + (t * a));
} else {
tmp = (y * z) + ((z * a) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4e+198: tmp = z * (y + (a * b)) elif b <= 2.9e+213: tmp = (y * z) + (x + (t * a)) else: tmp = (y * z) + ((z * a) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4e+198) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (b <= 2.9e+213) tmp = Float64(Float64(y * z) + Float64(x + Float64(t * a))); else tmp = Float64(Float64(y * z) + Float64(Float64(z * a) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4e+198) tmp = z * (y + (a * b)); elseif (b <= 2.9e+213) tmp = (y * z) + (x + (t * a)); else tmp = (y * z) + ((z * a) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4e+198], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e+213], N[(N[(y * z), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+198}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+213}:\\
\;\;\;\;y \cdot z + \left(x + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z + \left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if b < -4.00000000000000007e198Initial program 89.5%
associate-+l+89.5%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in z around inf 74.5%
if -4.00000000000000007e198 < b < 2.9000000000000003e213Initial program 94.1%
associate-+l+94.1%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in b around 0 86.2%
if 2.9000000000000003e213 < b Initial program 99.9%
associate-+l+99.9%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in z around inf 68.5%
+-commutative68.5%
distribute-rgt-in68.5%
*-commutative68.5%
associate-*r*78.3%
*-commutative78.3%
Applied egg-rr78.3%
Final simplification84.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.1e-46)
(* t a)
(if (<= t 3.45e-255)
x
(if (<= t 6.4e-148) (* y z) (if (<= t 3.8e+26) x (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e-46) {
tmp = t * a;
} else if (t <= 3.45e-255) {
tmp = x;
} else if (t <= 6.4e-148) {
tmp = y * z;
} else if (t <= 3.8e+26) {
tmp = x;
} else {
tmp = 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 (t <= (-1.1d-46)) then
tmp = t * a
else if (t <= 3.45d-255) then
tmp = x
else if (t <= 6.4d-148) then
tmp = y * z
else if (t <= 3.8d+26) then
tmp = x
else
tmp = 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 (t <= -1.1e-46) {
tmp = t * a;
} else if (t <= 3.45e-255) {
tmp = x;
} else if (t <= 6.4e-148) {
tmp = y * z;
} else if (t <= 3.8e+26) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.1e-46: tmp = t * a elif t <= 3.45e-255: tmp = x elif t <= 6.4e-148: tmp = y * z elif t <= 3.8e+26: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.1e-46) tmp = Float64(t * a); elseif (t <= 3.45e-255) tmp = x; elseif (t <= 6.4e-148) tmp = Float64(y * z); elseif (t <= 3.8e+26) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.1e-46) tmp = t * a; elseif (t <= 3.45e-255) tmp = x; elseif (t <= 6.4e-148) tmp = y * z; elseif (t <= 3.8e+26) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.1e-46], N[(t * a), $MachinePrecision], If[LessEqual[t, 3.45e-255], x, If[LessEqual[t, 6.4e-148], N[(y * z), $MachinePrecision], If[LessEqual[t, 3.8e+26], x, N[(t * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-46}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{-255}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-148}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -1.1e-46 or 3.8000000000000002e26 < t Initial program 94.3%
associate-+l+94.3%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in t around inf 50.2%
if -1.1e-46 < t < 3.4499999999999998e-255 or 6.39999999999999987e-148 < t < 3.8000000000000002e26Initial program 95.6%
associate-+l+95.6%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around inf 42.4%
if 3.4499999999999998e-255 < t < 6.39999999999999987e-148Initial program 84.2%
associate-+l+84.2%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification47.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.05e+234) (* a (* z b)) (if (<= a -1.3e+127) (* t a) (if (<= a 1.45e+167) (+ x (* y z)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.05e+234) {
tmp = a * (z * b);
} else if (a <= -1.3e+127) {
tmp = t * a;
} else if (a <= 1.45e+167) {
tmp = x + (y * z);
} else {
tmp = 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 <= (-1.05d+234)) then
tmp = a * (z * b)
else if (a <= (-1.3d+127)) then
tmp = t * a
else if (a <= 1.45d+167) then
tmp = x + (y * z)
else
tmp = 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 <= -1.05e+234) {
tmp = a * (z * b);
} else if (a <= -1.3e+127) {
tmp = t * a;
} else if (a <= 1.45e+167) {
tmp = x + (y * z);
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.05e+234: tmp = a * (z * b) elif a <= -1.3e+127: tmp = t * a elif a <= 1.45e+167: tmp = x + (y * z) else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.05e+234) tmp = Float64(a * Float64(z * b)); elseif (a <= -1.3e+127) tmp = Float64(t * a); elseif (a <= 1.45e+167) tmp = Float64(x + Float64(y * z)); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.05e+234) tmp = a * (z * b); elseif (a <= -1.3e+127) tmp = t * a; elseif (a <= 1.45e+167) tmp = x + (y * z); else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.05e+234], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.3e+127], N[(t * a), $MachinePrecision], If[LessEqual[a, 1.45e+167], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(t * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{+234}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{+127}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+167}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -1.05e234Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 90.1%
Taylor expanded in t around 0 70.6%
if -1.05e234 < a < -1.3000000000000001e127 or 1.44999999999999987e167 < a Initial program 84.1%
associate-+l+84.1%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in t around inf 59.8%
if -1.3000000000000001e127 < a < 1.44999999999999987e167Initial program 96.4%
associate-+l+96.4%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around 0 64.8%
Final simplification64.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7e-15) (not (<= a 7.8e+52))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7e-15) || !(a <= 7.8e+52)) {
tmp = a * (t + (z * 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 <= (-7d-15)) .or. (.not. (a <= 7.8d+52))) then
tmp = a * (t + (z * 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 <= -7e-15) || !(a <= 7.8e+52)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7e-15) or not (a <= 7.8e+52): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7e-15) || !(a <= 7.8e+52)) tmp = Float64(a * Float64(t + Float64(z * 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 <= -7e-15) || ~((a <= 7.8e+52))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7e-15], N[Not[LessEqual[a, 7.8e+52]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{-15} \lor \neg \left(a \leq 7.8 \cdot 10^{+52}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -7.0000000000000001e-15 or 7.7999999999999999e52 < a Initial program 88.7%
associate-+l+88.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around inf 76.0%
if -7.0000000000000001e-15 < a < 7.7999999999999999e52Initial program 98.5%
associate-+l+98.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around 0 73.3%
Final simplification74.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.15e-49) (* t a) (if (<= t 5.5e+26) x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.15e-49) {
tmp = t * a;
} else if (t <= 5.5e+26) {
tmp = x;
} else {
tmp = 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 (t <= (-3.15d-49)) then
tmp = t * a
else if (t <= 5.5d+26) then
tmp = x
else
tmp = 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 (t <= -3.15e-49) {
tmp = t * a;
} else if (t <= 5.5e+26) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.15e-49: tmp = t * a elif t <= 5.5e+26: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.15e-49) tmp = Float64(t * a); elseif (t <= 5.5e+26) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.15e-49) tmp = t * a; elseif (t <= 5.5e+26) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.15e-49], N[(t * a), $MachinePrecision], If[LessEqual[t, 5.5e+26], x, N[(t * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.15 \cdot 10^{-49}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -3.1499999999999998e-49 or 5.4999999999999997e26 < t Initial program 94.3%
associate-+l+94.3%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in t around inf 50.2%
if -3.1499999999999998e-49 < t < 5.4999999999999997e26Initial program 94.0%
associate-+l+94.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 40.4%
Final simplification45.0%
(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 94.1%
associate-+l+94.1%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in x around inf 28.4%
Final simplification28.4%
(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 2023278
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(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)))