
(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 (if (<= z 1.85e+48) (+ (fma y z x) (* a (+ t (* z b)))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.85e+48) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.85e+48) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.85e+48], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.85 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 1.85e48Initial program 94.1%
associate-+l+94.1%
+-commutative94.1%
fma-define94.1%
associate-*l*96.5%
*-commutative96.5%
*-commutative96.5%
distribute-rgt-out97.5%
remove-double-neg97.5%
*-commutative97.5%
distribute-lft-neg-out97.5%
sub-neg97.5%
sub-neg97.5%
distribute-lft-neg-out97.5%
*-commutative97.5%
remove-double-neg97.5%
*-commutative97.5%
Simplified97.5%
if 1.85e48 < z Initial program 85.2%
associate-+l+85.2%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in t around 0 78.4%
+-commutative78.4%
associate-*r*88.2%
distribute-rgt-in95.0%
Simplified95.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z (+ y (* a b))))))
(if (<= z -11000000.0)
t_1
(if (<= z 9e-167)
(+ x (* a (+ t (* z b))))
(if (<= z 5.3e-28) (+ x (+ (* a t) (* z y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * (y + (a * b)));
double tmp;
if (z <= -11000000.0) {
tmp = t_1;
} else if (z <= 9e-167) {
tmp = x + (a * (t + (z * b)));
} else if (z <= 5.3e-28) {
tmp = x + ((a * t) + (z * y));
} 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 + (z * (y + (a * b)))
if (z <= (-11000000.0d0)) then
tmp = t_1
else if (z <= 9d-167) then
tmp = x + (a * (t + (z * b)))
else if (z <= 5.3d-28) then
tmp = x + ((a * t) + (z * y))
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 + (z * (y + (a * b)));
double tmp;
if (z <= -11000000.0) {
tmp = t_1;
} else if (z <= 9e-167) {
tmp = x + (a * (t + (z * b)));
} else if (z <= 5.3e-28) {
tmp = x + ((a * t) + (z * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * (y + (a * b))) tmp = 0 if z <= -11000000.0: tmp = t_1 elif z <= 9e-167: tmp = x + (a * (t + (z * b))) elif z <= 5.3e-28: tmp = x + ((a * t) + (z * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) tmp = 0.0 if (z <= -11000000.0) tmp = t_1; elseif (z <= 9e-167) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (z <= 5.3e-28) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * (y + (a * b))); tmp = 0.0; if (z <= -11000000.0) tmp = t_1; elseif (z <= 9e-167) tmp = x + (a * (t + (z * b))); elseif (z <= 5.3e-28) tmp = x + ((a * t) + (z * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -11000000.0], t$95$1, If[LessEqual[z, 9e-167], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e-28], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -11000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-167}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-28}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1e7 or 5.29999999999999988e-28 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 82.1%
+-commutative82.1%
associate-*r*88.2%
distribute-rgt-in92.4%
Simplified92.4%
if -1.1e7 < z < 9.0000000000000002e-167Initial program 98.9%
associate-+l+98.9%
+-commutative98.9%
fma-define98.9%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
remove-double-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 92.1%
if 9.0000000000000002e-167 < z < 5.29999999999999988e-28Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in b around 0 95.7%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -1.9e+132)
t_1
(if (<= z -3.25e+40) (* z y) (if (<= z 1.3e+48) (+ x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -1.9e+132) {
tmp = t_1;
} else if (z <= -3.25e+40) {
tmp = z * y;
} else if (z <= 1.3e+48) {
tmp = x + (a * t);
} 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 * (a * b)
if (z <= (-1.9d+132)) then
tmp = t_1
else if (z <= (-3.25d+40)) then
tmp = z * y
else if (z <= 1.3d+48) then
tmp = x + (a * t)
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 tmp;
if (z <= -1.9e+132) {
tmp = t_1;
} else if (z <= -3.25e+40) {
tmp = z * y;
} else if (z <= 1.3e+48) {
tmp = x + (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -1.9e+132: tmp = t_1 elif z <= -3.25e+40: tmp = z * y elif z <= 1.3e+48: tmp = x + (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -1.9e+132) tmp = t_1; elseif (z <= -3.25e+40) tmp = Float64(z * y); elseif (z <= 1.3e+48) tmp = Float64(x + Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -1.9e+132) tmp = t_1; elseif (z <= -3.25e+40) tmp = z * y; elseif (z <= 1.3e+48) tmp = x + (a * t); 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]}, If[LessEqual[z, -1.9e+132], t$95$1, If[LessEqual[z, -3.25e+40], N[(z * y), $MachinePrecision], If[LessEqual[z, 1.3e+48], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.25 \cdot 10^{+40}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+48}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.90000000000000003e132 or 1.29999999999999998e48 < z Initial program 83.4%
associate-+l+83.4%
+-commutative83.4%
fma-define83.4%
associate-*l*84.4%
*-commutative84.4%
*-commutative84.4%
distribute-rgt-out85.5%
remove-double-neg85.5%
*-commutative85.5%
distribute-lft-neg-out85.5%
sub-neg85.5%
sub-neg85.5%
distribute-lft-neg-out85.5%
*-commutative85.5%
remove-double-neg85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y around 0 66.0%
Taylor expanded in z around inf 54.7%
associate-*r*56.1%
*-commutative56.1%
Simplified56.1%
if -1.90000000000000003e132 < z < -3.2500000000000001e40Initial program 83.8%
associate-+l+83.8%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in t around 0 83.3%
+-commutative83.3%
associate-*r*87.5%
distribute-rgt-in87.5%
Simplified87.5%
Taylor expanded in x around inf 64.1%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
Simplified53.3%
if -3.2500000000000001e40 < z < 1.29999999999999998e48Initial program 98.6%
associate-+l+98.6%
associate-*l*99.3%
Simplified99.3%
Taylor expanded in z around 0 65.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.65e-91) (* a (* z b)) (if (<= a 2.8e-85) (* z y) (if (<= a 8e+162) (* z (* a b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.65e-91) {
tmp = a * (z * b);
} else if (a <= 2.8e-85) {
tmp = z * y;
} else if (a <= 8e+162) {
tmp = z * (a * b);
} 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 <= (-4.65d-91)) then
tmp = a * (z * b)
else if (a <= 2.8d-85) then
tmp = z * y
else if (a <= 8d+162) then
tmp = z * (a * b)
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 <= -4.65e-91) {
tmp = a * (z * b);
} else if (a <= 2.8e-85) {
tmp = z * y;
} else if (a <= 8e+162) {
tmp = z * (a * b);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.65e-91: tmp = a * (z * b) elif a <= 2.8e-85: tmp = z * y elif a <= 8e+162: tmp = z * (a * b) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.65e-91) tmp = Float64(a * Float64(z * b)); elseif (a <= 2.8e-85) tmp = Float64(z * y); elseif (a <= 8e+162) tmp = Float64(z * Float64(a * b)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.65e-91) tmp = a * (z * b); elseif (a <= 2.8e-85) tmp = z * y; elseif (a <= 8e+162) tmp = z * (a * b); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.65e-91], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-85], N[(z * y), $MachinePrecision], If[LessEqual[a, 8e+162], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.65 \cdot 10^{-91}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-85}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+162}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -4.65e-91Initial program 85.3%
associate-+l+85.3%
+-commutative85.3%
fma-define85.3%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
distribute-rgt-out93.7%
remove-double-neg93.7%
*-commutative93.7%
distribute-lft-neg-out93.7%
sub-neg93.7%
sub-neg93.7%
distribute-lft-neg-out93.7%
*-commutative93.7%
remove-double-neg93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in y around 0 86.6%
Taylor expanded in z around inf 52.5%
if -4.65e-91 < a < 2.80000000000000017e-85Initial program 98.0%
associate-+l+98.0%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in t around 0 81.3%
+-commutative81.3%
associate-*r*88.3%
distribute-rgt-in89.3%
Simplified89.3%
Taylor expanded in x around inf 79.6%
Taylor expanded in y around inf 48.9%
*-commutative48.9%
Simplified48.9%
if 2.80000000000000017e-85 < a < 7.9999999999999995e162Initial program 94.5%
associate-+l+94.5%
+-commutative94.5%
fma-define94.5%
associate-*l*96.3%
*-commutative96.3%
*-commutative96.3%
distribute-rgt-out96.3%
remove-double-neg96.3%
*-commutative96.3%
distribute-lft-neg-out96.3%
sub-neg96.3%
sub-neg96.3%
distribute-lft-neg-out96.3%
*-commutative96.3%
remove-double-neg96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in y around 0 81.0%
Taylor expanded in z around inf 42.0%
associate-*r*43.0%
*-commutative43.0%
Simplified43.0%
if 7.9999999999999995e162 < a Initial program 85.1%
associate-+l+85.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in z around 0 74.2%
Taylor expanded in x around 0 62.7%
Final simplification50.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -4.3e-91)
t_1
(if (<= a 2.15e-8) (* z y) (if (<= a 5.4e+162) t_1 (* a t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -4.3e-91) {
tmp = t_1;
} else if (a <= 2.15e-8) {
tmp = z * y;
} else if (a <= 5.4e+162) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-4.3d-91)) then
tmp = t_1
else if (a <= 2.15d-8) then
tmp = z * y
else if (a <= 5.4d+162) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (a <= -4.3e-91) {
tmp = t_1;
} else if (a <= 2.15e-8) {
tmp = z * y;
} else if (a <= 5.4e+162) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -4.3e-91: tmp = t_1 elif a <= 2.15e-8: tmp = z * y elif a <= 5.4e+162: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -4.3e-91) tmp = t_1; elseif (a <= 2.15e-8) tmp = Float64(z * y); elseif (a <= 5.4e+162) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -4.3e-91) tmp = t_1; elseif (a <= 2.15e-8) tmp = z * y; elseif (a <= 5.4e+162) tmp = t_1; else tmp = a * t; 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, -4.3e-91], t$95$1, If[LessEqual[a, 2.15e-8], N[(z * y), $MachinePrecision], If[LessEqual[a, 5.4e+162], t$95$1, N[(a * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -4.3 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{-8}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -4.3e-91 or 2.1500000000000001e-8 < a < 5.4000000000000003e162Initial program 87.9%
associate-+l+87.9%
+-commutative87.9%
fma-define87.9%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
distribute-rgt-out95.0%
remove-double-neg95.0%
*-commutative95.0%
distribute-lft-neg-out95.0%
sub-neg95.0%
sub-neg95.0%
distribute-lft-neg-out95.0%
*-commutative95.0%
remove-double-neg95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in y around 0 85.6%
Taylor expanded in z around inf 51.2%
if -4.3e-91 < a < 2.1500000000000001e-8Initial program 98.2%
associate-+l+98.2%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in t around 0 78.8%
+-commutative78.8%
associate-*r*86.0%
distribute-rgt-in86.9%
Simplified86.9%
Taylor expanded in x around inf 76.5%
Taylor expanded in y around inf 45.7%
*-commutative45.7%
Simplified45.7%
if 5.4000000000000003e162 < a Initial program 85.1%
associate-+l+85.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in z around 0 74.2%
Taylor expanded in x around 0 62.7%
Final simplification50.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1050.0) (not (<= z 4.1e-25))) (+ x (* 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 <= -1050.0) || !(z <= 4.1e-25)) {
tmp = x + (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 <= (-1050.0d0)) .or. (.not. (z <= 4.1d-25))) then
tmp = x + (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 <= -1050.0) || !(z <= 4.1e-25)) {
tmp = x + (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 <= -1050.0) or not (z <= 4.1e-25): tmp = x + (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 <= -1050.0) || !(z <= 4.1e-25)) tmp = Float64(x + 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 <= -1050.0) || ~((z <= 4.1e-25))) tmp = x + (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, -1050.0], N[Not[LessEqual[z, 4.1e-25]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $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 -1050 \lor \neg \left(z \leq 4.1 \cdot 10^{-25}\right):\\
\;\;\;\;x + 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 < -1050 or 4.09999999999999987e-25 < z Initial program 86.3%
associate-+l+86.3%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in t around 0 82.1%
+-commutative82.1%
associate-*r*88.2%
distribute-rgt-in92.4%
Simplified92.4%
if -1050 < z < 4.09999999999999987e-25Initial program 99.2%
associate-+l+99.2%
+-commutative99.2%
fma-define99.2%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
distribute-rgt-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 87.0%
Final simplification90.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.12e-91) (not (<= a 1.55e-86))) (+ x (* a (+ t (* z b)))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.12e-91) || !(a <= 1.55e-86)) {
tmp = x + (a * (t + (z * b)));
} 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.12d-91)) .or. (.not. (a <= 1.55d-86))) then
tmp = x + (a * (t + (z * b)))
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.12e-91) || !(a <= 1.55e-86)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.12e-91) or not (a <= 1.55e-86): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.12e-91) || !(a <= 1.55e-86)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); 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.12e-91) || ~((a <= 1.55e-86))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.12e-91], N[Not[LessEqual[a, 1.55e-86]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{-91} \lor \neg \left(a \leq 1.55 \cdot 10^{-86}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.12e-91 or 1.54999999999999994e-86 < a Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
fma-define88.4%
associate-*l*94.4%
*-commutative94.4%
*-commutative94.4%
distribute-rgt-out95.6%
remove-double-neg95.6%
*-commutative95.6%
distribute-lft-neg-out95.6%
sub-neg95.6%
sub-neg95.6%
distribute-lft-neg-out95.6%
*-commutative95.6%
remove-double-neg95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in y around 0 87.0%
if -1.12e-91 < a < 1.54999999999999994e-86Initial program 98.0%
associate-+l+98.0%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in t around 0 82.1%
+-commutative82.1%
associate-*r*89.2%
distribute-rgt-in90.3%
Simplified90.3%
Taylor expanded in y around inf 84.0%
*-commutative84.0%
Simplified84.0%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.06e+39) (* z y) (if (<= z -4e-165) x (if (<= z 4.9e-25) (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.06e+39) {
tmp = z * y;
} else if (z <= -4e-165) {
tmp = x;
} else if (z <= 4.9e-25) {
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 (z <= (-1.06d+39)) then
tmp = z * y
else if (z <= (-4d-165)) then
tmp = x
else if (z <= 4.9d-25) 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 (z <= -1.06e+39) {
tmp = z * y;
} else if (z <= -4e-165) {
tmp = x;
} else if (z <= 4.9e-25) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.06e+39: tmp = z * y elif z <= -4e-165: tmp = x elif z <= 4.9e-25: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.06e+39) tmp = Float64(z * y); elseif (z <= -4e-165) tmp = x; elseif (z <= 4.9e-25) 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 (z <= -1.06e+39) tmp = z * y; elseif (z <= -4e-165) tmp = x; elseif (z <= 4.9e-25) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.06e+39], N[(z * y), $MachinePrecision], If[LessEqual[z, -4e-165], x, If[LessEqual[z, 4.9e-25], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+39}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-165}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-25}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.06000000000000005e39 or 4.8999999999999999e-25 < z Initial program 85.8%
associate-+l+85.8%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around 0 81.4%
+-commutative81.4%
associate-*r*87.7%
distribute-rgt-in92.1%
Simplified92.1%
Taylor expanded in x around inf 75.7%
Taylor expanded in y around inf 40.7%
*-commutative40.7%
Simplified40.7%
if -1.06000000000000005e39 < z < -4e-165Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 85.5%
+-commutative85.5%
associate-*r*83.1%
distribute-rgt-in83.1%
Simplified83.1%
Taylor expanded in x around inf 40.6%
if -4e-165 < z < 4.8999999999999999e-25Initial program 98.9%
associate-+l+98.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 75.3%
Taylor expanded in x around 0 47.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z 4.5e+47) (+ (* a (+ t (* z b))) (+ x (* z y))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4.5e+47) {
tmp = (a * (t + (z * b))) + (x + (z * y));
} else {
tmp = x + (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 <= 4.5d+47) then
tmp = (a * (t + (z * b))) + (x + (z * y))
else
tmp = x + (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 <= 4.5e+47) {
tmp = (a * (t + (z * b))) + (x + (z * y));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 4.5e+47: tmp = (a * (t + (z * b))) + (x + (z * y)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4.5e+47) tmp = Float64(Float64(a * Float64(t + Float64(z * b))) + Float64(x + Float64(z * y))); else tmp = Float64(x + 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 <= 4.5e+47) tmp = (a * (t + (z * b))) + (x + (z * y)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4.5e+47], N[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.5 \cdot 10^{+47}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right) + \left(x + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 4.49999999999999979e47Initial program 94.1%
associate-+l+94.1%
+-commutative94.1%
fma-define94.1%
associate-*l*96.5%
*-commutative96.5%
*-commutative96.5%
distribute-rgt-out97.5%
remove-double-neg97.5%
*-commutative97.5%
distribute-lft-neg-out97.5%
sub-neg97.5%
sub-neg97.5%
distribute-lft-neg-out97.5%
*-commutative97.5%
remove-double-neg97.5%
*-commutative97.5%
Simplified97.5%
fma-undefine97.5%
Applied egg-rr97.5%
if 4.49999999999999979e47 < z Initial program 85.2%
associate-+l+85.2%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in t around 0 78.4%
+-commutative78.4%
associate-*r*88.2%
distribute-rgt-in95.0%
Simplified95.0%
Final simplification96.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.9e-46) (not (<= a 1.8e-86))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.9e-46) || !(a <= 1.8e-86)) {
tmp = a * (t + (z * b));
} 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.9d-46)) .or. (.not. (a <= 1.8d-86))) then
tmp = a * (t + (z * b))
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.9e-46) || !(a <= 1.8e-86)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.9e-46) or not (a <= 1.8e-86): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.9e-46) || !(a <= 1.8e-86)) tmp = Float64(a * Float64(t + Float64(z * b))); 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.9e-46) || ~((a <= 1.8e-86))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.9e-46], N[Not[LessEqual[a, 1.8e-86]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-46} \lor \neg \left(a \leq 1.8 \cdot 10^{-86}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.8999999999999998e-46 or 1.79999999999999983e-86 < a Initial program 87.9%
associate-+l+87.9%
+-commutative87.9%
fma-define87.9%
associate-*l*94.7%
*-commutative94.7%
*-commutative94.7%
distribute-rgt-out96.0%
remove-double-neg96.0%
*-commutative96.0%
distribute-lft-neg-out96.0%
sub-neg96.0%
sub-neg96.0%
distribute-lft-neg-out96.0%
*-commutative96.0%
remove-double-neg96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y around 0 87.7%
Taylor expanded in x around 0 76.0%
if -1.8999999999999998e-46 < a < 1.79999999999999983e-86Initial program 98.1%
associate-+l+98.1%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in t around 0 81.7%
+-commutative81.7%
associate-*r*89.3%
distribute-rgt-in90.2%
Simplified90.2%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
Simplified81.6%
Final simplification78.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.35e-31) (* a (* z b)) (if (<= a 1.7e-86) (+ x (* z y)) (+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.35e-31) {
tmp = a * (z * b);
} else if (a <= 1.7e-86) {
tmp = x + (z * 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 (a <= (-1.35d-31)) then
tmp = a * (z * b)
else if (a <= 1.7d-86) then
tmp = x + (z * 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 (a <= -1.35e-31) {
tmp = a * (z * b);
} else if (a <= 1.7e-86) {
tmp = x + (z * y);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.35e-31: tmp = a * (z * b) elif a <= 1.7e-86: tmp = x + (z * y) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.35e-31) tmp = Float64(a * Float64(z * b)); elseif (a <= 1.7e-86) tmp = Float64(x + Float64(z * 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 (a <= -1.35e-31) tmp = a * (z * b); elseif (a <= 1.7e-86) tmp = x + (z * y); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.35e-31], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e-86], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-31}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-86}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if a < -1.35000000000000007e-31Initial program 83.5%
associate-+l+83.5%
+-commutative83.5%
fma-define83.5%
associate-*l*92.8%
*-commutative92.8%
*-commutative92.8%
distribute-rgt-out94.2%
remove-double-neg94.2%
*-commutative94.2%
distribute-lft-neg-out94.2%
sub-neg94.2%
sub-neg94.2%
distribute-lft-neg-out94.2%
*-commutative94.2%
remove-double-neg94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in y around 0 89.0%
Taylor expanded in z around inf 55.9%
if -1.35000000000000007e-31 < a < 1.7e-86Initial program 98.2%
associate-+l+98.2%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in t around 0 81.2%
+-commutative81.2%
associate-*r*88.6%
distribute-rgt-in89.5%
Simplified89.5%
Taylor expanded in y around inf 81.0%
*-commutative81.0%
Simplified81.0%
if 1.7e-86 < a Initial program 91.5%
associate-+l+91.5%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in z around 0 53.7%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.7e+45) (not (<= t 710.0))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.7e+45) || !(t <= 710.0)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.7d+45)) .or. (.not. (t <= 710.0d0))) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.7e+45) || !(t <= 710.0)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.7e+45) or not (t <= 710.0): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.7e+45) || !(t <= 710.0)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.7e+45) || ~((t <= 710.0))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.7e+45], N[Not[LessEqual[t, 710.0]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+45} \lor \neg \left(t \leq 710\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.69999999999999984e45 or 710 < t Initial program 94.0%
associate-+l+94.0%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in z around 0 58.8%
Taylor expanded in x around 0 47.6%
if -2.69999999999999984e45 < t < 710Initial program 90.3%
associate-+l+90.3%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in t around 0 89.8%
+-commutative89.8%
associate-*r*90.0%
distribute-rgt-in93.6%
Simplified93.6%
Taylor expanded in x around inf 31.2%
Final simplification38.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 92.0%
associate-+l+92.0%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in t around 0 73.0%
+-commutative73.0%
associate-*r*75.9%
distribute-rgt-in78.3%
Simplified78.3%
Taylor expanded in x around inf 22.3%
(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 2024150
(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)))