
(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
(if (<= a -6e+152)
(fma a (fma b z t) x)
(if (<= a 2e-38)
(fma z (* a b) (fma t a (fma y z x)))
(fma a (+ t (* b z)) (fma y z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6e+152) {
tmp = fma(a, fma(b, z, t), x);
} else if (a <= 2e-38) {
tmp = fma(z, (a * b), fma(t, a, fma(y, z, x)));
} else {
tmp = fma(a, (t + (b * z)), fma(y, z, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6e+152) tmp = fma(a, fma(b, z, t), x); elseif (a <= 2e-38) tmp = fma(z, Float64(a * b), fma(t, a, fma(y, z, x))); else tmp = fma(a, Float64(t + Float64(b * z)), fma(y, z, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6e+152], N[(a * N[(b * z + t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2e-38], N[(z * N[(a * b), $MachinePrecision] + N[(t * a + N[(y * z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(b, z, t\right), x\right)\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + b \cdot z, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\end{array}
if a < -5.99999999999999981e152Initial program 73.0%
*-commutative73.0%
associate-*l*66.0%
Simplified66.0%
Taylor expanded in y around 0 76.9%
distribute-lft-in100.0%
+-commutative100.0%
*-commutative100.0%
fma-udef100.0%
+-commutative100.0%
fma-def100.0%
fma-udef100.0%
*-commutative100.0%
fma-udef100.0%
Simplified100.0%
if -5.99999999999999981e152 < a < 1.9999999999999999e-38Initial program 97.2%
+-commutative97.2%
*-commutative97.2%
associate-*l*98.6%
*-commutative98.6%
fma-def99.9%
*-commutative99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
if 1.9999999999999999e-38 < a Initial program 89.1%
associate-+l+89.1%
+-commutative89.1%
*-commutative89.1%
*-commutative89.1%
associate-*l*94.0%
distribute-rgt-out97.6%
fma-def98.8%
*-commutative98.8%
+-commutative98.8%
fma-def98.8%
Simplified98.8%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* a z))))) (if (<= t_1 INFINITY) t_1 (* z (+ (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * ((a * b) + y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * ((a * b) + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * ((a * b) + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(a * z))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(Float64(a * b) + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (z * y)) + (a * t)) + (b * (a * z)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * ((a * b) + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b + y\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%
*-commutative0.0%
associate-*l*23.5%
Simplified23.5%
Taylor expanded in z around inf 82.4%
Final simplification97.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a z))))
(if (<= y -7.5e+28)
(* z y)
(if (<= y -2.1e-123)
t_1
(if (<= y -3.4e-178)
x
(if (<= y -4.4e-203)
t_1
(if (<= y -8.8e-251)
(* a t)
(if (<= y 1.12e-110) x (if (<= y 4.3e+52) (* a t) (* z y))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * z);
double tmp;
if (y <= -7.5e+28) {
tmp = z * y;
} else if (y <= -2.1e-123) {
tmp = t_1;
} else if (y <= -3.4e-178) {
tmp = x;
} else if (y <= -4.4e-203) {
tmp = t_1;
} else if (y <= -8.8e-251) {
tmp = a * t;
} else if (y <= 1.12e-110) {
tmp = x;
} else if (y <= 4.3e+52) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * z)
if (y <= (-7.5d+28)) then
tmp = z * y
else if (y <= (-2.1d-123)) then
tmp = t_1
else if (y <= (-3.4d-178)) then
tmp = x
else if (y <= (-4.4d-203)) then
tmp = t_1
else if (y <= (-8.8d-251)) then
tmp = a * t
else if (y <= 1.12d-110) then
tmp = x
else if (y <= 4.3d+52) then
tmp = a * t
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * z);
double tmp;
if (y <= -7.5e+28) {
tmp = z * y;
} else if (y <= -2.1e-123) {
tmp = t_1;
} else if (y <= -3.4e-178) {
tmp = x;
} else if (y <= -4.4e-203) {
tmp = t_1;
} else if (y <= -8.8e-251) {
tmp = a * t;
} else if (y <= 1.12e-110) {
tmp = x;
} else if (y <= 4.3e+52) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a * z) tmp = 0 if y <= -7.5e+28: tmp = z * y elif y <= -2.1e-123: tmp = t_1 elif y <= -3.4e-178: tmp = x elif y <= -4.4e-203: tmp = t_1 elif y <= -8.8e-251: tmp = a * t elif y <= 1.12e-110: tmp = x elif y <= 4.3e+52: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * z)) tmp = 0.0 if (y <= -7.5e+28) tmp = Float64(z * y); elseif (y <= -2.1e-123) tmp = t_1; elseif (y <= -3.4e-178) tmp = x; elseif (y <= -4.4e-203) tmp = t_1; elseif (y <= -8.8e-251) tmp = Float64(a * t); elseif (y <= 1.12e-110) tmp = x; elseif (y <= 4.3e+52) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a * z); tmp = 0.0; if (y <= -7.5e+28) tmp = z * y; elseif (y <= -2.1e-123) tmp = t_1; elseif (y <= -3.4e-178) tmp = x; elseif (y <= -4.4e-203) tmp = t_1; elseif (y <= -8.8e-251) tmp = a * t; elseif (y <= 1.12e-110) tmp = x; elseif (y <= 4.3e+52) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+28], N[(z * y), $MachinePrecision], If[LessEqual[y, -2.1e-123], t$95$1, If[LessEqual[y, -3.4e-178], x, If[LessEqual[y, -4.4e-203], t$95$1, If[LessEqual[y, -8.8e-251], N[(a * t), $MachinePrecision], If[LessEqual[y, 1.12e-110], x, If[LessEqual[y, 4.3e+52], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+28}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-178}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-251}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-110}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+52}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -7.4999999999999998e28 or 4.3e52 < y Initial program 90.3%
*-commutative90.3%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in y around inf 58.9%
*-commutative58.9%
Simplified58.9%
if -7.4999999999999998e28 < y < -2.0999999999999999e-123 or -3.39999999999999973e-178 < y < -4.3999999999999999e-203Initial program 88.0%
*-commutative88.0%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in a around inf 55.5%
Taylor expanded in t around 0 34.5%
associate-*r*47.6%
*-commutative47.6%
Simplified47.6%
Taylor expanded in z around 0 34.5%
associate-*r*47.6%
*-commutative47.6%
associate-*r*44.5%
Simplified44.5%
if -2.0999999999999999e-123 < y < -3.39999999999999973e-178 or -8.8e-251 < y < 1.11999999999999998e-110Initial program 98.2%
*-commutative98.2%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in x around inf 49.1%
if -4.3999999999999999e-203 < y < -8.8e-251 or 1.11999999999999998e-110 < y < 4.3e52Initial program 93.0%
*-commutative93.0%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in t around inf 50.5%
Final simplification53.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.4e+27)
(* z y)
(if (<= y -2.6e-122)
(* z (* a b))
(if (<= y -5.2e-178)
x
(if (<= y -6.5e-203)
(* b (* a z))
(if (<= y -8.8e-251)
(* a t)
(if (<= y 2.15e-110) x (if (<= y 6.6e+51) (* a t) (* z y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+27) {
tmp = z * y;
} else if (y <= -2.6e-122) {
tmp = z * (a * b);
} else if (y <= -5.2e-178) {
tmp = x;
} else if (y <= -6.5e-203) {
tmp = b * (a * z);
} else if (y <= -8.8e-251) {
tmp = a * t;
} else if (y <= 2.15e-110) {
tmp = x;
} else if (y <= 6.6e+51) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.4d+27)) then
tmp = z * y
else if (y <= (-2.6d-122)) then
tmp = z * (a * b)
else if (y <= (-5.2d-178)) then
tmp = x
else if (y <= (-6.5d-203)) then
tmp = b * (a * z)
else if (y <= (-8.8d-251)) then
tmp = a * t
else if (y <= 2.15d-110) then
tmp = x
else if (y <= 6.6d+51) then
tmp = a * t
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+27) {
tmp = z * y;
} else if (y <= -2.6e-122) {
tmp = z * (a * b);
} else if (y <= -5.2e-178) {
tmp = x;
} else if (y <= -6.5e-203) {
tmp = b * (a * z);
} else if (y <= -8.8e-251) {
tmp = a * t;
} else if (y <= 2.15e-110) {
tmp = x;
} else if (y <= 6.6e+51) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.4e+27: tmp = z * y elif y <= -2.6e-122: tmp = z * (a * b) elif y <= -5.2e-178: tmp = x elif y <= -6.5e-203: tmp = b * (a * z) elif y <= -8.8e-251: tmp = a * t elif y <= 2.15e-110: tmp = x elif y <= 6.6e+51: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.4e+27) tmp = Float64(z * y); elseif (y <= -2.6e-122) tmp = Float64(z * Float64(a * b)); elseif (y <= -5.2e-178) tmp = x; elseif (y <= -6.5e-203) tmp = Float64(b * Float64(a * z)); elseif (y <= -8.8e-251) tmp = Float64(a * t); elseif (y <= 2.15e-110) tmp = x; elseif (y <= 6.6e+51) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.4e+27) tmp = z * y; elseif (y <= -2.6e-122) tmp = z * (a * b); elseif (y <= -5.2e-178) tmp = x; elseif (y <= -6.5e-203) tmp = b * (a * z); elseif (y <= -8.8e-251) tmp = a * t; elseif (y <= 2.15e-110) tmp = x; elseif (y <= 6.6e+51) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.4e+27], N[(z * y), $MachinePrecision], If[LessEqual[y, -2.6e-122], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-178], x, If[LessEqual[y, -6.5e-203], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.8e-251], N[(a * t), $MachinePrecision], If[LessEqual[y, 2.15e-110], x, If[LessEqual[y, 6.6e+51], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+27}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-122}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-178}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-203}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-251}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-110}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+51}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -2.39999999999999998e27 or 6.5999999999999994e51 < y Initial program 90.3%
*-commutative90.3%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in y around inf 58.9%
*-commutative58.9%
Simplified58.9%
if -2.39999999999999998e27 < y < -2.59999999999999975e-122Initial program 91.6%
*-commutative91.6%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around inf 55.9%
Taylor expanded in t around 0 34.2%
associate-*r*47.0%
*-commutative47.0%
Simplified47.0%
if -2.59999999999999975e-122 < y < -5.19999999999999997e-178 or -8.8e-251 < y < 2.15000000000000012e-110Initial program 98.2%
*-commutative98.2%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in x around inf 49.1%
if -5.19999999999999997e-178 < y < -6.50000000000000024e-203Initial program 66.4%
*-commutative66.4%
associate-*l*51.1%
Simplified51.1%
Taylor expanded in a around inf 52.6%
Taylor expanded in t around 0 36.2%
associate-*r*51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in z around 0 36.2%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.9%
Simplified51.9%
if -6.50000000000000024e-203 < y < -8.8e-251 or 2.15000000000000012e-110 < y < 6.5999999999999994e51Initial program 93.0%
*-commutative93.0%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in t around inf 50.5%
Final simplification53.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2.7e-32) (+ (+ (+ x (* z y)) (* a t)) (* z (* a b))) (+ x (* z (+ (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.7e-32) {
tmp = ((x + (z * y)) + (a * t)) + (z * (a * b));
} else {
tmp = x + (z * ((a * b) + y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 2.7d-32) then
tmp = ((x + (z * y)) + (a * t)) + (z * (a * b))
else
tmp = x + (z * ((a * b) + y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.7e-32) {
tmp = ((x + (z * y)) + (a * t)) + (z * (a * b));
} else {
tmp = x + (z * ((a * b) + y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 2.7e-32: tmp = ((x + (z * y)) + (a * t)) + (z * (a * b)) else: tmp = x + (z * ((a * b) + y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.7e-32) tmp = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(z * Float64(a * b))); else tmp = Float64(x + Float64(z * Float64(Float64(a * b) + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 2.7e-32) tmp = ((x + (z * y)) + (a * t)) + (z * (a * b)); else tmp = x + (z * ((a * b) + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.7e-32], N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.7 \cdot 10^{-32}:\\
\;\;\;\;\left(\left(x + z \cdot y\right) + a \cdot t\right) + z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(a \cdot b + y\right)\\
\end{array}
\end{array}
if z < 2.69999999999999981e-32Initial program 95.8%
*-commutative95.8%
associate-*l*94.3%
Simplified94.3%
if 2.69999999999999981e-32 < z Initial program 81.5%
*-commutative81.5%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around 0 86.3%
+-commutative86.3%
+-commutative86.3%
associate-*r*90.8%
distribute-rgt-in98.5%
Simplified98.5%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.2e-28)
(* z y)
(if (<= y -1.85e-221)
x
(if (<= y -8.8e-251)
(* a t)
(if (<= y 7.4e-111)
x
(if (<= y 8e-61) (* a t) (if (<= y 1.36e+25) x (* z y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-28) {
tmp = z * y;
} else if (y <= -1.85e-221) {
tmp = x;
} else if (y <= -8.8e-251) {
tmp = a * t;
} else if (y <= 7.4e-111) {
tmp = x;
} else if (y <= 8e-61) {
tmp = a * t;
} else if (y <= 1.36e+25) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.2d-28)) then
tmp = z * y
else if (y <= (-1.85d-221)) then
tmp = x
else if (y <= (-8.8d-251)) then
tmp = a * t
else if (y <= 7.4d-111) then
tmp = x
else if (y <= 8d-61) then
tmp = a * t
else if (y <= 1.36d+25) then
tmp = x
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-28) {
tmp = z * y;
} else if (y <= -1.85e-221) {
tmp = x;
} else if (y <= -8.8e-251) {
tmp = a * t;
} else if (y <= 7.4e-111) {
tmp = x;
} else if (y <= 8e-61) {
tmp = a * t;
} else if (y <= 1.36e+25) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.2e-28: tmp = z * y elif y <= -1.85e-221: tmp = x elif y <= -8.8e-251: tmp = a * t elif y <= 7.4e-111: tmp = x elif y <= 8e-61: tmp = a * t elif y <= 1.36e+25: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e-28) tmp = Float64(z * y); elseif (y <= -1.85e-221) tmp = x; elseif (y <= -8.8e-251) tmp = Float64(a * t); elseif (y <= 7.4e-111) tmp = x; elseif (y <= 8e-61) tmp = Float64(a * t); elseif (y <= 1.36e+25) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.2e-28) tmp = z * y; elseif (y <= -1.85e-221) tmp = x; elseif (y <= -8.8e-251) tmp = a * t; elseif (y <= 7.4e-111) tmp = x; elseif (y <= 8e-61) tmp = a * t; elseif (y <= 1.36e+25) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e-28], N[(z * y), $MachinePrecision], If[LessEqual[y, -1.85e-221], x, If[LessEqual[y, -8.8e-251], N[(a * t), $MachinePrecision], If[LessEqual[y, 7.4e-111], x, If[LessEqual[y, 8e-61], N[(a * t), $MachinePrecision], If[LessEqual[y, 1.36e+25], x, N[(z * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-28}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-221}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-251}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-111}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-61}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -2.19999999999999996e-28 or 1.36e25 < y Initial program 90.9%
*-commutative90.9%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in y around inf 54.2%
*-commutative54.2%
Simplified54.2%
if -2.19999999999999996e-28 < y < -1.84999999999999993e-221 or -8.8e-251 < y < 7.4000000000000003e-111 or 8.0000000000000003e-61 < y < 1.36e25Initial program 93.4%
*-commutative93.4%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in x around inf 42.8%
if -1.84999999999999993e-221 < y < -8.8e-251 or 7.4000000000000003e-111 < y < 8.0000000000000003e-61Initial program 93.9%
*-commutative93.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 77.9%
Final simplification51.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.2e+152) (not (<= a 1.56e+199))) (* a (+ t (* b z))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.2e+152) || !(a <= 1.56e+199)) {
tmp = a * (t + (b * z));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6.2d+152)) .or. (.not. (a <= 1.56d+199))) then
tmp = a * (t + (b * z))
else
tmp = x + ((a * t) + (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.2e+152) || !(a <= 1.56e+199)) {
tmp = a * (t + (b * z));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.2e+152) or not (a <= 1.56e+199): tmp = a * (t + (b * z)) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.2e+152) || !(a <= 1.56e+199)) tmp = Float64(a * Float64(t + Float64(b * z))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.2e+152) || ~((a <= 1.56e+199))) tmp = a * (t + (b * z)); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.2e+152], N[Not[LessEqual[a, 1.56e+199]], $MachinePrecision]], N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+152} \lor \neg \left(a \leq 1.56 \cdot 10^{+199}\right):\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if a < -6.2e152 or 1.56e199 < a Initial program 77.1%
*-commutative77.1%
associate-*l*73.4%
Simplified73.4%
Taylor expanded in a around inf 97.9%
if -6.2e152 < a < 1.56e199Initial program 95.6%
*-commutative95.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in b around 0 85.1%
Final simplification87.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -175000000.0) (not (<= z 2.7e-32))) (+ x (* z (+ (* a b) y))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -175000000.0) || !(z <= 2.7e-32)) {
tmp = x + (z * ((a * b) + y));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-175000000.0d0)) .or. (.not. (z <= 2.7d-32))) then
tmp = x + (z * ((a * b) + y))
else
tmp = x + ((a * t) + (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -175000000.0) || !(z <= 2.7e-32)) {
tmp = x + (z * ((a * b) + y));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -175000000.0) or not (z <= 2.7e-32): tmp = x + (z * ((a * b) + y)) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -175000000.0) || !(z <= 2.7e-32)) tmp = Float64(x + Float64(z * Float64(Float64(a * b) + y))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -175000000.0) || ~((z <= 2.7e-32))) tmp = x + (z * ((a * b) + y)); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -175000000.0], N[Not[LessEqual[z, 2.7e-32]], $MachinePrecision]], N[(x + N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -175000000 \lor \neg \left(z \leq 2.7 \cdot 10^{-32}\right):\\
\;\;\;\;x + z \cdot \left(a \cdot b + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if z < -1.75e8 or 2.69999999999999981e-32 < z Initial program 86.5%
*-commutative86.5%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in t around 0 82.5%
+-commutative82.5%
+-commutative82.5%
associate-*r*91.5%
distribute-rgt-in95.4%
Simplified95.4%
if -1.75e8 < z < 2.69999999999999981e-32Initial program 97.7%
*-commutative97.7%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in b around 0 91.8%
Final simplification93.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.95e+78) (not (<= a 3.3e+96))) (* a (+ t (* b z))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.95e+78) || !(a <= 3.3e+96)) {
tmp = a * (t + (b * z));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.95d+78)) .or. (.not. (a <= 3.3d+96))) then
tmp = a * (t + (b * z))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.95e+78) || !(a <= 3.3e+96)) {
tmp = a * (t + (b * z));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.95e+78) or not (a <= 3.3e+96): tmp = a * (t + (b * z)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.95e+78) || !(a <= 3.3e+96)) tmp = Float64(a * Float64(t + Float64(b * z))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.95e+78) || ~((a <= 3.3e+96))) tmp = a * (t + (b * z)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.95e+78], N[Not[LessEqual[a, 3.3e+96]], $MachinePrecision]], N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+78} \lor \neg \left(a \leq 3.3 \cdot 10^{+96}\right):\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.9500000000000002e78 or 3.29999999999999984e96 < a Initial program 81.9%
*-commutative81.9%
associate-*l*79.9%
Simplified79.9%
Taylor expanded in a around inf 81.2%
if -1.9500000000000002e78 < a < 3.29999999999999984e96Initial program 97.1%
*-commutative97.1%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in a around 0 74.5%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.195) (not (<= z 1.15e-61))) (* z (+ (* a b) y)) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.195) || !(z <= 1.15e-61)) {
tmp = z * ((a * b) + y);
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-0.195d0)) .or. (.not. (z <= 1.15d-61))) then
tmp = z * ((a * b) + y)
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.195) || !(z <= 1.15e-61)) {
tmp = z * ((a * b) + y);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.195) or not (z <= 1.15e-61): tmp = z * ((a * b) + y) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.195) || !(z <= 1.15e-61)) tmp = Float64(z * Float64(Float64(a * b) + y)); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.195) || ~((z <= 1.15e-61))) tmp = z * ((a * b) + y); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.195], N[Not[LessEqual[z, 1.15e-61]], $MachinePrecision]], N[(z * N[(N[(a * b), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.195 \lor \neg \left(z \leq 1.15 \cdot 10^{-61}\right):\\
\;\;\;\;z \cdot \left(a \cdot b + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -0.19500000000000001 or 1.14999999999999996e-61 < z Initial program 87.2%
*-commutative87.2%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in z around inf 79.1%
if -0.19500000000000001 < z < 1.14999999999999996e-61Initial program 97.5%
*-commutative97.5%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in z around 0 79.4%
+-commutative79.4%
Simplified79.4%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.3e+85) (not (<= a 6.8e+69))) (+ x (* a t)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.3e+85) || !(a <= 6.8e+69)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.3d+85)) .or. (.not. (a <= 6.8d+69))) then
tmp = x + (a * t)
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.3e+85) || !(a <= 6.8e+69)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.3e+85) or not (a <= 6.8e+69): tmp = x + (a * t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.3e+85) || !(a <= 6.8e+69)) tmp = Float64(x + Float64(a * t)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.3e+85) || ~((a <= 6.8e+69))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.3e+85], N[Not[LessEqual[a, 6.8e+69]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+85} \lor \neg \left(a \leq 6.8 \cdot 10^{+69}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -2.2999999999999999e85 or 6.79999999999999973e69 < a Initial program 80.6%
*-commutative80.6%
associate-*l*79.9%
Simplified79.9%
Taylor expanded in z around 0 64.5%
+-commutative64.5%
Simplified64.5%
if -2.2999999999999999e85 < a < 6.79999999999999973e69Initial program 98.2%
*-commutative98.2%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in a around 0 74.7%
Final simplification71.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.9e+100) (* a t) (if (<= a 3.3e+179) (+ x (* z y)) (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.9e+100) {
tmp = a * t;
} else if (a <= 3.3e+179) {
tmp = x + (z * y);
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.9d+100)) then
tmp = a * t
else if (a <= 3.3d+179) then
tmp = x + (z * y)
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.9e+100) {
tmp = a * t;
} else if (a <= 3.3e+179) {
tmp = x + (z * y);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.9e+100: tmp = a * t elif a <= 3.3e+179: tmp = x + (z * y) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.9e+100) tmp = Float64(a * t); elseif (a <= 3.3e+179) tmp = Float64(x + Float64(z * y)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.9e+100) tmp = a * t; elseif (a <= 3.3e+179) tmp = x + (z * y); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.9e+100], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.3e+179], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+100}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+179}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.89999999999999982e100 or 3.29999999999999978e179 < a Initial program 78.9%
*-commutative78.9%
associate-*l*77.6%
Simplified77.6%
Taylor expanded in t around inf 62.0%
if -1.89999999999999982e100 < a < 3.29999999999999978e179Initial program 95.9%
*-commutative95.9%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in a around 0 71.0%
Final simplification69.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.36e+73) (* a t) (if (<= a 3.3e-21) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.36e+73) {
tmp = a * t;
} else if (a <= 3.3e-21) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.36d+73)) then
tmp = a * t
else if (a <= 3.3d-21) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.36e+73) {
tmp = a * t;
} else if (a <= 3.3e-21) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.36e+73: tmp = a * t elif a <= 3.3e-21: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.36e+73) tmp = Float64(a * t); elseif (a <= 3.3e-21) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.36e+73) tmp = a * t; elseif (a <= 3.3e-21) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.36e+73], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.3e-21], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.36 \cdot 10^{+73}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.3599999999999999e73 or 3.30000000000000009e-21 < a Initial program 84.0%
*-commutative84.0%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in t around inf 47.2%
if -1.3599999999999999e73 < a < 3.30000000000000009e-21Initial program 98.6%
*-commutative98.6%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in x around inf 37.1%
Final simplification41.6%
(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 92.2%
*-commutative92.2%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around inf 27.4%
Final simplification27.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 2023275
(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)))