
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.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*6.7%
Simplified6.7%
Taylor expanded in a around inf 93.3%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -3.8e-13)
(* t a)
(if (<= a -3.1e-213)
(* y z)
(if (<= a -6.6e-245)
x
(if (<= a 7.6e-123)
(* y z)
(if (<= a 1.25e-57) x (if (<= a 8.4e+67) (* t a) (* a (* z b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.8e-13) {
tmp = t * a;
} else if (a <= -3.1e-213) {
tmp = y * z;
} else if (a <= -6.6e-245) {
tmp = x;
} else if (a <= 7.6e-123) {
tmp = y * z;
} else if (a <= 1.25e-57) {
tmp = x;
} else if (a <= 8.4e+67) {
tmp = t * a;
} else {
tmp = a * (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 (a <= (-3.8d-13)) then
tmp = t * a
else if (a <= (-3.1d-213)) then
tmp = y * z
else if (a <= (-6.6d-245)) then
tmp = x
else if (a <= 7.6d-123) then
tmp = y * z
else if (a <= 1.25d-57) then
tmp = x
else if (a <= 8.4d+67) then
tmp = t * a
else
tmp = a * (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 (a <= -3.8e-13) {
tmp = t * a;
} else if (a <= -3.1e-213) {
tmp = y * z;
} else if (a <= -6.6e-245) {
tmp = x;
} else if (a <= 7.6e-123) {
tmp = y * z;
} else if (a <= 1.25e-57) {
tmp = x;
} else if (a <= 8.4e+67) {
tmp = t * a;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.8e-13: tmp = t * a elif a <= -3.1e-213: tmp = y * z elif a <= -6.6e-245: tmp = x elif a <= 7.6e-123: tmp = y * z elif a <= 1.25e-57: tmp = x elif a <= 8.4e+67: tmp = t * a else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.8e-13) tmp = Float64(t * a); elseif (a <= -3.1e-213) tmp = Float64(y * z); elseif (a <= -6.6e-245) tmp = x; elseif (a <= 7.6e-123) tmp = Float64(y * z); elseif (a <= 1.25e-57) tmp = x; elseif (a <= 8.4e+67) tmp = Float64(t * a); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.8e-13) tmp = t * a; elseif (a <= -3.1e-213) tmp = y * z; elseif (a <= -6.6e-245) tmp = x; elseif (a <= 7.6e-123) tmp = y * z; elseif (a <= 1.25e-57) tmp = x; elseif (a <= 8.4e+67) tmp = t * a; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.8e-13], N[(t * a), $MachinePrecision], If[LessEqual[a, -3.1e-213], N[(y * z), $MachinePrecision], If[LessEqual[a, -6.6e-245], x, If[LessEqual[a, 7.6e-123], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.25e-57], x, If[LessEqual[a, 8.4e+67], N[(t * a), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-13}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{-213}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq -6.6 \cdot 10^{-245}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{-123}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 8.4 \cdot 10^{+67}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -3.8e-13 or 1.25e-57 < a < 8.4000000000000005e67Initial program 89.9%
associate-+l+89.9%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in t around inf 45.4%
if -3.8e-13 < a < -3.0999999999999998e-213 or -6.6000000000000002e-245 < a < 7.59999999999999991e-123Initial program 98.9%
associate-+l+98.9%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in y around inf 58.3%
*-commutative58.3%
Simplified58.3%
if -3.0999999999999998e-213 < a < -6.6000000000000002e-245 or 7.59999999999999991e-123 < a < 1.25e-57Initial program 100.0%
associate-+l+100.0%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in x around inf 65.2%
if 8.4000000000000005e67 < a Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
fma-def88.4%
associate-*l*90.3%
*-commutative90.3%
*-commutative90.3%
distribute-rgt-out92.2%
*-commutative92.2%
Simplified92.2%
add-cube-cbrt91.8%
pow391.8%
+-commutative91.8%
fma-def91.8%
Applied egg-rr91.8%
Taylor expanded in z around inf 51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in y around 0 53.2%
*-commutative53.2%
Simplified53.2%
Final simplification53.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.3e-12)
(* t a)
(if (<= a -6e-210)
(* y z)
(if (<= a -1.95e-244)
x
(if (<= a 1e-120) (* y z) (if (<= a 1.25e-57) x (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.3e-12) {
tmp = t * a;
} else if (a <= -6e-210) {
tmp = y * z;
} else if (a <= -1.95e-244) {
tmp = x;
} else if (a <= 1e-120) {
tmp = y * z;
} else if (a <= 1.25e-57) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.3d-12)) then
tmp = t * a
else if (a <= (-6d-210)) then
tmp = y * z
else if (a <= (-1.95d-244)) then
tmp = x
else if (a <= 1d-120) then
tmp = y * z
else if (a <= 1.25d-57) then
tmp = x
else
tmp = t * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.3e-12) {
tmp = t * a;
} else if (a <= -6e-210) {
tmp = y * z;
} else if (a <= -1.95e-244) {
tmp = x;
} else if (a <= 1e-120) {
tmp = y * z;
} else if (a <= 1.25e-57) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.3e-12: tmp = t * a elif a <= -6e-210: tmp = y * z elif a <= -1.95e-244: tmp = x elif a <= 1e-120: tmp = y * z elif a <= 1.25e-57: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.3e-12) tmp = Float64(t * a); elseif (a <= -6e-210) tmp = Float64(y * z); elseif (a <= -1.95e-244) tmp = x; elseif (a <= 1e-120) tmp = Float64(y * z); elseif (a <= 1.25e-57) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.3e-12) tmp = t * a; elseif (a <= -6e-210) tmp = y * z; elseif (a <= -1.95e-244) tmp = x; elseif (a <= 1e-120) tmp = y * z; elseif (a <= 1.25e-57) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.3e-12], N[(t * a), $MachinePrecision], If[LessEqual[a, -6e-210], N[(y * z), $MachinePrecision], If[LessEqual[a, -1.95e-244], x, If[LessEqual[a, 1e-120], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.25e-57], x, N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-210}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-244}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 10^{-120}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -2.29999999999999989e-12 or 1.25e-57 < a Initial program 89.3%
associate-+l+89.3%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in t around inf 43.0%
if -2.29999999999999989e-12 < a < -6.0000000000000003e-210 or -1.9499999999999999e-244 < a < 9.99999999999999979e-121Initial program 98.9%
associate-+l+98.9%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in y around inf 58.3%
*-commutative58.3%
Simplified58.3%
if -6.0000000000000003e-210 < a < -1.9499999999999999e-244 or 9.99999999999999979e-121 < a < 1.25e-57Initial program 100.0%
associate-+l+100.0%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in x around inf 65.2%
Final simplification50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))))
(if (<= a -6e-13)
t_1
(if (<= a 8000000000.0)
(+ x (* y z))
(if (or (<= a 4.2e+195) (not (<= a 1.5e+292))) t_1 (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double tmp;
if (a <= -6e-13) {
tmp = t_1;
} else if (a <= 8000000000.0) {
tmp = x + (y * z);
} else if ((a <= 4.2e+195) || !(a <= 1.5e+292)) {
tmp = t_1;
} else {
tmp = a * (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) :: t_1
real(8) :: tmp
t_1 = x + (t * a)
if (a <= (-6d-13)) then
tmp = t_1
else if (a <= 8000000000.0d0) then
tmp = x + (y * z)
else if ((a <= 4.2d+195) .or. (.not. (a <= 1.5d+292))) then
tmp = t_1
else
tmp = a * (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 t_1 = x + (t * a);
double tmp;
if (a <= -6e-13) {
tmp = t_1;
} else if (a <= 8000000000.0) {
tmp = x + (y * z);
} else if ((a <= 4.2e+195) || !(a <= 1.5e+292)) {
tmp = t_1;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) tmp = 0 if a <= -6e-13: tmp = t_1 elif a <= 8000000000.0: tmp = x + (y * z) elif (a <= 4.2e+195) or not (a <= 1.5e+292): tmp = t_1 else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) tmp = 0.0 if (a <= -6e-13) tmp = t_1; elseif (a <= 8000000000.0) tmp = Float64(x + Float64(y * z)); elseif ((a <= 4.2e+195) || !(a <= 1.5e+292)) tmp = t_1; else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); tmp = 0.0; if (a <= -6e-13) tmp = t_1; elseif (a <= 8000000000.0) tmp = x + (y * z); elseif ((a <= 4.2e+195) || ~((a <= 1.5e+292))) tmp = t_1; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e-13], t$95$1, If[LessEqual[a, 8000000000.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4.2e+195], N[Not[LessEqual[a, 1.5e+292]], $MachinePrecision]], t$95$1, N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -6 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 8000000000:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+195} \lor \neg \left(a \leq 1.5 \cdot 10^{+292}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -5.99999999999999968e-13 or 8e9 < a < 4.20000000000000019e195 or 1.50000000000000002e292 < a Initial program 90.5%
associate-+l+90.5%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in z around 0 60.7%
+-commutative60.7%
Simplified60.7%
if -5.99999999999999968e-13 < a < 8e9Initial program 99.2%
associate-+l+99.2%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in a around 0 78.6%
if 4.20000000000000019e195 < a < 1.50000000000000002e292Initial program 79.1%
associate-+l+79.1%
+-commutative79.1%
fma-def79.1%
associate-*l*83.3%
*-commutative83.3%
*-commutative83.3%
distribute-rgt-out87.4%
*-commutative87.4%
Simplified87.4%
add-cube-cbrt87.3%
pow387.3%
+-commutative87.3%
fma-def87.3%
Applied egg-rr87.3%
Taylor expanded in z around inf 59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in y around 0 66.8%
*-commutative66.8%
Simplified66.8%
Final simplification70.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -9.5e-14)
t_1
(if (<= a -4.5e-160)
(* z (+ y (* a b)))
(if (<= a 3.05e-120) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -9.5e-14) {
tmp = t_1;
} else if (a <= -4.5e-160) {
tmp = z * (y + (a * b));
} else if (a <= 3.05e-120) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (a * (t + (z * b)))
if (a <= (-9.5d-14)) then
tmp = t_1
else if (a <= (-4.5d-160)) then
tmp = z * (y + (a * b))
else if (a <= 3.05d-120) then
tmp = x + (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (z * b)));
double tmp;
if (a <= -9.5e-14) {
tmp = t_1;
} else if (a <= -4.5e-160) {
tmp = z * (y + (a * b));
} else if (a <= 3.05e-120) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if a <= -9.5e-14: tmp = t_1 elif a <= -4.5e-160: tmp = z * (y + (a * b)) elif a <= 3.05e-120: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -9.5e-14) tmp = t_1; elseif (a <= -4.5e-160) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 3.05e-120) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -9.5e-14) tmp = t_1; elseif (a <= -4.5e-160) tmp = z * (y + (a * b)); elseif (a <= 3.05e-120) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e-14], t$95$1, If[LessEqual[a, -4.5e-160], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.05e-120], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.5 \cdot 10^{-160}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 3.05 \cdot 10^{-120}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -9.4999999999999999e-14 or 3.05e-120 < a Initial program 90.3%
associate-+l+90.3%
+-commutative90.3%
fma-def90.3%
associate-*l*91.5%
*-commutative91.5%
*-commutative91.5%
distribute-rgt-out96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around 0 91.7%
if -9.4999999999999999e-14 < a < -4.50000000000000026e-160Initial program 96.3%
associate-+l+96.3%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in z around inf 78.7%
if -4.50000000000000026e-160 < a < 3.05e-120Initial program 100.0%
associate-+l+100.0%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in a around 0 91.9%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* t a) (* y z))) (t_2 (+ x (* a (+ t (* z b))))))
(if (<= a -3.1e-40)
t_2
(if (<= a -4.1e-160)
(+ (* (* z a) b) t_1)
(if (<= a 1.18e-32) (+ x t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t * a) + (y * z);
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -3.1e-40) {
tmp = t_2;
} else if (a <= -4.1e-160) {
tmp = ((z * a) * b) + t_1;
} else if (a <= 1.18e-32) {
tmp = x + t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t * a) + (y * z)
t_2 = x + (a * (t + (z * b)))
if (a <= (-3.1d-40)) then
tmp = t_2
else if (a <= (-4.1d-160)) then
tmp = ((z * a) * b) + t_1
else if (a <= 1.18d-32) then
tmp = x + t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t * a) + (y * z);
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -3.1e-40) {
tmp = t_2;
} else if (a <= -4.1e-160) {
tmp = ((z * a) * b) + t_1;
} else if (a <= 1.18e-32) {
tmp = x + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t * a) + (y * z) t_2 = x + (a * (t + (z * b))) tmp = 0 if a <= -3.1e-40: tmp = t_2 elif a <= -4.1e-160: tmp = ((z * a) * b) + t_1 elif a <= 1.18e-32: tmp = x + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t * a) + Float64(y * z)) t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -3.1e-40) tmp = t_2; elseif (a <= -4.1e-160) tmp = Float64(Float64(Float64(z * a) * b) + t_1); elseif (a <= 1.18e-32) tmp = Float64(x + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t * a) + (y * z); t_2 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -3.1e-40) tmp = t_2; elseif (a <= -4.1e-160) tmp = ((z * a) * b) + t_1; elseif (a <= 1.18e-32) tmp = x + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.1e-40], t$95$2, If[LessEqual[a, -4.1e-160], N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 1.18e-32], N[(x + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -3.1 \cdot 10^{-40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -4.1 \cdot 10^{-160}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b + t_1\\
\mathbf{elif}\;a \leq 1.18 \cdot 10^{-32}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -3.10000000000000011e-40 or 1.17999999999999997e-32 < a Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-def88.5%
associate-*l*89.8%
*-commutative89.8%
*-commutative89.8%
distribute-rgt-out94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in y around 0 92.9%
if -3.10000000000000011e-40 < a < -4.10000000000000002e-160Initial program 99.8%
Taylor expanded in x around 0 95.3%
if -4.10000000000000002e-160 < a < 1.17999999999999997e-32Initial program 100.0%
associate-+l+100.0%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in b around 0 95.7%
Final simplification94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.62e-12)
t_1
(if (<= a -4e-160)
(* z (+ y (* a b)))
(if (<= a 4.6e-54) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.62e-12) {
tmp = t_1;
} else if (a <= -4e-160) {
tmp = z * (y + (a * b));
} else if (a <= 4.6e-54) {
tmp = x + (y * z);
} 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 * (t + (z * b))
if (a <= (-1.62d-12)) then
tmp = t_1
else if (a <= (-4d-160)) then
tmp = z * (y + (a * b))
else if (a <= 4.6d-54) then
tmp = x + (y * z)
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 * (t + (z * b));
double tmp;
if (a <= -1.62e-12) {
tmp = t_1;
} else if (a <= -4e-160) {
tmp = z * (y + (a * b));
} else if (a <= 4.6e-54) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.62e-12: tmp = t_1 elif a <= -4e-160: tmp = z * (y + (a * b)) elif a <= 4.6e-54: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.62e-12) tmp = t_1; elseif (a <= -4e-160) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 4.6e-54) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -1.62e-12) tmp = t_1; elseif (a <= -4e-160) tmp = z * (y + (a * b)); elseif (a <= 4.6e-54) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.62e-12], t$95$1, If[LessEqual[a, -4e-160], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.6e-54], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.62 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4 \cdot 10^{-160}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-54}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.62e-12 or 4.5999999999999998e-54 < a Initial program 89.3%
associate-+l+89.3%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in a around inf 79.6%
if -1.62e-12 < a < -4e-160Initial program 96.3%
associate-+l+96.3%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in z around inf 78.7%
if -4e-160 < a < 4.5999999999999998e-54Initial program 100.0%
associate-+l+100.0%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around 0 88.9%
Final simplification82.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z 6.2e+173) (+ (+ x (* y z)) (+ (* a (* z b)) (* t a))) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6.2e+173) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 6.2d+173) then
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a))
else
tmp = z * (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6.2e+173) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 6.2e+173: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 6.2e+173) tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 6.2e+173) tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6.2e+173], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.2 \cdot 10^{+173}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 6.2e173Initial program 96.0%
associate-+l+96.0%
associate-*l*93.1%
Simplified93.1%
if 6.2e173 < z Initial program 73.4%
associate-+l+73.4%
associate-*l*69.7%
Simplified69.7%
Taylor expanded in z around inf 88.6%
Final simplification92.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7e-30) (not (<= a 2.8e-32))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7e-30) || !(a <= 2.8e-32)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-7d-30)) .or. (.not. (a <= 2.8d-32))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7e-30) || !(a <= 2.8e-32)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7e-30) or not (a <= 2.8e-32): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7e-30) || !(a <= 2.8e-32)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -7e-30) || ~((a <= 2.8e-32))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7e-30], N[Not[LessEqual[a, 2.8e-32]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{-30} \lor \neg \left(a \leq 2.8 \cdot 10^{-32}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if a < -7.0000000000000006e-30 or 2.7999999999999999e-32 < a Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
fma-def88.3%
associate-*l*89.7%
*-commutative89.7%
*-commutative89.7%
distribute-rgt-out94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in y around 0 93.5%
if -7.0000000000000006e-30 < a < 2.7999999999999999e-32Initial program 99.9%
associate-+l+99.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in b around 0 91.2%
Final simplification92.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.2e-30) (not (<= a 7e-54))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.2e-30) || !(a <= 7e-54)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-5.2d-30)) .or. (.not. (a <= 7d-54))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.2e-30) || !(a <= 7e-54)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.2e-30) or not (a <= 7e-54): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5.2e-30) || !(a <= 7e-54)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -5.2e-30) || ~((a <= 7e-54))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.2e-30], N[Not[LessEqual[a, 7e-54]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-30} \lor \neg \left(a \leq 7 \cdot 10^{-54}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -5.19999999999999973e-30 or 6.99999999999999964e-54 < a Initial program 88.7%
associate-+l+88.7%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in a around inf 79.2%
if -5.19999999999999973e-30 < a < 6.99999999999999964e-54Initial program 99.9%
associate-+l+99.9%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in a around 0 82.3%
Final simplification80.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.35e-12) (* t a) (if (<= a 1.1e+63) (+ x (* y z)) (* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.35e-12) {
tmp = t * a;
} else if (a <= 1.1e+63) {
tmp = x + (y * z);
} else {
tmp = a * (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 (a <= (-2.35d-12)) then
tmp = t * a
else if (a <= 1.1d+63) then
tmp = x + (y * z)
else
tmp = a * (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 (a <= -2.35e-12) {
tmp = t * a;
} else if (a <= 1.1e+63) {
tmp = x + (y * z);
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.35e-12: tmp = t * a elif a <= 1.1e+63: tmp = x + (y * z) else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.35e-12) tmp = Float64(t * a); elseif (a <= 1.1e+63) tmp = Float64(x + Float64(y * z)); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.35e-12) tmp = t * a; elseif (a <= 1.1e+63) tmp = x + (y * z); else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.35e-12], N[(t * a), $MachinePrecision], If[LessEqual[a, 1.1e+63], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.35 \cdot 10^{-12}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+63}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -2.34999999999999988e-12Initial program 86.4%
associate-+l+86.4%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in t around inf 47.0%
if -2.34999999999999988e-12 < a < 1.0999999999999999e63Initial program 99.2%
associate-+l+99.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around 0 75.9%
if 1.0999999999999999e63 < a Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
fma-def88.6%
associate-*l*90.4%
*-commutative90.4%
*-commutative90.4%
distribute-rgt-out92.3%
*-commutative92.3%
Simplified92.3%
add-cube-cbrt91.9%
pow391.9%
+-commutative91.9%
fma-def91.9%
Applied egg-rr91.9%
Taylor expanded in z around inf 51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in y around 0 52.3%
*-commutative52.3%
Simplified52.3%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.8e+15) (not (<= t 1.35e-47))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.8e+15) || !(t <= 1.35e-47)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.8d+15)) .or. (.not. (t <= 1.35d-47))) then
tmp = t * a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.8e+15) || !(t <= 1.35e-47)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.8e+15) or not (t <= 1.35e-47): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.8e+15) || !(t <= 1.35e-47)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.8e+15) || ~((t <= 1.35e-47))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.8e+15], N[Not[LessEqual[t, 1.35e-47]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+15} \lor \neg \left(t \leq 1.35 \cdot 10^{-47}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.8e15 or 1.3499999999999999e-47 < t Initial program 90.7%
associate-+l+90.7%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in t around inf 46.8%
if -2.8e15 < t < 1.3499999999999999e-47Initial program 96.8%
associate-+l+96.8%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 32.6%
Final simplification39.8%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.7%
associate-+l+93.7%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in x around inf 22.9%
Final simplification22.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 2024024
(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)))