
(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 (<= z 5e-57) (fma a (+ t (* z b)) (fma y z x)) (fma z (fma a b y) (fma t a x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5e-57) {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 5e-57) tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); else tmp = fma(z, fma(a, b, y), fma(t, a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5e-57], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\end{array}
if z < 5.0000000000000002e-57Initial program 94.6%
associate-+l+94.7%
+-commutative94.7%
*-commutative94.7%
associate-*l*97.2%
distribute-lft-out97.8%
fma-def97.8%
+-commutative97.8%
fma-def97.8%
Simplified97.8%
if 5.0000000000000002e-57 < z Initial program 90.6%
+-commutative90.6%
+-commutative90.6%
associate-+l+90.6%
associate-+r+90.6%
*-commutative90.6%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-out98.6%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* z y))) (* b (* z a))))) (if (<= t_1 5e+306) t_1 (fma z y (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (z * y))) + (b * (z * a));
double tmp;
if (t_1 <= 5e+306) {
tmp = t_1;
} else {
tmp = fma(z, y, (a * (t + (z * 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(z * a))) tmp = 0.0 if (t_1 <= 5e+306) tmp = t_1; else tmp = fma(z, y, Float64(a * Float64(t + Float64(z * b)))); end return 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[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+306], t$95$1, N[(z * y + N[(a * N[(t + N[(z * b), $MachinePrecision]), $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(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, a \cdot \left(t + z \cdot b\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 4.99999999999999993e306Initial program 97.7%
if 4.99999999999999993e306 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 76.6%
Taylor expanded in x around 0 76.6%
associate-+l+76.6%
*-commutative76.6%
fma-def86.4%
associate-*l*96.1%
distribute-lft-out98.0%
Applied egg-rr98.0%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= (+ (+ (* a t) t_1) (* b (* z a))) INFINITY)
(+ (+ (* a t) (* a (* z b))) t_1)
(* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if ((((a * t) + t_1) + (b * (z * a))) <= ((double) INFINITY)) {
tmp = ((a * t) + (a * (z * b))) + 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 + (z * y);
double tmp;
if ((((a * t) + t_1) + (b * (z * a))) <= Double.POSITIVE_INFINITY) {
tmp = ((a * t) + (a * (z * b))) + t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) tmp = 0 if (((a * t) + t_1) + (b * (z * a))) <= math.inf: tmp = ((a * t) + (a * (z * b))) + t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) tmp = 0.0 if (Float64(Float64(Float64(a * t) + t_1) + Float64(b * Float64(z * a))) <= Inf) tmp = Float64(Float64(Float64(a * t) + Float64(a * Float64(z * b))) + 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 + (z * y); tmp = 0.0; if ((((a * t) + t_1) + (b * (z * a))) <= Inf) tmp = ((a * t) + (a * (z * b))) + 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[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(a * t), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;\left(a \cdot t + t_1\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\
\;\;\;\;\left(a \cdot t + a \cdot \left(z \cdot b\right)\right) + 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 96.9%
associate-+l+96.9%
associate-*l*98.0%
Simplified98.0%
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*22.2%
Simplified22.2%
Taylor expanded in a around inf 88.9%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= t -4.4e+33)
(* a t)
(if (<= t -1.16e-31)
x
(if (<= t -9.5e-173)
(* z y)
(if (<= t -5.2e-217)
x
(if (<= t -3.6e-258)
(* z y)
(if (<= t 1.18e-238)
t_1
(if (<= t 1.8e-194)
(* z y)
(if (<= t 5.5e-192) t_1 (if (<= t 0.62) x (* 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 (t <= -4.4e+33) {
tmp = a * t;
} else if (t <= -1.16e-31) {
tmp = x;
} else if (t <= -9.5e-173) {
tmp = z * y;
} else if (t <= -5.2e-217) {
tmp = x;
} else if (t <= -3.6e-258) {
tmp = z * y;
} else if (t <= 1.18e-238) {
tmp = t_1;
} else if (t <= 1.8e-194) {
tmp = z * y;
} else if (t <= 5.5e-192) {
tmp = t_1;
} else if (t <= 0.62) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (t <= (-4.4d+33)) then
tmp = a * t
else if (t <= (-1.16d-31)) then
tmp = x
else if (t <= (-9.5d-173)) then
tmp = z * y
else if (t <= (-5.2d-217)) then
tmp = x
else if (t <= (-3.6d-258)) then
tmp = z * y
else if (t <= 1.18d-238) then
tmp = t_1
else if (t <= 1.8d-194) then
tmp = z * y
else if (t <= 5.5d-192) then
tmp = t_1
else if (t <= 0.62d0) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (t <= -4.4e+33) {
tmp = a * t;
} else if (t <= -1.16e-31) {
tmp = x;
} else if (t <= -9.5e-173) {
tmp = z * y;
} else if (t <= -5.2e-217) {
tmp = x;
} else if (t <= -3.6e-258) {
tmp = z * y;
} else if (t <= 1.18e-238) {
tmp = t_1;
} else if (t <= 1.8e-194) {
tmp = z * y;
} else if (t <= 5.5e-192) {
tmp = t_1;
} else if (t <= 0.62) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if t <= -4.4e+33: tmp = a * t elif t <= -1.16e-31: tmp = x elif t <= -9.5e-173: tmp = z * y elif t <= -5.2e-217: tmp = x elif t <= -3.6e-258: tmp = z * y elif t <= 1.18e-238: tmp = t_1 elif t <= 1.8e-194: tmp = z * y elif t <= 5.5e-192: tmp = t_1 elif t <= 0.62: tmp = x 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 (t <= -4.4e+33) tmp = Float64(a * t); elseif (t <= -1.16e-31) tmp = x; elseif (t <= -9.5e-173) tmp = Float64(z * y); elseif (t <= -5.2e-217) tmp = x; elseif (t <= -3.6e-258) tmp = Float64(z * y); elseif (t <= 1.18e-238) tmp = t_1; elseif (t <= 1.8e-194) tmp = Float64(z * y); elseif (t <= 5.5e-192) tmp = t_1; elseif (t <= 0.62) tmp = x; 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 (t <= -4.4e+33) tmp = a * t; elseif (t <= -1.16e-31) tmp = x; elseif (t <= -9.5e-173) tmp = z * y; elseif (t <= -5.2e-217) tmp = x; elseif (t <= -3.6e-258) tmp = z * y; elseif (t <= 1.18e-238) tmp = t_1; elseif (t <= 1.8e-194) tmp = z * y; elseif (t <= 5.5e-192) tmp = t_1; elseif (t <= 0.62) tmp = x; 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[t, -4.4e+33], N[(a * t), $MachinePrecision], If[LessEqual[t, -1.16e-31], x, If[LessEqual[t, -9.5e-173], N[(z * y), $MachinePrecision], If[LessEqual[t, -5.2e-217], x, If[LessEqual[t, -3.6e-258], N[(z * y), $MachinePrecision], If[LessEqual[t, 1.18e-238], t$95$1, If[LessEqual[t, 1.8e-194], N[(z * y), $MachinePrecision], If[LessEqual[t, 5.5e-192], t$95$1, If[LessEqual[t, 0.62], x, N[(a * t), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+33}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq -1.16 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-173}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-217}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-258}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq 1.18 \cdot 10^{-238}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-194}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 0.62:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -4.39999999999999988e33 or 0.619999999999999996 < t Initial program 94.3%
associate-+l+94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in t around inf 54.8%
if -4.39999999999999988e33 < t < -1.15999999999999998e-31 or -9.49999999999999967e-173 < t < -5.19999999999999986e-217 or 5.49999999999999995e-192 < t < 0.619999999999999996Initial program 93.9%
associate-+l+93.9%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in x around inf 53.4%
if -1.15999999999999998e-31 < t < -9.49999999999999967e-173 or -5.19999999999999986e-217 < t < -3.59999999999999979e-258 or 1.18e-238 < t < 1.8e-194Initial program 90.7%
associate-+l+90.7%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
Simplified53.3%
if -3.59999999999999979e-258 < t < 1.18e-238 or 1.8e-194 < t < 5.49999999999999995e-192Initial program 93.3%
associate-+l+93.3%
+-commutative93.3%
*-commutative93.3%
associate-*l*96.5%
distribute-lft-out96.5%
fma-def96.5%
+-commutative96.5%
fma-def96.5%
Simplified96.5%
fma-udef96.5%
fma-udef96.5%
+-commutative96.5%
+-commutative96.5%
distribute-lft-in96.5%
*-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
associate-+l+96.5%
associate-+r+96.5%
*-commutative96.5%
fma-def96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in b around inf 57.4%
Final simplification54.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.15e+33)
(* a t)
(if (<= t -2.6e-31)
x
(if (<= t -4.2e-173)
(* z y)
(if (<= t -2.8e-218)
x
(if (<= t 2.6e-205) (* z y) (if (<= t 92.0) x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.15e+33) {
tmp = a * t;
} else if (t <= -2.6e-31) {
tmp = x;
} else if (t <= -4.2e-173) {
tmp = z * y;
} else if (t <= -2.8e-218) {
tmp = x;
} else if (t <= 2.6e-205) {
tmp = z * y;
} else if (t <= 92.0) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.15d+33)) then
tmp = a * t
else if (t <= (-2.6d-31)) then
tmp = x
else if (t <= (-4.2d-173)) then
tmp = z * y
else if (t <= (-2.8d-218)) then
tmp = x
else if (t <= 2.6d-205) then
tmp = z * y
else if (t <= 92.0d0) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.15e+33) {
tmp = a * t;
} else if (t <= -2.6e-31) {
tmp = x;
} else if (t <= -4.2e-173) {
tmp = z * y;
} else if (t <= -2.8e-218) {
tmp = x;
} else if (t <= 2.6e-205) {
tmp = z * y;
} else if (t <= 92.0) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.15e+33: tmp = a * t elif t <= -2.6e-31: tmp = x elif t <= -4.2e-173: tmp = z * y elif t <= -2.8e-218: tmp = x elif t <= 2.6e-205: tmp = z * y elif t <= 92.0: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.15e+33) tmp = Float64(a * t); elseif (t <= -2.6e-31) tmp = x; elseif (t <= -4.2e-173) tmp = Float64(z * y); elseif (t <= -2.8e-218) tmp = x; elseif (t <= 2.6e-205) tmp = Float64(z * y); elseif (t <= 92.0) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.15e+33) tmp = a * t; elseif (t <= -2.6e-31) tmp = x; elseif (t <= -4.2e-173) tmp = z * y; elseif (t <= -2.8e-218) tmp = x; elseif (t <= 2.6e-205) tmp = z * y; elseif (t <= 92.0) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.15e+33], N[(a * t), $MachinePrecision], If[LessEqual[t, -2.6e-31], x, If[LessEqual[t, -4.2e-173], N[(z * y), $MachinePrecision], If[LessEqual[t, -2.8e-218], x, If[LessEqual[t, 2.6e-205], N[(z * y), $MachinePrecision], If[LessEqual[t, 92.0], x, N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+33}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-173}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-218}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-205}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;t \leq 92:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -1.15000000000000005e33 or 92 < t Initial program 94.3%
associate-+l+94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in t around inf 54.8%
if -1.15000000000000005e33 < t < -2.59999999999999995e-31 or -4.20000000000000003e-173 < t < -2.80000000000000009e-218 or 2.5999999999999998e-205 < t < 92Initial program 94.1%
associate-+l+94.1%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in x around inf 52.5%
if -2.59999999999999995e-31 < t < -4.20000000000000003e-173 or -2.80000000000000009e-218 < t < 2.5999999999999998e-205Initial program 91.5%
associate-+l+91.5%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in y around inf 40.7%
*-commutative40.7%
Simplified40.7%
Final simplification50.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -3e+18)
(* b (* z a))
(if (<= a -1.28e-54)
(* a t)
(if (<= a -7e-198)
x
(if (<= a -1.6e-302)
(* z y)
(if (<= a 3.5e-100) x (if (<= a 930.0) (* z y) (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3e+18) {
tmp = b * (z * a);
} else if (a <= -1.28e-54) {
tmp = a * t;
} else if (a <= -7e-198) {
tmp = x;
} else if (a <= -1.6e-302) {
tmp = z * y;
} else if (a <= 3.5e-100) {
tmp = x;
} else if (a <= 930.0) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-3d+18)) then
tmp = b * (z * a)
else if (a <= (-1.28d-54)) then
tmp = a * t
else if (a <= (-7d-198)) then
tmp = x
else if (a <= (-1.6d-302)) then
tmp = z * y
else if (a <= 3.5d-100) then
tmp = x
else if (a <= 930.0d0) then
tmp = z * y
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3e+18) {
tmp = b * (z * a);
} else if (a <= -1.28e-54) {
tmp = a * t;
} else if (a <= -7e-198) {
tmp = x;
} else if (a <= -1.6e-302) {
tmp = z * y;
} else if (a <= 3.5e-100) {
tmp = x;
} else if (a <= 930.0) {
tmp = z * y;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3e+18: tmp = b * (z * a) elif a <= -1.28e-54: tmp = a * t elif a <= -7e-198: tmp = x elif a <= -1.6e-302: tmp = z * y elif a <= 3.5e-100: tmp = x elif a <= 930.0: tmp = z * y else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3e+18) tmp = Float64(b * Float64(z * a)); elseif (a <= -1.28e-54) tmp = Float64(a * t); elseif (a <= -7e-198) tmp = x; elseif (a <= -1.6e-302) tmp = Float64(z * y); elseif (a <= 3.5e-100) tmp = x; elseif (a <= 930.0) tmp = Float64(z * y); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3e+18) tmp = b * (z * a); elseif (a <= -1.28e-54) tmp = a * t; elseif (a <= -7e-198) tmp = x; elseif (a <= -1.6e-302) tmp = z * y; elseif (a <= 3.5e-100) tmp = x; elseif (a <= 930.0) tmp = z * y; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3e+18], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.28e-54], N[(a * t), $MachinePrecision], If[LessEqual[a, -7e-198], x, If[LessEqual[a, -1.6e-302], N[(z * y), $MachinePrecision], If[LessEqual[a, 3.5e-100], x, If[LessEqual[a, 930.0], N[(z * y), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+18}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq -1.28 \cdot 10^{-54}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -7 \cdot 10^{-198}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-302}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-100}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 930:\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -3e18Initial program 87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
associate-+r+87.8%
*-commutative87.8%
associate-*l*82.3%
*-commutative82.3%
distribute-lft-out86.4%
fma-def88.4%
fma-def88.4%
+-commutative88.4%
fma-def88.4%
Simplified88.4%
Taylor expanded in y around 0 92.1%
Taylor expanded in t around 0 62.1%
Taylor expanded in a around inf 58.2%
Taylor expanded in b around 0 58.2%
associate-*r*52.6%
*-commutative52.6%
associate-*r*62.0%
Simplified62.0%
if -3e18 < a < -1.2800000000000001e-54 or 930 < a Initial program 85.8%
associate-+l+85.8%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in t around inf 48.2%
if -1.2800000000000001e-54 < a < -7.0000000000000005e-198 or -1.59999999999999989e-302 < a < 3.5000000000000001e-100Initial program 99.9%
associate-+l+99.9%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in x around inf 48.0%
if -7.0000000000000005e-198 < a < -1.59999999999999989e-302 or 3.5000000000000001e-100 < a < 930Initial program 99.9%
associate-+l+99.9%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in y around inf 50.7%
*-commutative50.7%
Simplified50.7%
Final simplification51.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))) (t_2 (* a (+ t (* z b)))))
(if (<= a -7e-21)
t_2
(if (<= a 3.4)
t_1
(if (<= a 9.8e+33) (+ x (* a t)) (if (<= a 1.6e+55) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -7e-21) {
tmp = t_2;
} else if (a <= 3.4) {
tmp = t_1;
} else if (a <= 9.8e+33) {
tmp = x + (a * t);
} else if (a <= 1.6e+55) {
tmp = 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 = x + (z * y)
t_2 = a * (t + (z * b))
if (a <= (-7d-21)) then
tmp = t_2
else if (a <= 3.4d0) then
tmp = t_1
else if (a <= 9.8d+33) then
tmp = x + (a * t)
else if (a <= 1.6d+55) then
tmp = 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 = x + (z * y);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -7e-21) {
tmp = t_2;
} else if (a <= 3.4) {
tmp = t_1;
} else if (a <= 9.8e+33) {
tmp = x + (a * t);
} else if (a <= 1.6e+55) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) t_2 = a * (t + (z * b)) tmp = 0 if a <= -7e-21: tmp = t_2 elif a <= 3.4: tmp = t_1 elif a <= 9.8e+33: tmp = x + (a * t) elif a <= 1.6e+55: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -7e-21) tmp = t_2; elseif (a <= 3.4) tmp = t_1; elseif (a <= 9.8e+33) tmp = Float64(x + Float64(a * t)); elseif (a <= 1.6e+55) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -7e-21) tmp = t_2; elseif (a <= 3.4) tmp = t_1; elseif (a <= 9.8e+33) tmp = x + (a * t); elseif (a <= 1.6e+55) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7e-21], t$95$2, If[LessEqual[a, 3.4], t$95$1, If[LessEqual[a, 9.8e+33], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+55], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -7 \cdot 10^{-21}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.8 \cdot 10^{+33}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -7.0000000000000007e-21 or 1.6000000000000001e55 < a Initial program 85.3%
associate-+l+85.3%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 83.6%
if -7.0000000000000007e-21 < a < 3.39999999999999991 or 9.80000000000000027e33 < a < 1.6000000000000001e55Initial program 98.7%
associate-+l+98.7%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 76.7%
if 3.39999999999999991 < a < 9.80000000000000027e33Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 82.8%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.4e-23) (not (<= b 6e+84))) (+ x (* a (+ t (* z b)))) (+ (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.4e-23) || !(b <= 6e+84)) {
tmp = x + (a * (t + (z * b)));
} 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 <= (-5.4d-23)) .or. (.not. (b <= 6d+84))) then
tmp = x + (a * (t + (z * b)))
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 <= -5.4e-23) || !(b <= 6e+84)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (a * t)) + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.4e-23) or not (b <= 6e+84): tmp = x + (a * (t + (z * b))) else: tmp = (x + (a * t)) + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.4e-23) || !(b <= 6e+84)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + 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 <= -5.4e-23) || ~((b <= 6e+84))) tmp = x + (a * (t + (z * b))); else tmp = (x + (a * t)) + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.4e-23], N[Not[LessEqual[b, 6e+84]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.4 \cdot 10^{-23} \lor \neg \left(b \leq 6 \cdot 10^{+84}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\end{array}
\end{array}
if b < -5.3999999999999997e-23 or 5.99999999999999992e84 < b Initial program 93.6%
associate-+l+93.7%
+-commutative93.7%
*-commutative93.7%
associate-*l*90.8%
distribute-lft-out91.7%
fma-def91.7%
+-commutative91.7%
fma-def91.8%
Simplified91.8%
Taylor expanded in y around 0 86.6%
if -5.3999999999999997e-23 < b < 5.99999999999999992e84Initial program 93.3%
associate-+l+93.3%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in b around 0 95.4%
Final simplification91.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.7e+150) (+ (* a t) (* z y)) (if (<= y 8e+131) (+ x (* a (+ t (* z b)))) (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.7e+150) {
tmp = (a * t) + (z * y);
} else if (y <= 8e+131) {
tmp = x + (a * (t + (z * b)));
} 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 (y <= (-1.7d+150)) then
tmp = (a * t) + (z * y)
else if (y <= 8d+131) then
tmp = x + (a * (t + (z * b)))
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 (y <= -1.7e+150) {
tmp = (a * t) + (z * y);
} else if (y <= 8e+131) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.7e+150: tmp = (a * t) + (z * y) elif y <= 8e+131: tmp = x + (a * (t + (z * b))) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.7e+150) tmp = Float64(Float64(a * t) + Float64(z * y)); elseif (y <= 8e+131) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); 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 (y <= -1.7e+150) tmp = (a * t) + (z * y); elseif (y <= 8e+131) tmp = x + (a * (t + (z * b))); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.7e+150], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+131], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+150}:\\
\;\;\;\;a \cdot t + z \cdot y\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+131}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if y < -1.69999999999999991e150Initial program 95.9%
associate-+l+95.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in b around 0 85.9%
Taylor expanded in x around 0 78.8%
if -1.69999999999999991e150 < y < 7.9999999999999993e131Initial program 93.0%
associate-+l+93.0%
+-commutative93.0%
*-commutative93.0%
associate-*l*96.3%
distribute-lft-out96.9%
fma-def96.9%
+-commutative96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in y around 0 86.6%
if 7.9999999999999993e131 < y Initial program 94.6%
associate-+l+94.6%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in z around inf 82.4%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.8e-120) (not (<= z 5.6e-11))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-120) || !(z <= 5.6e-11)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.8d-120)) .or. (.not. (z <= 5.6d-11))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-120) || !(z <= 5.6e-11)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.8e-120) or not (z <= 5.6e-11): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.8e-120) || !(z <= 5.6e-11)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.8e-120) || ~((z <= 5.6e-11))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.8e-120], N[Not[LessEqual[z, 5.6e-11]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-120} \lor \neg \left(z \leq 5.6 \cdot 10^{-11}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1.8000000000000001e-120 or 5.6e-11 < z Initial program 89.8%
associate-+l+89.8%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in z around inf 67.4%
if -1.8000000000000001e-120 < z < 5.6e-11Initial program 97.7%
associate-+l+97.7%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 77.7%
Final simplification72.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.4e+149) (* z y) (if (<= y 7.2e+142) (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.4e+149) {
tmp = z * y;
} else if (y <= 7.2e+142) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-7.4d+149)) then
tmp = z * y
else if (y <= 7.2d+142) then
tmp = x + (a * t)
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.4e+149) {
tmp = z * y;
} else if (y <= 7.2e+142) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.4e+149: tmp = z * y elif y <= 7.2e+142: tmp = x + (a * t) else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.4e+149) tmp = Float64(z * y); elseif (y <= 7.2e+142) tmp = Float64(x + Float64(a * t)); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.4e+149) tmp = z * y; elseif (y <= 7.2e+142) tmp = x + (a * t); else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.4e+149], N[(z * y), $MachinePrecision], If[LessEqual[y, 7.2e+142], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+149}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+142}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -7.39999999999999957e149 or 7.2000000000000003e142 < y Initial program 94.8%
associate-+l+94.8%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
Simplified66.9%
if -7.39999999999999957e149 < y < 7.2000000000000003e142Initial program 93.1%
associate-+l+93.1%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in z around 0 64.5%
Final simplification65.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.5e+18) (* b (* z a)) (if (<= a 0.35) (+ x (* z y)) (+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.5e+18) {
tmp = b * (z * a);
} else if (a <= 0.35) {
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 <= (-3.5d+18)) then
tmp = b * (z * a)
else if (a <= 0.35d0) 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 <= -3.5e+18) {
tmp = b * (z * a);
} else if (a <= 0.35) {
tmp = x + (z * y);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.5e+18: tmp = b * (z * a) elif a <= 0.35: tmp = x + (z * y) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.5e+18) tmp = Float64(b * Float64(z * a)); elseif (a <= 0.35) 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 <= -3.5e+18) tmp = b * (z * a); elseif (a <= 0.35) tmp = x + (z * y); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.5e+18], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.35], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+18}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq 0.35:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if a < -3.5e18Initial program 87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
associate-+r+87.8%
*-commutative87.8%
associate-*l*82.3%
*-commutative82.3%
distribute-lft-out86.4%
fma-def88.4%
fma-def88.4%
+-commutative88.4%
fma-def88.4%
Simplified88.4%
Taylor expanded in y around 0 92.1%
Taylor expanded in t around 0 62.1%
Taylor expanded in a around inf 58.2%
Taylor expanded in b around 0 58.2%
associate-*r*52.6%
*-commutative52.6%
associate-*r*62.0%
Simplified62.0%
if -3.5e18 < a < 0.34999999999999998Initial program 98.7%
associate-+l+98.7%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 74.3%
if 0.34999999999999998 < a Initial program 85.4%
associate-+l+85.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in z around 0 65.5%
Final simplification69.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5.8e+32) (* a t) (if (<= t 0.059) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.8e+32) {
tmp = a * t;
} else if (t <= 0.059) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-5.8d+32)) then
tmp = a * t
else if (t <= 0.059d0) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.8e+32) {
tmp = a * t;
} else if (t <= 0.059) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5.8e+32: tmp = a * t elif t <= 0.059: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5.8e+32) tmp = Float64(a * t); elseif (t <= 0.059) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5.8e+32) tmp = a * t; elseif (t <= 0.059) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.8e+32], N[(a * t), $MachinePrecision], If[LessEqual[t, 0.059], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+32}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq 0.059:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -5.80000000000000006e32 or 0.058999999999999997 < t Initial program 94.3%
associate-+l+94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in t around inf 54.8%
if -5.80000000000000006e32 < t < 0.058999999999999997Initial program 92.7%
associate-+l+92.7%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 36.9%
Final simplification45.5%
(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.5%
associate-+l+93.5%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in x around inf 26.2%
Final simplification26.2%
(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 2023215
(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)))