
(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 (or (<= z -2e+19) (not (<= z 4e-18))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2e+19) || !(z <= 4e-18)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = fma(y, z, x) + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2e+19) || !(z <= 4e-18)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2e+19], N[Not[LessEqual[z, 4e-18]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+19} \lor \neg \left(z \leq 4 \cdot 10^{-18}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -2e19 or 4.0000000000000003e-18 < z Initial program 81.4%
associate-+l+81.4%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in z around inf 98.4%
+-commutative98.4%
associate-+l+98.4%
+-commutative98.4%
associate-/l*99.1%
distribute-lft-out99.9%
Simplified99.9%
if -2e19 < z < 4.0000000000000003e-18Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
fma-define97.6%
associate-*l*99.1%
*-commutative99.1%
*-commutative99.1%
distribute-rgt-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-out99.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= y -1.8e+17)
(* z y)
(if (<= y -2.1e-228)
t_1
(if (<= y 4.8e-145) (* z (* a b)) (if (<= y 2.95e+237) t_1 (* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (y <= -1.8e+17) {
tmp = z * y;
} else if (y <= -2.1e-228) {
tmp = t_1;
} else if (y <= 4.8e-145) {
tmp = z * (a * b);
} else if (y <= 2.95e+237) {
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 = x + (a * t)
if (y <= (-1.8d+17)) then
tmp = z * y
else if (y <= (-2.1d-228)) then
tmp = t_1
else if (y <= 4.8d-145) then
tmp = z * (a * b)
else if (y <= 2.95d+237) 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 = x + (a * t);
double tmp;
if (y <= -1.8e+17) {
tmp = z * y;
} else if (y <= -2.1e-228) {
tmp = t_1;
} else if (y <= 4.8e-145) {
tmp = z * (a * b);
} else if (y <= 2.95e+237) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if y <= -1.8e+17: tmp = z * y elif y <= -2.1e-228: tmp = t_1 elif y <= 4.8e-145: tmp = z * (a * b) elif y <= 2.95e+237: tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (y <= -1.8e+17) tmp = Float64(z * y); elseif (y <= -2.1e-228) tmp = t_1; elseif (y <= 4.8e-145) tmp = Float64(z * Float64(a * b)); elseif (y <= 2.95e+237) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); tmp = 0.0; if (y <= -1.8e+17) tmp = z * y; elseif (y <= -2.1e-228) tmp = t_1; elseif (y <= 4.8e-145) tmp = z * (a * b); elseif (y <= 2.95e+237) tmp = t_1; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+17], N[(z * y), $MachinePrecision], If[LessEqual[y, -2.1e-228], t$95$1, If[LessEqual[y, 4.8e-145], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.95e+237], t$95$1, N[(z * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+17}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-145}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq 2.95 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -1.8e17 or 2.9499999999999999e237 < y Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-define88.5%
associate-*l*88.5%
*-commutative88.5%
*-commutative88.5%
distribute-rgt-out88.5%
remove-double-neg88.5%
*-commutative88.5%
distribute-lft-neg-out88.5%
sub-neg88.5%
sub-neg88.5%
distribute-lft-neg-out88.5%
*-commutative88.5%
remove-double-neg88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in t around inf 87.0%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
Taylor expanded in a around 0 70.3%
if -1.8e17 < y < -2.09999999999999991e-228 or 4.8000000000000003e-145 < y < 2.9499999999999999e237Initial program 91.1%
associate-+l+91.1%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in z around 0 61.9%
if -2.09999999999999991e-228 < y < 4.8000000000000003e-145Initial program 82.3%
associate-+l+82.3%
+-commutative82.3%
fma-define82.3%
associate-*l*82.8%
*-commutative82.8%
*-commutative82.8%
distribute-rgt-out85.9%
remove-double-neg85.9%
*-commutative85.9%
distribute-lft-neg-out85.9%
sub-neg85.9%
sub-neg85.9%
distribute-lft-neg-out85.9%
*-commutative85.9%
remove-double-neg85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in y around 0 85.9%
Taylor expanded in x around 0 73.9%
Taylor expanded in t around 0 53.4%
associate-*r*67.4%
*-commutative67.4%
Simplified67.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.8e+17) (not (<= z 3.6e-17))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ x (* z y)) (+ (* a (* z b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.8e+17) || !(z <= 3.6e-17)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (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 <= (-2.8d+17)) .or. (.not. (z <= 3.6d-17))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = (x + (z * y)) + ((a * (z * b)) + (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 <= -2.8e+17) || !(z <= 3.6e-17)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * (z * b)) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.8e+17) or not (z <= 3.6e-17): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.8e+17) || !(z <= 3.6e-17)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.8e+17) || ~((z <= 3.6e-17))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = (x + (z * y)) + ((a * (z * b)) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.8e+17], N[Not[LessEqual[z, 3.6e-17]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+17} \lor \neg \left(z \leq 3.6 \cdot 10^{-17}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < -2.8e17 or 3.59999999999999995e-17 < z Initial program 81.4%
associate-+l+81.4%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in z around inf 98.4%
+-commutative98.4%
associate-+l+98.4%
+-commutative98.4%
associate-/l*99.1%
distribute-lft-out99.9%
Simplified99.9%
if -2.8e17 < z < 3.59999999999999995e-17Initial program 97.6%
associate-+l+97.6%
associate-*l*99.1%
Simplified99.1%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.36e-48) (not (<= z 9.8e-73))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.36e-48) || !(z <= 9.8e-73)) {
tmp = z * (y + ((x / z) + (a * (b + (t / 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 ((z <= (-1.36d-48)) .or. (.not. (z <= 9.8d-73))) then
tmp = z * (y + ((x / z) + (a * (b + (t / 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 ((z <= -1.36e-48) || !(z <= 9.8e-73)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.36e-48) or not (z <= 9.8e-73): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.36e-48) || !(z <= 9.8e-73)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / 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 ((z <= -1.36e-48) || ~((z <= 9.8e-73))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.36e-48], N[Not[LessEqual[z, 9.8e-73]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -1.36 \cdot 10^{-48} \lor \neg \left(z \leq 9.8 \cdot 10^{-73}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if z < -1.36000000000000002e-48 or 9.80000000000000057e-73 < z Initial program 84.6%
associate-+l+84.6%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in z around inf 98.6%
+-commutative98.6%
associate-+l+98.6%
+-commutative98.6%
associate-/l*99.2%
distribute-lft-out99.8%
Simplified99.8%
if -1.36000000000000002e-48 < z < 9.80000000000000057e-73Initial program 96.9%
associate-+l+96.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in b around 0 93.7%
Final simplification97.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= b -3.65e+108)
t_1
(if (<= b 7.2e+31)
(+ x (+ (* a t) (* z y)))
(if (<= b 6.8e+96) t_1 (* z (+ y (* a b))))))))
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 (b <= -3.65e+108) {
tmp = t_1;
} else if (b <= 7.2e+31) {
tmp = x + ((a * t) + (z * y));
} else if (b <= 6.8e+96) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (a * (t + (z * b)))
if (b <= (-3.65d+108)) then
tmp = t_1
else if (b <= 7.2d+31) then
tmp = x + ((a * t) + (z * y))
else if (b <= 6.8d+96) then
tmp = t_1
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 t_1 = x + (a * (t + (z * b)));
double tmp;
if (b <= -3.65e+108) {
tmp = t_1;
} else if (b <= 7.2e+31) {
tmp = x + ((a * t) + (z * y));
} else if (b <= 6.8e+96) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if b <= -3.65e+108: tmp = t_1 elif b <= 7.2e+31: tmp = x + ((a * t) + (z * y)) elif b <= 6.8e+96: tmp = t_1 else: tmp = z * (y + (a * b)) 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 (b <= -3.65e+108) tmp = t_1; elseif (b <= 7.2e+31) tmp = Float64(x + Float64(Float64(a * t) + Float64(z * y))); elseif (b <= 6.8e+96) 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 = x + (a * (t + (z * b))); tmp = 0.0; if (b <= -3.65e+108) tmp = t_1; elseif (b <= 7.2e+31) tmp = x + ((a * t) + (z * y)); elseif (b <= 6.8e+96) 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[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.65e+108], t$95$1, If[LessEqual[b, 7.2e+31], N[(x + N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.8e+96], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;b \leq -3.65 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{+31}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -3.6499999999999999e108 or 7.19999999999999992e31 < b < 6.8000000000000002e96Initial program 85.7%
associate-+l+85.7%
+-commutative85.7%
fma-define85.7%
associate-*l*87.6%
*-commutative87.6%
*-commutative87.6%
distribute-rgt-out91.7%
remove-double-neg91.7%
*-commutative91.7%
distribute-lft-neg-out91.7%
sub-neg91.7%
sub-neg91.7%
distribute-lft-neg-out91.7%
*-commutative91.7%
remove-double-neg91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y around 0 92.6%
if -3.6499999999999999e108 < b < 7.19999999999999992e31Initial program 89.3%
associate-+l+89.3%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in b around 0 91.1%
if 6.8000000000000002e96 < b Initial program 92.3%
associate-+l+92.3%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in z around inf 78.0%
Final simplification88.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -95000000000.0)
(* z y)
(if (<= y -1.35e-174)
x
(if (<= y 5.3e-130) (* z (* a b)) (if (<= y 2.5e+148) (* a t) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -95000000000.0) {
tmp = z * y;
} else if (y <= -1.35e-174) {
tmp = x;
} else if (y <= 5.3e-130) {
tmp = z * (a * b);
} else if (y <= 2.5e+148) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-95000000000.0d0)) then
tmp = z * y
else if (y <= (-1.35d-174)) then
tmp = x
else if (y <= 5.3d-130) then
tmp = z * (a * b)
else if (y <= 2.5d+148) then
tmp = a * t
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -95000000000.0) {
tmp = z * y;
} else if (y <= -1.35e-174) {
tmp = x;
} else if (y <= 5.3e-130) {
tmp = z * (a * b);
} else if (y <= 2.5e+148) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -95000000000.0: tmp = z * y elif y <= -1.35e-174: tmp = x elif y <= 5.3e-130: tmp = z * (a * b) elif y <= 2.5e+148: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -95000000000.0) tmp = Float64(z * y); elseif (y <= -1.35e-174) tmp = x; elseif (y <= 5.3e-130) tmp = Float64(z * Float64(a * b)); elseif (y <= 2.5e+148) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -95000000000.0) tmp = z * y; elseif (y <= -1.35e-174) tmp = x; elseif (y <= 5.3e-130) tmp = z * (a * b); elseif (y <= 2.5e+148) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -95000000000.0], N[(z * y), $MachinePrecision], If[LessEqual[y, -1.35e-174], x, If[LessEqual[y, 5.3e-130], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+148], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -95000000000:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-174}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-130}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+148}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if y < -9.5e10 or 2.50000000000000012e148 < y Initial program 86.6%
associate-+l+86.6%
+-commutative86.6%
fma-define86.6%
associate-*l*87.5%
*-commutative87.5%
*-commutative87.5%
distribute-rgt-out87.5%
remove-double-neg87.5%
*-commutative87.5%
distribute-lft-neg-out87.5%
sub-neg87.5%
sub-neg87.5%
distribute-lft-neg-out87.5%
*-commutative87.5%
remove-double-neg87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in t around inf 86.5%
Taylor expanded in z around inf 70.0%
+-commutative70.0%
Simplified70.0%
Taylor expanded in a around 0 62.8%
if -9.5e10 < y < -1.34999999999999994e-174Initial program 92.9%
associate-+l+92.9%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in z around 0 67.6%
Taylor expanded in x around inf 37.5%
if -1.34999999999999994e-174 < y < 5.3000000000000004e-130Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
fma-define86.7%
associate-*l*87.1%
*-commutative87.1%
*-commutative87.1%
distribute-rgt-out89.4%
remove-double-neg89.4%
*-commutative89.4%
distribute-lft-neg-out89.4%
sub-neg89.4%
sub-neg89.4%
distribute-lft-neg-out89.4%
*-commutative89.4%
remove-double-neg89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y around 0 89.4%
Taylor expanded in x around 0 69.7%
Taylor expanded in t around 0 47.5%
associate-*r*58.1%
*-commutative58.1%
Simplified58.1%
if 5.3000000000000004e-130 < y < 2.50000000000000012e148Initial program 91.9%
associate-+l+91.9%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in b around 0 82.9%
Taylor expanded in a around inf 42.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.1e-47) (not (<= z 1.65e-51))) (* z (+ y (* a (+ b (/ t z))))) (+ x (+ (* a t) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.1e-47) || !(z <= 1.65e-51)) {
tmp = z * (y + (a * (b + (t / 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 ((z <= (-4.1d-47)) .or. (.not. (z <= 1.65d-51))) then
tmp = z * (y + (a * (b + (t / 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 ((z <= -4.1e-47) || !(z <= 1.65e-51)) {
tmp = z * (y + (a * (b + (t / z))));
} else {
tmp = x + ((a * t) + (z * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.1e-47) or not (z <= 1.65e-51): tmp = z * (y + (a * (b + (t / z)))) else: tmp = x + ((a * t) + (z * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.1e-47) || !(z <= 1.65e-51)) tmp = Float64(z * Float64(y + Float64(a * Float64(b + Float64(t / 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 ((z <= -4.1e-47) || ~((z <= 1.65e-51))) tmp = z * (y + (a * (b + (t / z)))); else tmp = x + ((a * t) + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.1e-47], N[Not[LessEqual[z, 1.65e-51]], $MachinePrecision]], N[(z * N[(y + N[(a * N[(b + N[(t / z), $MachinePrecision]), $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}\;z \leq -4.1 \cdot 10^{-47} \lor \neg \left(z \leq 1.65 \cdot 10^{-51}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot \left(b + \frac{t}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + z \cdot y\right)\\
\end{array}
\end{array}
if z < -4.10000000000000002e-47 or 1.64999999999999986e-51 < z Initial program 83.9%
Taylor expanded in x around 0 76.5%
Taylor expanded in z around inf 90.6%
+-commutative90.6%
associate-/l*91.2%
distribute-lft-out91.9%
Simplified91.9%
if -4.10000000000000002e-47 < z < 1.64999999999999986e-51Initial program 97.1%
associate-+l+97.1%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in b around 0 93.1%
Final simplification92.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.1e+17) (+ (* a t) (* z y)) (if (<= y 2.5e+146) (+ x (* a (+ t (* z b)))) (+ x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.1e+17) {
tmp = (a * t) + (z * y);
} else if (y <= 2.5e+146) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.1d+17)) then
tmp = (a * t) + (z * y)
else if (y <= 2.5d+146) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.1e+17) {
tmp = (a * t) + (z * y);
} else if (y <= 2.5e+146) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.1e+17: tmp = (a * t) + (z * y) elif y <= 2.5e+146: tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.1e+17) tmp = Float64(Float64(a * t) + Float64(z * y)); elseif (y <= 2.5e+146) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.1e+17) tmp = (a * t) + (z * y); elseif (y <= 2.5e+146) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.1e+17], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+146], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+17}:\\
\;\;\;\;a \cdot t + z \cdot y\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+146}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if y < -1.1e17Initial program 87.8%
Taylor expanded in x around 0 81.9%
Taylor expanded in b around 0 82.3%
if -1.1e17 < y < 2.4999999999999999e146Initial program 90.8%
associate-+l+90.8%
+-commutative90.8%
fma-define90.8%
associate-*l*93.3%
*-commutative93.3%
*-commutative93.3%
distribute-rgt-out95.9%
remove-double-neg95.9%
*-commutative95.9%
distribute-lft-neg-out95.9%
sub-neg95.9%
sub-neg95.9%
distribute-lft-neg-out95.9%
*-commutative95.9%
remove-double-neg95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in y around 0 85.3%
if 2.4999999999999999e146 < y Initial program 85.3%
associate-+l+85.3%
+-commutative85.3%
fma-define85.3%
associate-*l*87.2%
*-commutative87.2%
*-commutative87.2%
distribute-rgt-out87.2%
remove-double-neg87.2%
*-commutative87.2%
distribute-lft-neg-out87.2%
sub-neg87.2%
sub-neg87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
remove-double-neg87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 85.1%
Taylor expanded in a around 0 75.9%
Final simplification83.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8e-49) (not (<= z 7.2e-48))) (* 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 <= -8e-49) || !(z <= 7.2e-48)) {
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 <= (-8d-49)) .or. (.not. (z <= 7.2d-48))) 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 <= -8e-49) || !(z <= 7.2e-48)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8e-49) or not (z <= 7.2e-48): 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 <= -8e-49) || !(z <= 7.2e-48)) 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 <= -8e-49) || ~((z <= 7.2e-48))) 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, -8e-49], N[Not[LessEqual[z, 7.2e-48]], $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 -8 \cdot 10^{-49} \lor \neg \left(z \leq 7.2 \cdot 10^{-48}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -7.99999999999999949e-49 or 7.2000000000000003e-48 < z Initial program 83.8%
associate-+l+83.8%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in z around inf 76.0%
if -7.99999999999999949e-49 < z < 7.2000000000000003e-48Initial program 97.1%
associate-+l+97.1%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in z around 0 78.9%
Final simplification77.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.42e+78) (not (<= a 1.16e+108))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.42e+78) || !(a <= 1.16e+108)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.42d+78)) .or. (.not. (a <= 1.16d+108))) then
tmp = a * (t + (z * b))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.42e+78) || !(a <= 1.16e+108)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.42e+78) or not (a <= 1.16e+108): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.42e+78) || !(a <= 1.16e+108)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.42e+78) || ~((a <= 1.16e+108))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.42e+78], N[Not[LessEqual[a, 1.16e+108]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{+78} \lor \neg \left(a \leq 1.16 \cdot 10^{+108}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.42e78 or 1.15999999999999995e108 < a Initial program 75.6%
associate-+l+75.6%
+-commutative75.6%
fma-define75.6%
associate-*l*88.6%
*-commutative88.6%
*-commutative88.6%
distribute-rgt-out93.1%
remove-double-neg93.1%
*-commutative93.1%
distribute-lft-neg-out93.1%
sub-neg93.1%
sub-neg93.1%
distribute-lft-neg-out93.1%
*-commutative93.1%
remove-double-neg93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in y around 0 92.6%
Taylor expanded in x around 0 82.9%
if -1.42e78 < a < 1.15999999999999995e108Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
fma-define96.5%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
distribute-rgt-out92.5%
remove-double-neg92.5%
*-commutative92.5%
distribute-lft-neg-out92.5%
sub-neg92.5%
sub-neg92.5%
distribute-lft-neg-out92.5%
*-commutative92.5%
remove-double-neg92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in t around inf 86.2%
Taylor expanded in a around 0 70.5%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.2e-14) (not (<= a 2.3e+104))) (+ x (* a t)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.2e-14) || !(a <= 2.3e+104)) {
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 <= (-8.2d-14)) .or. (.not. (a <= 2.3d+104))) 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 <= -8.2e-14) || !(a <= 2.3e+104)) {
tmp = x + (a * t);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.2e-14) or not (a <= 2.3e+104): tmp = x + (a * t) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.2e-14) || !(a <= 2.3e+104)) 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 <= -8.2e-14) || ~((a <= 2.3e+104))) tmp = x + (a * t); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.2e-14], N[Not[LessEqual[a, 2.3e+104]], $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 -8.2 \cdot 10^{-14} \lor \neg \left(a \leq 2.3 \cdot 10^{+104}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -8.2000000000000004e-14 or 2.29999999999999985e104 < a Initial program 77.3%
associate-+l+77.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in z around 0 64.3%
if -8.2000000000000004e-14 < a < 2.29999999999999985e104Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
fma-define97.4%
associate-*l*92.4%
*-commutative92.4%
*-commutative92.4%
distribute-rgt-out92.4%
remove-double-neg92.4%
*-commutative92.4%
distribute-lft-neg-out92.4%
sub-neg92.4%
sub-neg92.4%
distribute-lft-neg-out92.4%
*-commutative92.4%
remove-double-neg92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in t around inf 86.1%
Taylor expanded in a around 0 71.8%
Final simplification68.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7.2e-20) (not (<= a 5.2e+24))) (* a t) (* z y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7.2e-20) || !(a <= 5.2e+24)) {
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 <= (-7.2d-20)) .or. (.not. (a <= 5.2d+24))) 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 <= -7.2e-20) || !(a <= 5.2e+24)) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7.2e-20) or not (a <= 5.2e+24): tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7.2e-20) || !(a <= 5.2e+24)) 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 <= -7.2e-20) || ~((a <= 5.2e+24))) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7.2e-20], N[Not[LessEqual[a, 5.2e+24]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-20} \lor \neg \left(a \leq 5.2 \cdot 10^{+24}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if a < -7.19999999999999948e-20 or 5.1999999999999997e24 < a Initial program 79.8%
associate-+l+79.8%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in b around 0 70.8%
Taylor expanded in a around inf 47.6%
if -7.19999999999999948e-20 < a < 5.1999999999999997e24Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
fma-define97.8%
associate-*l*92.2%
*-commutative92.2%
*-commutative92.2%
distribute-rgt-out92.2%
remove-double-neg92.2%
*-commutative92.2%
distribute-lft-neg-out92.2%
sub-neg92.2%
sub-neg92.2%
distribute-lft-neg-out92.2%
*-commutative92.2%
remove-double-neg92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 84.9%
Taylor expanded in z around inf 64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in a around 0 48.7%
Final simplification48.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.3e+158) x (if (<= x 180.0) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.3e+158) {
tmp = x;
} else if (x <= 180.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 (x <= (-4.3d+158)) then
tmp = x
else if (x <= 180.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 (x <= -4.3e+158) {
tmp = x;
} else if (x <= 180.0) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.3e+158: tmp = x elif x <= 180.0: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.3e+158) tmp = x; elseif (x <= 180.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 (x <= -4.3e+158) tmp = x; elseif (x <= 180.0) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.3e+158], x, If[LessEqual[x, 180.0], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{+158}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 180:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.3e158 or 180 < x Initial program 90.9%
associate-+l+90.9%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in z around 0 68.3%
Taylor expanded in x around inf 52.1%
if -4.3e158 < x < 180Initial program 88.4%
associate-+l+88.4%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in b around 0 75.2%
Taylor expanded in a around inf 33.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 89.2%
associate-+l+89.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in z around 0 49.0%
Taylor expanded in x around inf 22.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 2024172
(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)))