
(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 -1e+103)
(* a (+ t (+ (* b z) (+ (/ x a) (/ (* z y) a)))))
(if (<= a 3.5e+95)
(+ x (+ (* a t) (* z (+ y (* a b)))))
(+ (fma y z x) (* a (+ t (* b z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1e+103) {
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))));
} else if (a <= 3.5e+95) {
tmp = x + ((a * t) + (z * (y + (a * b))));
} else {
tmp = fma(y, z, x) + (a * (t + (b * z)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1e+103) tmp = Float64(a * Float64(t + Float64(Float64(b * z) + Float64(Float64(x / a) + Float64(Float64(z * y) / a))))); elseif (a <= 3.5e+95) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * Float64(y + Float64(a * b))))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(b * z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1e+103], N[(a * N[(t + N[(N[(b * z), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+95], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+103}:\\
\;\;\;\;a \cdot \left(t + \left(b \cdot z + \left(\frac{x}{a} + \frac{z \cdot y}{a}\right)\right)\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+95}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + b \cdot z\right)\\
\end{array}
\end{array}
if a < -1e103Initial program 76.4%
associate-+l+76.4%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in a around inf 97.6%
if -1e103 < a < 3.5e95Initial program 94.0%
associate-+l+94.0%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in z around 0 98.8%
if 3.5e95 < a Initial program 91.6%
associate-+l+91.6%
+-commutative91.6%
fma-define91.6%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* z y))) (* b (* a z))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (a * z));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (a * z));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((a * t) + (x + (z * y))) + (b * (a * z)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(z * y))) + Float64(b * Float64(a * z))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((a * t) + (x + (z * y))) + (b * (a * z)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + z \cdot y\right)\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.5%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*5.6%
Simplified5.6%
Taylor expanded in z around inf 83.3%
Final simplification96.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.5e+102) (not (<= a 1.76e+96))) (* a (+ t (+ (* b z) (+ (/ x a) (/ (* z y) a))))) (+ x (+ (* a t) (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.5e+102) || !(a <= 1.76e+96)) {
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))));
} else {
tmp = x + ((a * t) + (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 ((a <= (-3.5d+102)) .or. (.not. (a <= 1.76d+96))) then
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))))
else
tmp = x + ((a * t) + (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 ((a <= -3.5e+102) || !(a <= 1.76e+96)) {
tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a))));
} else {
tmp = x + ((a * t) + (z * (y + (a * b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.5e+102) or not (a <= 1.76e+96): tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a)))) else: tmp = x + ((a * t) + (z * (y + (a * b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.5e+102) || !(a <= 1.76e+96)) tmp = Float64(a * Float64(t + Float64(Float64(b * z) + Float64(Float64(x / a) + Float64(Float64(z * y) / a))))); else tmp = Float64(x + Float64(Float64(a * t) + 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 ((a <= -3.5e+102) || ~((a <= 1.76e+96))) tmp = a * (t + ((b * z) + ((x / a) + ((z * y) / a)))); else tmp = x + ((a * t) + (z * (y + (a * b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.5e+102], N[Not[LessEqual[a, 1.76e+96]], $MachinePrecision]], N[(a * N[(t + N[(N[(b * z), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+102} \lor \neg \left(a \leq 1.76 \cdot 10^{+96}\right):\\
\;\;\;\;a \cdot \left(t + \left(b \cdot z + \left(\frac{x}{a} + \frac{z \cdot y}{a}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -3.50000000000000011e102 or 1.7599999999999999e96 < a Initial program 84.2%
associate-+l+84.2%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in a around inf 98.8%
if -3.50000000000000011e102 < a < 1.7599999999999999e96Initial program 94.1%
associate-+l+94.1%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in z around 0 98.8%
Final simplification98.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.3e+262)
(* z (* a b))
(if (or (<= a -4.6e-28) (not (<= a 7.5e+112)))
(+ 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+262) {
tmp = z * (a * b);
} else if ((a <= -4.6e-28) || !(a <= 7.5e+112)) {
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+262)) then
tmp = z * (a * b)
else if ((a <= (-4.6d-28)) .or. (.not. (a <= 7.5d+112))) 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+262) {
tmp = z * (a * b);
} else if ((a <= -4.6e-28) || !(a <= 7.5e+112)) {
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+262: tmp = z * (a * b) elif (a <= -4.6e-28) or not (a <= 7.5e+112): 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+262) tmp = Float64(z * Float64(a * b)); elseif ((a <= -4.6e-28) || !(a <= 7.5e+112)) 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+262) tmp = z * (a * b); elseif ((a <= -4.6e-28) || ~((a <= 7.5e+112))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.3e+262], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -4.6e-28], N[Not[LessEqual[a, 7.5e+112]], $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^{+262}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq -4.6 \cdot 10^{-28} \lor \neg \left(a \leq 7.5 \cdot 10^{+112}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -2.3e262Initial program 71.4%
associate-+l+71.4%
associate-*l*71.4%
Simplified71.4%
Taylor expanded in z around inf 72.6%
Taylor expanded in y around 0 72.6%
if -2.3e262 < a < -4.59999999999999971e-28 or 7.5e112 < a Initial program 86.0%
associate-+l+86.0%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in z around 0 58.0%
if -4.59999999999999971e-28 < a < 7.5e112Initial program 95.3%
associate-+l+95.3%
associate-*l*92.1%
Simplified92.1%
*-commutative92.1%
distribute-lft-in92.8%
add-cube-cbrt92.5%
associate-*l*92.4%
pow292.4%
+-commutative92.4%
fma-define92.4%
Applied egg-rr92.4%
Taylor expanded in a around 0 69.4%
Final simplification65.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -7.2e+33)
t_1
(if (<= z 4.8e+144) (+ x (* a t)) (if (<= z 4.4e+245) t_1 (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -7.2e+33) {
tmp = t_1;
} else if (z <= 4.8e+144) {
tmp = x + (a * t);
} else if (z <= 4.4e+245) {
tmp = t_1;
} 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 = z * (a * b)
if (z <= (-7.2d+33)) then
tmp = t_1
else if (z <= 4.8d+144) then
tmp = x + (a * t)
else if (z <= 4.4d+245) then
tmp = t_1
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 = z * (a * b);
double tmp;
if (z <= -7.2e+33) {
tmp = t_1;
} else if (z <= 4.8e+144) {
tmp = x + (a * t);
} else if (z <= 4.4e+245) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -7.2e+33: tmp = t_1 elif z <= 4.8e+144: tmp = x + (a * t) elif z <= 4.4e+245: tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -7.2e+33) tmp = t_1; elseif (z <= 4.8e+144) tmp = Float64(x + Float64(a * t)); elseif (z <= 4.4e+245) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -7.2e+33) tmp = t_1; elseif (z <= 4.8e+144) tmp = x + (a * t); elseif (z <= 4.4e+245) tmp = t_1; else tmp = z * y; 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, -7.2e+33], t$95$1, If[LessEqual[z, 4.8e+144], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+245], t$95$1, N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+144}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+245}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -7.2000000000000005e33 or 4.8000000000000001e144 < z < 4.4000000000000001e245Initial program 80.3%
associate-+l+80.3%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in z around inf 87.1%
Taylor expanded in y around 0 55.1%
if -7.2000000000000005e33 < z < 4.8000000000000001e144Initial program 95.8%
associate-+l+95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in z around 0 63.9%
if 4.4000000000000001e245 < z Initial program 86.7%
associate-+l+86.7%
associate-*l*86.6%
Simplified86.6%
*-commutative86.6%
distribute-lft-in93.2%
add-cube-cbrt92.9%
associate-*l*92.9%
pow292.9%
+-commutative92.9%
fma-define92.9%
Applied egg-rr92.9%
Taylor expanded in y around inf 61.9%
*-commutative61.9%
Simplified61.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= b -8.8e-54)
t_1
(if (<= b 550000000.0) (* z y) (if (<= b 2.9e+125) x 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 (b <= -8.8e-54) {
tmp = t_1;
} else if (b <= 550000000.0) {
tmp = z * y;
} else if (b <= 2.9e+125) {
tmp = 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 * (a * b)
if (b <= (-8.8d-54)) then
tmp = t_1
else if (b <= 550000000.0d0) then
tmp = z * y
else if (b <= 2.9d+125) then
tmp = 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 * (a * b);
double tmp;
if (b <= -8.8e-54) {
tmp = t_1;
} else if (b <= 550000000.0) {
tmp = z * y;
} else if (b <= 2.9e+125) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if b <= -8.8e-54: tmp = t_1 elif b <= 550000000.0: tmp = z * y elif b <= 2.9e+125: tmp = x 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 (b <= -8.8e-54) tmp = t_1; elseif (b <= 550000000.0) tmp = Float64(z * y); elseif (b <= 2.9e+125) tmp = x; 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 (b <= -8.8e-54) tmp = t_1; elseif (b <= 550000000.0) tmp = z * y; elseif (b <= 2.9e+125) tmp = x; 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[b, -8.8e-54], t$95$1, If[LessEqual[b, 550000000.0], N[(z * y), $MachinePrecision], If[LessEqual[b, 2.9e+125], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -8.8 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 550000000:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+125}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.7999999999999998e-54 or 2.89999999999999993e125 < b Initial program 87.4%
associate-+l+87.4%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in z around inf 64.8%
Taylor expanded in y around 0 52.1%
if -8.7999999999999998e-54 < b < 5.5e8Initial program 94.2%
associate-+l+94.2%
associate-*l*98.3%
Simplified98.3%
*-commutative98.3%
distribute-lft-in99.1%
add-cube-cbrt98.7%
associate-*l*98.6%
pow298.6%
+-commutative98.6%
fma-define98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 40.3%
*-commutative40.3%
Simplified40.3%
if 5.5e8 < b < 2.89999999999999993e125Initial program 89.5%
associate-+l+89.5%
associate-*l*89.4%
Simplified89.4%
*-commutative89.4%
distribute-lft-in89.4%
add-cube-cbrt89.3%
associate-*l*89.3%
pow289.3%
+-commutative89.3%
fma-define89.3%
Applied egg-rr89.3%
Taylor expanded in x around inf 52.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* b z))))
(if (<= b -8.8e-54)
t_1
(if (<= b 1000000000.0) (* z y) (if (<= b 2.6e+124) x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (b * z);
double tmp;
if (b <= -8.8e-54) {
tmp = t_1;
} else if (b <= 1000000000.0) {
tmp = z * y;
} else if (b <= 2.6e+124) {
tmp = 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 = a * (b * z)
if (b <= (-8.8d-54)) then
tmp = t_1
else if (b <= 1000000000.0d0) then
tmp = z * y
else if (b <= 2.6d+124) then
tmp = 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 = a * (b * z);
double tmp;
if (b <= -8.8e-54) {
tmp = t_1;
} else if (b <= 1000000000.0) {
tmp = z * y;
} else if (b <= 2.6e+124) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (b * z) tmp = 0 if b <= -8.8e-54: tmp = t_1 elif b <= 1000000000.0: tmp = z * y elif b <= 2.6e+124: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(b * z)) tmp = 0.0 if (b <= -8.8e-54) tmp = t_1; elseif (b <= 1000000000.0) tmp = Float64(z * y); elseif (b <= 2.6e+124) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (b * z); tmp = 0.0; if (b <= -8.8e-54) tmp = t_1; elseif (b <= 1000000000.0) tmp = z * y; elseif (b <= 2.6e+124) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8.8e-54], t$95$1, If[LessEqual[b, 1000000000.0], N[(z * y), $MachinePrecision], If[LessEqual[b, 2.6e+124], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot z\right)\\
\mathbf{if}\;b \leq -8.8 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1000000000:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+124}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.7999999999999998e-54 or 2.6e124 < b Initial program 87.4%
associate-+l+87.4%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in a around inf 81.1%
Taylor expanded in b around inf 67.5%
Taylor expanded in t around 0 51.2%
if -8.7999999999999998e-54 < b < 1e9Initial program 94.2%
associate-+l+94.2%
associate-*l*98.3%
Simplified98.3%
*-commutative98.3%
distribute-lft-in99.1%
add-cube-cbrt98.7%
associate-*l*98.6%
pow298.6%
+-commutative98.6%
fma-define98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 40.3%
*-commutative40.3%
Simplified40.3%
if 1e9 < b < 2.6e124Initial program 89.5%
associate-+l+89.5%
associate-*l*89.4%
Simplified89.4%
*-commutative89.4%
distribute-lft-in89.4%
add-cube-cbrt89.3%
associate-*l*89.3%
pow289.3%
+-commutative89.3%
fma-define89.3%
Applied egg-rr89.3%
Taylor expanded in x around inf 52.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.5e-54) (not (<= b 1.45e+105))) (+ x (* 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 ((b <= -6.5e-54) || !(b <= 1.45e+105)) {
tmp = x + (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 ((b <= (-6.5d-54)) .or. (.not. (b <= 1.45d+105))) then
tmp = x + (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 ((b <= -6.5e-54) || !(b <= 1.45e+105)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.5e-54) or not (b <= 1.45e+105): tmp = x + (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 ((b <= -6.5e-54) || !(b <= 1.45e+105)) tmp = Float64(x + 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 ((b <= -6.5e-54) || ~((b <= 1.45e+105))) tmp = x + (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[b, -6.5e-54], N[Not[LessEqual[b, 1.45e+105]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-54} \lor \neg \left(b \leq 1.45 \cdot 10^{+105}\right):\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if b < -6.49999999999999991e-54 or 1.45000000000000005e105 < b Initial program 87.5%
associate-+l+87.5%
+-commutative87.5%
fma-define87.5%
associate-*l*84.2%
*-commutative84.2%
*-commutative84.2%
distribute-rgt-out90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in y around 0 83.3%
if -6.49999999999999991e-54 < b < 1.45000000000000005e105Initial program 93.5%
associate-+l+93.5%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in b around 0 93.0%
Final simplification88.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.26e+138) (+ (* a t) (* z y)) (if (<= y 1.6e+153) (+ x (* a (+ t (* b z)))) (* a (+ t (/ (* z y) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.26e+138) {
tmp = (a * t) + (z * y);
} else if (y <= 1.6e+153) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = a * (t + ((z * y) / 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 (y <= (-1.26d+138)) then
tmp = (a * t) + (z * y)
else if (y <= 1.6d+153) then
tmp = x + (a * (t + (b * z)))
else
tmp = a * (t + ((z * y) / 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 (y <= -1.26e+138) {
tmp = (a * t) + (z * y);
} else if (y <= 1.6e+153) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = a * (t + ((z * y) / a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.26e+138: tmp = (a * t) + (z * y) elif y <= 1.6e+153: tmp = x + (a * (t + (b * z))) else: tmp = a * (t + ((z * y) / a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.26e+138) tmp = Float64(Float64(a * t) + Float64(z * y)); elseif (y <= 1.6e+153) tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); else tmp = Float64(a * Float64(t + Float64(Float64(z * y) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.26e+138) tmp = (a * t) + (z * y); elseif (y <= 1.6e+153) tmp = x + (a * (t + (b * z))); else tmp = a * (t + ((z * y) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.26e+138], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+153], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+138}:\\
\;\;\;\;a \cdot t + z \cdot y\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+153}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + \frac{z \cdot y}{a}\right)\\
\end{array}
\end{array}
if y < -1.25999999999999994e138Initial program 89.1%
associate-+l+89.1%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in a around inf 78.8%
Taylor expanded in y around inf 73.5%
Taylor expanded in a around 0 86.3%
if -1.25999999999999994e138 < y < 1.6000000000000001e153Initial program 91.7%
associate-+l+91.7%
+-commutative91.7%
fma-define91.7%
associate-*l*91.7%
*-commutative91.7%
*-commutative91.7%
distribute-rgt-out95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in y around 0 85.2%
if 1.6000000000000001e153 < y Initial program 87.5%
associate-+l+87.5%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in a around inf 92.7%
Taylor expanded in y around inf 83.3%
Final simplification85.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.1e+78) (+ x (* a (+ t (* b z)))) (+ x (+ (* a t) (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.1e+78) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (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 (a <= (-1.1d+78)) then
tmp = x + (a * (t + (b * z)))
else
tmp = x + ((a * t) + (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 (a <= -1.1e+78) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (z * (y + (a * b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.1e+78: tmp = x + (a * (t + (b * z))) else: tmp = x + ((a * t) + (z * (y + (a * b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.1e+78) tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); else tmp = Float64(x + Float64(Float64(a * t) + 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 (a <= -1.1e+78) tmp = x + (a * (t + (b * z))); else tmp = x + ((a * t) + (z * (y + (a * b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.1e+78], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+78}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot \left(y + a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -1.10000000000000007e78Initial program 75.2%
associate-+l+75.2%
+-commutative75.2%
fma-define75.2%
associate-*l*82.7%
*-commutative82.7%
*-commutative82.7%
distribute-rgt-out94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in y around 0 94.1%
if -1.10000000000000007e78 < a Initial program 94.6%
associate-+l+94.6%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in z around 0 97.0%
Final simplification96.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.2e+44) (not (<= a 3.6e+14))) (* 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 <= -8.2e+44) || !(a <= 3.6e+14)) {
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 <= (-8.2d+44)) .or. (.not. (a <= 3.6d+14))) 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 <= -8.2e+44) || !(a <= 3.6e+14)) {
tmp = a * (t + (b * z));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.2e+44) or not (a <= 3.6e+14): 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 <= -8.2e+44) || !(a <= 3.6e+14)) 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 <= -8.2e+44) || ~((a <= 3.6e+14))) 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, -8.2e+44], N[Not[LessEqual[a, 3.6e+14]], $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 -8.2 \cdot 10^{+44} \lor \neg \left(a \leq 3.6 \cdot 10^{+14}\right):\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -8.1999999999999993e44 or 3.6e14 < a Initial program 83.9%
associate-+l+83.9%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in a around inf 96.7%
Taylor expanded in b around inf 80.6%
if -8.1999999999999993e44 < a < 3.6e14Initial program 97.0%
associate-+l+97.0%
associate-*l*93.3%
Simplified93.3%
*-commutative93.3%
distribute-lft-in93.3%
add-cube-cbrt93.0%
associate-*l*92.9%
pow292.9%
+-commutative92.9%
fma-define92.9%
Applied egg-rr92.9%
Taylor expanded in a around 0 72.5%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.55e-29) (not (<= a 4.2e+115))) (* a t) (* z y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e-29) || !(a <= 4.2e+115)) {
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 ((a <= (-1.55d-29)) .or. (.not. (a <= 4.2d+115))) 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 ((a <= -1.55e-29) || !(a <= 4.2e+115)) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.55e-29) or not (a <= 4.2e+115): tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.55e-29) || !(a <= 4.2e+115)) 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 ((a <= -1.55e-29) || ~((a <= 4.2e+115))) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.55e-29], N[Not[LessEqual[a, 4.2e+115]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{-29} \lor \neg \left(a \leq 4.2 \cdot 10^{+115}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if a < -1.55000000000000013e-29 or 4.20000000000000007e115 < a Initial program 84.0%
associate-+l+84.0%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in a around inf 98.0%
Taylor expanded in b around inf 83.8%
Taylor expanded in t around inf 45.6%
if -1.55000000000000013e-29 < a < 4.20000000000000007e115Initial program 95.3%
associate-+l+95.3%
associate-*l*92.1%
Simplified92.1%
*-commutative92.1%
distribute-lft-in92.8%
add-cube-cbrt92.5%
associate-*l*92.4%
pow292.4%
+-commutative92.4%
fma-define92.4%
Applied egg-rr92.4%
Taylor expanded in y around inf 39.6%
*-commutative39.6%
Simplified39.6%
Final simplification42.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.7e+88) (not (<= a 3100000.0))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.7e+88) || !(a <= 3100000.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 ((a <= (-2.7d+88)) .or. (.not. (a <= 3100000.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 ((a <= -2.7e+88) || !(a <= 3100000.0)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.7e+88) or not (a <= 3100000.0): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.7e+88) || !(a <= 3100000.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 ((a <= -2.7e+88) || ~((a <= 3100000.0))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.7e+88], N[Not[LessEqual[a, 3100000.0]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+88} \lor \neg \left(a \leq 3100000\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.70000000000000016e88 or 3.1e6 < a Initial program 83.9%
associate-+l+83.9%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in a around inf 96.5%
Taylor expanded in b around inf 80.8%
Taylor expanded in t around inf 43.7%
if -2.70000000000000016e88 < a < 3.1e6Initial program 96.4%
associate-+l+96.4%
associate-*l*92.9%
Simplified92.9%
*-commutative92.9%
distribute-lft-in92.9%
add-cube-cbrt92.5%
associate-*l*92.5%
pow292.5%
+-commutative92.5%
fma-define92.5%
Applied egg-rr92.5%
Taylor expanded in x around inf 35.4%
Final simplification39.2%
(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 90.7%
associate-+l+90.7%
associate-*l*91.0%
Simplified91.0%
*-commutative91.0%
distribute-lft-in94.6%
add-cube-cbrt94.1%
associate-*l*94.1%
pow294.1%
+-commutative94.1%
fma-define94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 23.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024137
(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)))