
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (* (* z a) b) (+ (+ x (* y z)) (* t a))))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = 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 = ((z * a) * b) + ((x + (y * z)) + (t * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * a) * b) + Float64(Float64(x + Float64(y * z)) + Float64(t * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * a) * b) + ((x + (y * z)) + (t * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;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.4%
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-def0.0%
*-commutative0.0%
associate-*l*23.1%
*-commutative23.1%
distribute-lft-out69.2%
remove-double-neg69.2%
*-commutative69.2%
distribute-lft-neg-out69.2%
sub-neg69.2%
sub-neg69.2%
distribute-lft-neg-in69.2%
remove-double-neg69.2%
Simplified69.2%
Taylor expanded in y around 0 92.3%
Taylor expanded in x around 0 92.3%
Final simplification98.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -2.5e-73)
t_1
(if (<= z -5.3e-112)
(+ x (* a (* z b)))
(if (<= z -2.35e-130)
(+ (* t a) (* y z))
(if (<= z -8.5e-156)
(* a (+ t (* z b)))
(if (<= z 1450000000000.0) (+ x (* 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 <= -2.5e-73) {
tmp = t_1;
} else if (z <= -5.3e-112) {
tmp = x + (a * (z * b));
} else if (z <= -2.35e-130) {
tmp = (t * a) + (y * z);
} else if (z <= -8.5e-156) {
tmp = a * (t + (z * b));
} else if (z <= 1450000000000.0) {
tmp = x + (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 <= (-2.5d-73)) then
tmp = t_1
else if (z <= (-5.3d-112)) then
tmp = x + (a * (z * b))
else if (z <= (-2.35d-130)) then
tmp = (t * a) + (y * z)
else if (z <= (-8.5d-156)) then
tmp = a * (t + (z * b))
else if (z <= 1450000000000.0d0) then
tmp = x + (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 <= -2.5e-73) {
tmp = t_1;
} else if (z <= -5.3e-112) {
tmp = x + (a * (z * b));
} else if (z <= -2.35e-130) {
tmp = (t * a) + (y * z);
} else if (z <= -8.5e-156) {
tmp = a * (t + (z * b));
} else if (z <= 1450000000000.0) {
tmp = x + (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 <= -2.5e-73: tmp = t_1 elif z <= -5.3e-112: tmp = x + (a * (z * b)) elif z <= -2.35e-130: tmp = (t * a) + (y * z) elif z <= -8.5e-156: tmp = a * (t + (z * b)) elif z <= 1450000000000.0: tmp = x + (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 <= -2.5e-73) tmp = t_1; elseif (z <= -5.3e-112) tmp = Float64(x + Float64(a * Float64(z * b))); elseif (z <= -2.35e-130) tmp = Float64(Float64(t * a) + Float64(y * z)); elseif (z <= -8.5e-156) tmp = Float64(a * Float64(t + Float64(z * b))); elseif (z <= 1450000000000.0) tmp = Float64(x + 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 <= -2.5e-73) tmp = t_1; elseif (z <= -5.3e-112) tmp = x + (a * (z * b)); elseif (z <= -2.35e-130) tmp = (t * a) + (y * z); elseif (z <= -8.5e-156) tmp = a * (t + (z * b)); elseif (z <= 1450000000000.0) tmp = x + (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, -2.5e-73], t$95$1, If[LessEqual[z, -5.3e-112], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.35e-130], N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e-156], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1450000000000.0], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-112}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-130}:\\
\;\;\;\;t \cdot a + y \cdot z\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-156}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 1450000000000:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.4999999999999999e-73 or 1.45e12 < z Initial program 89.2%
associate-+l+89.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around inf 80.2%
if -2.4999999999999999e-73 < z < -5.3000000000000004e-112Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-def100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
distribute-lft-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 91.0%
Taylor expanded in t around 0 82.3%
if -5.3000000000000004e-112 < z < -2.34999999999999984e-130Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in b around 0 100.0%
if -2.34999999999999984e-130 < z < -8.5e-156Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
*-commutative99.6%
associate-*l*99.6%
*-commutative99.6%
distribute-lft-out99.6%
remove-double-neg99.6%
*-commutative99.6%
distribute-lft-neg-out99.6%
sub-neg99.6%
sub-neg99.6%
distribute-lft-neg-in99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around 0 99.6%
if -8.5e-156 < z < 1.45e12Initial program 98.9%
associate-+l+98.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 80.2%
+-commutative80.2%
Simplified80.2%
Final simplification81.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -7.8e-17)
t_1
(if (<= a -3.1e-211)
(+ (* (* z a) b) (+ (* t a) (* y z)))
(if (<= a 5.2e-5) (+ (+ x (* y z)) (* t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -7.8e-17) {
tmp = t_1;
} else if (a <= -3.1e-211) {
tmp = ((z * a) * b) + ((t * a) + (y * z));
} else if (a <= 5.2e-5) {
tmp = (x + (y * z)) + (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 = x + (a * (t + (z * b)))
if (a <= (-7.8d-17)) then
tmp = t_1
else if (a <= (-3.1d-211)) then
tmp = ((z * a) * b) + ((t * a) + (y * z))
else if (a <= 5.2d-5) then
tmp = (x + (y * z)) + (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 = x + (a * (t + (z * b)));
double tmp;
if (a <= -7.8e-17) {
tmp = t_1;
} else if (a <= -3.1e-211) {
tmp = ((z * a) * b) + ((t * a) + (y * z));
} else if (a <= 5.2e-5) {
tmp = (x + (y * z)) + (t * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if a <= -7.8e-17: tmp = t_1 elif a <= -3.1e-211: tmp = ((z * a) * b) + ((t * a) + (y * z)) elif a <= 5.2e-5: tmp = (x + (y * z)) + (t * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -7.8e-17) tmp = t_1; elseif (a <= -3.1e-211) tmp = Float64(Float64(Float64(z * a) * b) + Float64(Float64(t * a) + Float64(y * z))); elseif (a <= 5.2e-5) tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -7.8e-17) tmp = t_1; elseif (a <= -3.1e-211) tmp = ((z * a) * b) + ((t * a) + (y * z)); elseif (a <= 5.2e-5) tmp = (x + (y * z)) + (t * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.8e-17], t$95$1, If[LessEqual[a, -3.1e-211], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-5], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{-211}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + \left(t \cdot a + y \cdot z\right)\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-5}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -7.79999999999999979e-17 or 5.19999999999999968e-5 < a Initial program 88.1%
associate-+l+88.1%
+-commutative88.1%
fma-def88.1%
*-commutative88.1%
associate-*l*92.4%
*-commutative92.4%
distribute-lft-out96.9%
remove-double-neg96.9%
*-commutative96.9%
distribute-lft-neg-out96.9%
sub-neg96.9%
sub-neg96.9%
distribute-lft-neg-in96.9%
remove-double-neg96.9%
Simplified96.9%
Taylor expanded in y around 0 94.6%
if -7.79999999999999979e-17 < a < -3.09999999999999995e-211Initial program 100.0%
Taylor expanded in x around 0 90.0%
if -3.09999999999999995e-211 < a < 5.19999999999999968e-5Initial program 98.9%
associate-+l+98.9%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in t around inf 90.9%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))) (t_2 (+ x (* y z))))
(if (<= z -1.25e+165)
t_2
(if (<= z -4.8e+94)
t_1
(if (<= z -4.8e-20)
t_2
(if (<= z 3.6e+81) (+ x (* t a)) (if (<= z 1.8e+189) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double t_2 = x + (y * z);
double tmp;
if (z <= -1.25e+165) {
tmp = t_2;
} else if (z <= -4.8e+94) {
tmp = t_1;
} else if (z <= -4.8e-20) {
tmp = t_2;
} else if (z <= 3.6e+81) {
tmp = x + (t * a);
} else if (z <= 1.8e+189) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = z * (a * b)
t_2 = x + (y * z)
if (z <= (-1.25d+165)) then
tmp = t_2
else if (z <= (-4.8d+94)) then
tmp = t_1
else if (z <= (-4.8d-20)) then
tmp = t_2
else if (z <= 3.6d+81) then
tmp = x + (t * a)
else if (z <= 1.8d+189) then
tmp = t_2
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 * (a * b);
double t_2 = x + (y * z);
double tmp;
if (z <= -1.25e+165) {
tmp = t_2;
} else if (z <= -4.8e+94) {
tmp = t_1;
} else if (z <= -4.8e-20) {
tmp = t_2;
} else if (z <= 3.6e+81) {
tmp = x + (t * a);
} else if (z <= 1.8e+189) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) t_2 = x + (y * z) tmp = 0 if z <= -1.25e+165: tmp = t_2 elif z <= -4.8e+94: tmp = t_1 elif z <= -4.8e-20: tmp = t_2 elif z <= 3.6e+81: tmp = x + (t * a) elif z <= 1.8e+189: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) t_2 = Float64(x + Float64(y * z)) tmp = 0.0 if (z <= -1.25e+165) tmp = t_2; elseif (z <= -4.8e+94) tmp = t_1; elseif (z <= -4.8e-20) tmp = t_2; elseif (z <= 3.6e+81) tmp = Float64(x + Float64(t * a)); elseif (z <= 1.8e+189) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); t_2 = x + (y * z); tmp = 0.0; if (z <= -1.25e+165) tmp = t_2; elseif (z <= -4.8e+94) tmp = t_1; elseif (z <= -4.8e-20) tmp = t_2; elseif (z <= 3.6e+81) tmp = x + (t * a); elseif (z <= 1.8e+189) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+165], t$95$2, If[LessEqual[z, -4.8e+94], t$95$1, If[LessEqual[z, -4.8e-20], t$95$2, If[LessEqual[z, 3.6e+81], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+189], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
t_2 := x + y \cdot z\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+165}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+81}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+189}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.24999999999999993e165 or -4.79999999999999965e94 < z < -4.79999999999999986e-20 or 3.60000000000000005e81 < z < 1.80000000000000004e189Initial program 88.5%
associate-+l+88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in a around 0 63.6%
if -1.24999999999999993e165 < z < -4.79999999999999965e94 or 1.80000000000000004e189 < z Initial program 84.7%
associate-+l+84.7%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in z around inf 87.1%
Taylor expanded in y around 0 64.1%
if -4.79999999999999986e-20 < z < 3.60000000000000005e81Initial program 99.2%
associate-+l+99.2%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 69.7%
+-commutative69.7%
Simplified69.7%
Final simplification66.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -9e-13)
(not (or (<= a 4.7e-120) (and (not (<= a 4e-94)) (<= a 4.8e-5)))))
(* 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 <= -9e-13) || !((a <= 4.7e-120) || (!(a <= 4e-94) && (a <= 4.8e-5)))) {
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 <= (-9d-13)) .or. (.not. (a <= 4.7d-120) .or. (.not. (a <= 4d-94)) .and. (a <= 4.8d-5))) 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 <= -9e-13) || !((a <= 4.7e-120) || (!(a <= 4e-94) && (a <= 4.8e-5)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9e-13) or not ((a <= 4.7e-120) or (not (a <= 4e-94) and (a <= 4.8e-5))): 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 <= -9e-13) || !((a <= 4.7e-120) || (!(a <= 4e-94) && (a <= 4.8e-5)))) 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 <= -9e-13) || ~(((a <= 4.7e-120) || (~((a <= 4e-94)) && (a <= 4.8e-5))))) 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, -9e-13], N[Not[Or[LessEqual[a, 4.7e-120], And[N[Not[LessEqual[a, 4e-94]], $MachinePrecision], LessEqual[a, 4.8e-5]]]], $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 -9 \cdot 10^{-13} \lor \neg \left(a \leq 4.7 \cdot 10^{-120} \lor \neg \left(a \leq 4 \cdot 10^{-94}\right) \land a \leq 4.8 \cdot 10^{-5}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -9e-13 or 4.70000000000000016e-120 < a < 3.9999999999999998e-94 or 4.8000000000000001e-5 < a Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-def88.5%
*-commutative88.5%
associate-*l*92.7%
*-commutative92.7%
distribute-lft-out97.1%
remove-double-neg97.1%
*-commutative97.1%
distribute-lft-neg-out97.1%
sub-neg97.1%
sub-neg97.1%
distribute-lft-neg-in97.1%
remove-double-neg97.1%
Simplified97.1%
Taylor expanded in y around 0 94.8%
Taylor expanded in x around 0 83.3%
if -9e-13 < a < 4.70000000000000016e-120 or 3.9999999999999998e-94 < a < 4.8000000000000001e-5Initial program 99.2%
associate-+l+99.2%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around 0 70.7%
Final simplification77.5%
(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(x + Float64(y * z)) + Float64(Float64(t * a) + Float64(a * Float64(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[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)
\end{array}
Initial program 93.4%
associate-+l+93.4%
associate-*l*92.7%
Simplified92.7%
Final simplification92.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.00116) (not (<= z 1.75e+86))) (* 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 <= -0.00116) || !(z <= 1.75e+86)) {
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 <= (-0.00116d0)) .or. (.not. (z <= 1.75d+86))) 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 <= -0.00116) || !(z <= 1.75e+86)) {
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 <= -0.00116) or not (z <= 1.75e+86): 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 <= -0.00116) || !(z <= 1.75e+86)) 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 <= -0.00116) || ~((z <= 1.75e+86))) 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, -0.00116], N[Not[LessEqual[z, 1.75e+86]], $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 -0.00116 \lor \neg \left(z \leq 1.75 \cdot 10^{+86}\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 < -0.00116 or 1.75000000000000009e86 < z Initial program 86.8%
associate-+l+86.8%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in z around inf 84.6%
if -0.00116 < z < 1.75000000000000009e86Initial program 99.2%
associate-+l+99.2%
+-commutative99.2%
fma-def99.2%
*-commutative99.2%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 88.7%
Final simplification86.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.2e-12) (not (<= a 1.65e-9))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.2e-12) || !(a <= 1.65e-9)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-4.2d-12)) .or. (.not. (a <= 1.65d-9))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.2e-12) || !(a <= 1.65e-9)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.2e-12) or not (a <= 1.65e-9): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.2e-12) || !(a <= 1.65e-9)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.2e-12) || ~((a <= 1.65e-9))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.2e-12], N[Not[LessEqual[a, 1.65e-9]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-12} \lor \neg \left(a \leq 1.65 \cdot 10^{-9}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + t \cdot a\\
\end{array}
\end{array}
if a < -4.19999999999999988e-12 or 1.65000000000000009e-9 < a Initial program 87.9%
associate-+l+87.9%
+-commutative87.9%
fma-def87.9%
*-commutative87.9%
associate-*l*92.3%
*-commutative92.3%
distribute-lft-out96.9%
remove-double-neg96.9%
*-commutative96.9%
distribute-lft-neg-out96.9%
sub-neg96.9%
sub-neg96.9%
distribute-lft-neg-in96.9%
remove-double-neg96.9%
Simplified96.9%
Taylor expanded in y around 0 94.6%
if -4.19999999999999988e-12 < a < 1.65000000000000009e-9Initial program 99.2%
associate-+l+99.2%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in t around inf 85.4%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.35e-62) (not (<= z 59000000000000.0))) (* 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 <= -1.35e-62) || !(z <= 59000000000000.0)) {
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 <= (-1.35d-62)) .or. (.not. (z <= 59000000000000.0d0))) 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 <= -1.35e-62) || !(z <= 59000000000000.0)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.35e-62) or not (z <= 59000000000000.0): 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 <= -1.35e-62) || !(z <= 59000000000000.0)) 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 <= -1.35e-62) || ~((z <= 59000000000000.0))) 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, -1.35e-62], N[Not[LessEqual[z, 59000000000000.0]], $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 -1.35 \cdot 10^{-62} \lor \neg \left(z \leq 59000000000000\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -1.3500000000000001e-62 or 5.9e13 < z Initial program 89.0%
associate-+l+89.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in z around inf 80.6%
if -1.3500000000000001e-62 < z < 5.9e13Initial program 99.1%
associate-+l+99.1%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 76.4%
+-commutative76.4%
Simplified76.4%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.05e+150) (not (<= b 1.65e+34))) (* z (* a b)) (* y z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.05e+150) || !(b <= 1.65e+34)) {
tmp = z * (a * b);
} 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 ((b <= (-3.05d+150)) .or. (.not. (b <= 1.65d+34))) then
tmp = z * (a * b)
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 ((b <= -3.05e+150) || !(b <= 1.65e+34)) {
tmp = z * (a * b);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.05e+150) or not (b <= 1.65e+34): tmp = z * (a * b) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.05e+150) || !(b <= 1.65e+34)) tmp = Float64(z * Float64(a * b)); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.05e+150) || ~((b <= 1.65e+34))) tmp = z * (a * b); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.05e+150], N[Not[LessEqual[b, 1.65e+34]], $MachinePrecision]], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.05 \cdot 10^{+150} \lor \neg \left(b \leq 1.65 \cdot 10^{+34}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if b < -3.05000000000000013e150 or 1.64999999999999994e34 < b Initial program 91.0%
associate-+l+91.0%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in z around inf 71.2%
Taylor expanded in y around 0 61.3%
if -3.05000000000000013e150 < b < 1.64999999999999994e34Initial program 95.0%
associate-+l+95.0%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in y around inf 35.4%
*-commutative35.4%
Simplified35.4%
Final simplification45.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5e+234) (not (<= b 1.7e+35))) (* z (* a b)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5e+234) || !(b <= 1.7e+35)) {
tmp = z * (a * b);
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-5d+234)) .or. (.not. (b <= 1.7d+35))) then
tmp = z * (a * b)
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5e+234) || !(b <= 1.7e+35)) {
tmp = z * (a * b);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5e+234) or not (b <= 1.7e+35): tmp = z * (a * b) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5e+234) || !(b <= 1.7e+35)) tmp = Float64(z * Float64(a * b)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5e+234) || ~((b <= 1.7e+35))) tmp = z * (a * b); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5e+234], N[Not[LessEqual[b, 1.7e+35]], $MachinePrecision]], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+234} \lor \neg \left(b \leq 1.7 \cdot 10^{+35}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if b < -5.0000000000000003e234 or 1.7000000000000001e35 < b Initial program 90.8%
associate-+l+90.8%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around inf 72.6%
Taylor expanded in y around 0 67.2%
if -5.0000000000000003e234 < b < 1.7000000000000001e35Initial program 94.6%
associate-+l+94.6%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in a around 0 53.6%
Final simplification57.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2e-69) (not (<= z 13200000.0))) (* y z) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2e-69) || !(z <= 13200000.0)) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2d-69)) .or. (.not. (z <= 13200000.0d0))) then
tmp = y * z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2e-69) || !(z <= 13200000.0)) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2e-69) or not (z <= 13200000.0): tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2e-69) || !(z <= 13200000.0)) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2e-69) || ~((z <= 13200000.0))) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2e-69], N[Not[LessEqual[z, 13200000.0]], $MachinePrecision]], N[(y * z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-69} \lor \neg \left(z \leq 13200000\right):\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.9999999999999999e-69 or 1.32e7 < z Initial program 89.4%
associate-+l+89.4%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in y around inf 41.3%
*-commutative41.3%
Simplified41.3%
if -1.9999999999999999e-69 < z < 1.32e7Initial program 99.0%
associate-+l+99.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 33.6%
Final simplification38.1%
(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.4%
associate-+l+93.4%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 20.1%
Final simplification20.1%
(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 2023331
(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)))