
(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 14 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 INFINITY) t_1 (+ x (* a (+ t (* z 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 = x + (a * (t + (z * 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 = x + (a * (t + (z * 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 = x + (a * (t + (z * 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(x + Float64(a * Float64(t + Float64(z * 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 = x + (a * (t + (z * 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[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $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}:\\
\;\;\;\;x + a \cdot \left(t + z \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 98.7%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
+-commutative0.0%
fma-define0.0%
associate-*l*7.1%
*-commutative7.1%
*-commutative7.1%
distribute-rgt-out71.4%
remove-double-neg71.4%
*-commutative71.4%
distribute-lft-neg-out71.4%
sub-neg71.4%
sub-neg71.4%
distribute-lft-neg-in71.4%
remove-double-neg71.4%
Simplified71.4%
Taylor expanded in y around 0 85.7%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -1.45e+249)
t_1
(if (<= a -2.15e+46)
(* t a)
(if (<= a 3.1e-190)
x
(if (<= a 2.35e-30) (* y z) (if (<= a 1.06e+265) (* t a) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -1.45e+249) {
tmp = t_1;
} else if (a <= -2.15e+46) {
tmp = t * a;
} else if (a <= 3.1e-190) {
tmp = x;
} else if (a <= 2.35e-30) {
tmp = y * z;
} else if (a <= 1.06e+265) {
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 = a * (z * b)
if (a <= (-1.45d+249)) then
tmp = t_1
else if (a <= (-2.15d+46)) then
tmp = t * a
else if (a <= 3.1d-190) then
tmp = x
else if (a <= 2.35d-30) then
tmp = y * z
else if (a <= 1.06d+265) 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 = a * (z * b);
double tmp;
if (a <= -1.45e+249) {
tmp = t_1;
} else if (a <= -2.15e+46) {
tmp = t * a;
} else if (a <= 3.1e-190) {
tmp = x;
} else if (a <= 2.35e-30) {
tmp = y * z;
} else if (a <= 1.06e+265) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -1.45e+249: tmp = t_1 elif a <= -2.15e+46: tmp = t * a elif a <= 3.1e-190: tmp = x elif a <= 2.35e-30: tmp = y * z elif a <= 1.06e+265: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -1.45e+249) tmp = t_1; elseif (a <= -2.15e+46) tmp = Float64(t * a); elseif (a <= 3.1e-190) tmp = x; elseif (a <= 2.35e-30) tmp = Float64(y * z); elseif (a <= 1.06e+265) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -1.45e+249) tmp = t_1; elseif (a <= -2.15e+46) tmp = t * a; elseif (a <= 3.1e-190) tmp = x; elseif (a <= 2.35e-30) tmp = y * z; elseif (a <= 1.06e+265) tmp = t * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.45e+249], t$95$1, If[LessEqual[a, -2.15e+46], N[(t * a), $MachinePrecision], If[LessEqual[a, 3.1e-190], x, If[LessEqual[a, 2.35e-30], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.06e+265], N[(t * a), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{+249}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.15 \cdot 10^{+46}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-190}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-30}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.06 \cdot 10^{+265}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.45000000000000008e249 or 1.06000000000000003e265 < a Initial program 70.6%
associate-+l+70.6%
+-commutative70.6%
fma-define70.6%
associate-*l*70.6%
*-commutative70.6%
*-commutative70.6%
distribute-rgt-out88.2%
remove-double-neg88.2%
*-commutative88.2%
distribute-lft-neg-out88.2%
sub-neg88.2%
sub-neg88.2%
distribute-lft-neg-in88.2%
remove-double-neg88.2%
Simplified88.2%
Taylor expanded in y around 0 94.1%
Taylor expanded in z around inf 88.7%
if -1.45000000000000008e249 < a < -2.15000000000000002e46 or 2.34999999999999985e-30 < a < 1.06000000000000003e265Initial program 89.7%
associate-+l+89.7%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in z around 0 60.8%
Taylor expanded in x around 0 46.1%
if -2.15000000000000002e46 < a < 3.09999999999999993e-190Initial program 99.9%
associate-+l+99.9%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around 0 57.5%
Taylor expanded in x around inf 46.1%
if 3.09999999999999993e-190 < a < 2.34999999999999985e-30Initial program 96.7%
associate-+l+96.7%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in a around inf 49.4%
Taylor expanded in y around inf 48.7%
*-commutative48.7%
Simplified48.7%
Final simplification49.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (+ x (* y z))))
(if (<= y -1.3e-47)
t_2
(if (<= y 9.2e-294)
t_1
(if (<= y 1.4e-187) (* z (* a b)) (if (<= y 3.7e+59) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double tmp;
if (y <= -1.3e-47) {
tmp = t_2;
} else if (y <= 9.2e-294) {
tmp = t_1;
} else if (y <= 1.4e-187) {
tmp = z * (a * b);
} else if (y <= 3.7e+59) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = x + (y * z)
if (y <= (-1.3d-47)) then
tmp = t_2
else if (y <= 9.2d-294) then
tmp = t_1
else if (y <= 1.4d-187) then
tmp = z * (a * b)
else if (y <= 3.7d+59) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double tmp;
if (y <= -1.3e-47) {
tmp = t_2;
} else if (y <= 9.2e-294) {
tmp = t_1;
} else if (y <= 1.4e-187) {
tmp = z * (a * b);
} else if (y <= 3.7e+59) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = x + (y * z) tmp = 0 if y <= -1.3e-47: tmp = t_2 elif y <= 9.2e-294: tmp = t_1 elif y <= 1.4e-187: tmp = z * (a * b) elif y <= 3.7e+59: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(x + Float64(y * z)) tmp = 0.0 if (y <= -1.3e-47) tmp = t_2; elseif (y <= 9.2e-294) tmp = t_1; elseif (y <= 1.4e-187) tmp = Float64(z * Float64(a * b)); elseif (y <= 3.7e+59) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = x + (y * z); tmp = 0.0; if (y <= -1.3e-47) tmp = t_2; elseif (y <= 9.2e-294) tmp = t_1; elseif (y <= 1.4e-187) tmp = z * (a * b); elseif (y <= 3.7e+59) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e-47], t$95$2, If[LessEqual[y, 9.2e-294], t$95$1, If[LessEqual[y, 1.4e-187], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+59], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + y \cdot z\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{-47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-294}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-187}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.3e-47 or 3.69999999999999997e59 < y Initial program 95.4%
associate-+l+95.4%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in a around inf 70.5%
Taylor expanded in a around 0 70.6%
*-commutative70.6%
Simplified70.6%
if -1.3e-47 < y < 9.20000000000000064e-294 or 1.4e-187 < y < 3.69999999999999997e59Initial program 91.7%
associate-+l+91.7%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in z around 0 71.9%
if 9.20000000000000064e-294 < y < 1.4e-187Initial program 92.2%
Taylor expanded in x around 0 85.0%
Taylor expanded in t around 0 63.1%
associate-*r*73.8%
distribute-rgt-in73.8%
Simplified73.8%
Taylor expanded in a around inf 73.8%
Final simplification71.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -8e+223)
(* (* z a) (+ b (/ y a)))
(if (<= z 1.7e+65)
(+ (+ (* t a) (* a (* z b))) (+ x (* y z)))
(* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+223) {
tmp = (z * a) * (b + (y / a));
} else if (z <= 1.7e+65) {
tmp = ((t * a) + (a * (z * b))) + (x + (y * z));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-8d+223)) then
tmp = (z * a) * (b + (y / a))
else if (z <= 1.7d+65) then
tmp = ((t * a) + (a * (z * b))) + (x + (y * z))
else
tmp = z * (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+223) {
tmp = (z * a) * (b + (y / a));
} else if (z <= 1.7e+65) {
tmp = ((t * a) + (a * (z * b))) + (x + (y * z));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8e+223: tmp = (z * a) * (b + (y / a)) elif z <= 1.7e+65: tmp = ((t * a) + (a * (z * b))) + (x + (y * z)) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8e+223) tmp = Float64(Float64(z * a) * Float64(b + Float64(y / a))); elseif (z <= 1.7e+65) tmp = Float64(Float64(Float64(t * a) + Float64(a * Float64(z * b))) + Float64(x + Float64(y * z))); else tmp = 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 (z <= -8e+223) tmp = (z * a) * (b + (y / a)); elseif (z <= 1.7e+65) tmp = ((t * a) + (a * (z * b))) + (x + (y * z)); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8e+223], N[(N[(z * a), $MachinePrecision] * N[(b + N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+65], N[(N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+223}:\\
\;\;\;\;\left(z \cdot a\right) \cdot \left(b + \frac{y}{a}\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+65}:\\
\;\;\;\;\left(t \cdot a + a \cdot \left(z \cdot b\right)\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < -8.00000000000000037e223Initial program 81.3%
associate-+l+81.3%
associate-*l*52.2%
Simplified52.2%
Taylor expanded in a around inf 45.5%
Taylor expanded in z around inf 52.6%
associate-*r*87.5%
Simplified87.5%
if -8.00000000000000037e223 < z < 1.7e65Initial program 97.2%
associate-+l+97.2%
associate-*l*97.2%
Simplified97.2%
if 1.7e65 < z Initial program 84.0%
associate-+l+84.0%
associate-*l*69.1%
Simplified69.1%
Taylor expanded in z around inf 82.7%
Final simplification93.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2700000.0) (not (<= a 6e+20))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2700000.0) || !(a <= 6e+20)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (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 <= (-2700000.0d0)) .or. (.not. (a <= 6d+20))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (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 <= -2700000.0) || !(a <= 6e+20)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2700000.0) or not (a <= 6e+20): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2700000.0) || !(a <= 6e+20)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2700000.0) || ~((a <= 6e+20))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2700000.0], N[Not[LessEqual[a, 6e+20]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2700000 \lor \neg \left(a \leq 6 \cdot 10^{+20}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if a < -2.7e6 or 6e20 < a Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
fma-define86.4%
associate-*l*89.7%
*-commutative89.7%
*-commutative89.7%
distribute-rgt-out97.4%
remove-double-neg97.4%
*-commutative97.4%
distribute-lft-neg-out97.4%
sub-neg97.4%
sub-neg97.4%
distribute-lft-neg-in97.4%
remove-double-neg97.4%
Simplified97.4%
Taylor expanded in y around 0 92.7%
if -2.7e6 < a < 6e20Initial program 99.2%
associate-+l+99.2%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in b around 0 86.3%
Final simplification89.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -17000.0) (not (<= z 2.8e+57))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -17000.0) || !(z <= 2.8e+57)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-17000.0d0)) .or. (.not. (z <= 2.8d+57))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -17000.0) || !(z <= 2.8e+57)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -17000.0) or not (z <= 2.8e+57): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -17000.0) || !(z <= 2.8e+57)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -17000.0) || ~((z <= 2.8e+57))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -17000.0], N[Not[LessEqual[z, 2.8e+57]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17000 \lor \neg \left(z \leq 2.8 \cdot 10^{+57}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -17000 or 2.8e57 < z Initial program 88.1%
associate-+l+88.1%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in z around inf 79.8%
if -17000 < z < 2.8e57Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
fma-define97.8%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 90.4%
Final simplification85.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.6e+65) (* y z) (if (<= y -1.26e-183) x (if (<= y 1.72e+72) (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.6e+65) {
tmp = y * z;
} else if (y <= -1.26e-183) {
tmp = x;
} else if (y <= 1.72e+72) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-7.6d+65)) then
tmp = y * z
else if (y <= (-1.26d-183)) then
tmp = x
else if (y <= 1.72d+72) then
tmp = t * a
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.6e+65) {
tmp = y * z;
} else if (y <= -1.26e-183) {
tmp = x;
} else if (y <= 1.72e+72) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.6e+65: tmp = y * z elif y <= -1.26e-183: tmp = x elif y <= 1.72e+72: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.6e+65) tmp = Float64(y * z); elseif (y <= -1.26e-183) tmp = x; elseif (y <= 1.72e+72) tmp = Float64(t * a); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.6e+65) tmp = y * z; elseif (y <= -1.26e-183) tmp = x; elseif (y <= 1.72e+72) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.6e+65], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.26e-183], x, If[LessEqual[y, 1.72e+72], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+65}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-183}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.72 \cdot 10^{+72}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -7.60000000000000022e65 or 1.71999999999999993e72 < y Initial program 93.6%
associate-+l+93.6%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in a around inf 70.6%
Taylor expanded in y around inf 56.1%
*-commutative56.1%
Simplified56.1%
if -7.60000000000000022e65 < y < -1.26e-183Initial program 95.5%
associate-+l+95.5%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in z around 0 53.4%
Taylor expanded in x around inf 38.1%
if -1.26e-183 < y < 1.71999999999999993e72Initial program 91.9%
associate-+l+91.9%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in z around 0 66.7%
Taylor expanded in x around 0 39.5%
Final simplification44.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -420.0) (not (<= z 2.25e+57))) (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -420.0) || !(z <= 2.25e+57)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-420.0d0)) .or. (.not. (z <= 2.25d+57))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -420.0) || !(z <= 2.25e+57)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -420.0) or not (z <= 2.25e+57): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -420.0) || !(z <= 2.25e+57)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -420.0) || ~((z <= 2.25e+57))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -420.0], N[Not[LessEqual[z, 2.25e+57]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -420 \lor \neg \left(z \leq 2.25 \cdot 10^{+57}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -420 or 2.24999999999999998e57 < z Initial program 88.1%
associate-+l+88.1%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in z around inf 79.8%
if -420 < z < 2.24999999999999998e57Initial program 97.8%
associate-+l+97.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in z around 0 78.3%
Final simplification78.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3e-10) (not (<= a 95000000.0))) (* 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 <= -3e-10) || !(a <= 95000000.0)) {
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 <= (-3d-10)) .or. (.not. (a <= 95000000.0d0))) 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 <= -3e-10) || !(a <= 95000000.0)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3e-10) or not (a <= 95000000.0): 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 <= -3e-10) || !(a <= 95000000.0)) 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 <= -3e-10) || ~((a <= 95000000.0))) 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, -3e-10], N[Not[LessEqual[a, 95000000.0]], $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 -3 \cdot 10^{-10} \lor \neg \left(a \leq 95000000\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3e-10 or 9.5e7 < a Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
fma-define87.2%
associate-*l*90.3%
*-commutative90.3%
*-commutative90.3%
distribute-rgt-out97.5%
remove-double-neg97.5%
*-commutative97.5%
distribute-lft-neg-out97.5%
sub-neg97.5%
sub-neg97.5%
distribute-lft-neg-in97.5%
remove-double-neg97.5%
Simplified97.5%
Taylor expanded in y around 0 91.6%
Taylor expanded in x around 0 79.8%
if -3e-10 < a < 9.5e7Initial program 99.2%
associate-+l+99.2%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in a around inf 54.0%
Taylor expanded in a around 0 75.3%
*-commutative75.3%
Simplified75.3%
Final simplification77.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -18000.0) (* y z) (if (<= z 1.7e+74) (+ x (* t a)) (* z (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -18000.0) {
tmp = y * z;
} else if (z <= 1.7e+74) {
tmp = x + (t * a);
} 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 (z <= (-18000.0d0)) then
tmp = y * z
else if (z <= 1.7d+74) then
tmp = x + (t * a)
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 (z <= -18000.0) {
tmp = y * z;
} else if (z <= 1.7e+74) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -18000.0: tmp = y * z elif z <= 1.7e+74: tmp = x + (t * a) else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -18000.0) tmp = Float64(y * z); elseif (z <= 1.7e+74) tmp = Float64(x + Float64(t * a)); 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 (z <= -18000.0) tmp = y * z; elseif (z <= 1.7e+74) tmp = x + (t * a); else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -18000.0], N[(y * z), $MachinePrecision], If[LessEqual[z, 1.7e+74], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -18000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+74}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -18000Initial program 91.6%
associate-+l+91.6%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in a around inf 69.4%
Taylor expanded in y around inf 43.4%
*-commutative43.4%
Simplified43.4%
if -18000 < z < 1.7e74Initial program 97.8%
associate-+l+97.8%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in z around 0 77.3%
if 1.7e74 < z Initial program 83.4%
Taylor expanded in x around 0 76.4%
Taylor expanded in t around 0 64.7%
associate-*r*80.1%
distribute-rgt-in83.8%
Simplified83.8%
Taylor expanded in a around inf 53.5%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -920.0) (* y z) (if (<= z 1.25e+72) x (* z (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -920.0) {
tmp = y * z;
} else if (z <= 1.25e+72) {
tmp = x;
} 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 (z <= (-920.0d0)) then
tmp = y * z
else if (z <= 1.25d+72) then
tmp = x
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 (z <= -920.0) {
tmp = y * z;
} else if (z <= 1.25e+72) {
tmp = x;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -920.0: tmp = y * z elif z <= 1.25e+72: tmp = x else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -920.0) tmp = Float64(y * z); elseif (z <= 1.25e+72) tmp = x; 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 (z <= -920.0) tmp = y * z; elseif (z <= 1.25e+72) tmp = x; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -920.0], N[(y * z), $MachinePrecision], If[LessEqual[z, 1.25e+72], x, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -920:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -920Initial program 91.6%
associate-+l+91.6%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in a around inf 69.4%
Taylor expanded in y around inf 43.4%
*-commutative43.4%
Simplified43.4%
if -920 < z < 1.24999999999999998e72Initial program 97.8%
associate-+l+97.8%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in z around 0 77.3%
Taylor expanded in x around inf 43.2%
if 1.24999999999999998e72 < z Initial program 83.4%
Taylor expanded in x around 0 76.4%
Taylor expanded in t around 0 64.7%
associate-*r*80.1%
distribute-rgt-in83.8%
Simplified83.8%
Taylor expanded in a around inf 53.5%
Final simplification45.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -31.0) (* y z) (if (<= z 2.9e+57) x (* (* z a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -31.0) {
tmp = y * z;
} else if (z <= 2.9e+57) {
tmp = x;
} 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 (z <= (-31.0d0)) then
tmp = y * z
else if (z <= 2.9d+57) then
tmp = x
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 (z <= -31.0) {
tmp = y * z;
} else if (z <= 2.9e+57) {
tmp = x;
} else {
tmp = (z * a) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -31.0: tmp = y * z elif z <= 2.9e+57: tmp = x else: tmp = (z * a) * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -31.0) tmp = Float64(y * z); elseif (z <= 2.9e+57) tmp = x; else tmp = Float64(Float64(z * a) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -31.0) tmp = y * z; elseif (z <= 2.9e+57) tmp = x; else tmp = (z * a) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -31.0], N[(y * z), $MachinePrecision], If[LessEqual[z, 2.9e+57], x, N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -31:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+57}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if z < -31Initial program 91.6%
associate-+l+91.6%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in a around inf 69.4%
Taylor expanded in y around inf 43.4%
*-commutative43.4%
Simplified43.4%
if -31 < z < 2.9000000000000002e57Initial program 97.8%
associate-+l+97.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in z around 0 78.3%
Taylor expanded in x around inf 43.4%
if 2.9000000000000002e57 < z Initial program 84.3%
associate-+l+84.3%
+-commutative84.3%
fma-define84.3%
associate-*l*69.6%
*-commutative69.6%
*-commutative69.6%
distribute-rgt-out76.7%
remove-double-neg76.7%
*-commutative76.7%
distribute-lft-neg-out76.7%
sub-neg76.7%
sub-neg76.7%
distribute-lft-neg-in76.7%
remove-double-neg76.7%
Simplified76.7%
Taylor expanded in y around 0 57.8%
Taylor expanded in z around inf 44.2%
*-commutative44.2%
associate-*r*51.0%
*-commutative51.0%
Simplified51.0%
Final simplification45.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.15e+46) (not (<= a 3700000.0))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.15e+46) || !(a <= 3700000.0)) {
tmp = t * a;
} 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 ((a <= (-2.15d+46)) .or. (.not. (a <= 3700000.0d0))) then
tmp = t * a
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 ((a <= -2.15e+46) || !(a <= 3700000.0)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.15e+46) or not (a <= 3700000.0): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.15e+46) || !(a <= 3700000.0)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.15e+46) || ~((a <= 3700000.0))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.15e+46], N[Not[LessEqual[a, 3700000.0]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.15 \cdot 10^{+46} \lor \neg \left(a \leq 3700000\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.15000000000000002e46 or 3.7e6 < a Initial program 86.2%
associate-+l+86.2%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in z around 0 53.0%
Taylor expanded in x around 0 41.9%
if -2.15000000000000002e46 < a < 3.7e6Initial program 99.2%
associate-+l+99.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around 0 52.6%
Taylor expanded in x around inf 41.5%
Final simplification41.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.3%
associate-+l+93.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in z around 0 52.8%
Taylor expanded in x around inf 28.9%
(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 2024139
(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)))