
(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 15 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 2.2e+166) (+ (fma y z x) (* a (+ t (* z b)))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.2e+166) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.2e+166) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.2e+166], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.2 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 2.1999999999999999e166Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
fma-define96.2%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
distribute-rgt-out97.6%
remove-double-neg97.6%
*-commutative97.6%
distribute-lft-neg-out97.6%
sub-neg97.6%
sub-neg97.6%
distribute-lft-neg-out97.6%
*-commutative97.6%
remove-double-neg97.6%
*-commutative97.6%
Simplified97.6%
if 2.1999999999999999e166 < z Initial program 77.6%
associate-+l+77.6%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
+-commutative77.9%
associate-*r*88.7%
distribute-rgt-in97.8%
Simplified97.8%
Final simplification97.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -1.25e+82)
(* a t)
(if (<= a -2.5e-83)
t_1
(if (<= a -4.2e-158)
x
(if (<= a 3.9e-96)
(* z y)
(if (<= a 140000000000.0)
x
(if (or (<= a 1.95e+129) (not (<= a 1.9e+220)))
t_1
(* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -1.25e+82) {
tmp = a * t;
} else if (a <= -2.5e-83) {
tmp = t_1;
} else if (a <= -4.2e-158) {
tmp = x;
} else if (a <= 3.9e-96) {
tmp = z * y;
} else if (a <= 140000000000.0) {
tmp = x;
} else if ((a <= 1.95e+129) || !(a <= 1.9e+220)) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-1.25d+82)) then
tmp = a * t
else if (a <= (-2.5d-83)) then
tmp = t_1
else if (a <= (-4.2d-158)) then
tmp = x
else if (a <= 3.9d-96) then
tmp = z * y
else if (a <= 140000000000.0d0) then
tmp = x
else if ((a <= 1.95d+129) .or. (.not. (a <= 1.9d+220))) then
tmp = t_1
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -1.25e+82) {
tmp = a * t;
} else if (a <= -2.5e-83) {
tmp = t_1;
} else if (a <= -4.2e-158) {
tmp = x;
} else if (a <= 3.9e-96) {
tmp = z * y;
} else if (a <= 140000000000.0) {
tmp = x;
} else if ((a <= 1.95e+129) || !(a <= 1.9e+220)) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -1.25e+82: tmp = a * t elif a <= -2.5e-83: tmp = t_1 elif a <= -4.2e-158: tmp = x elif a <= 3.9e-96: tmp = z * y elif a <= 140000000000.0: tmp = x elif (a <= 1.95e+129) or not (a <= 1.9e+220): tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -1.25e+82) tmp = Float64(a * t); elseif (a <= -2.5e-83) tmp = t_1; elseif (a <= -4.2e-158) tmp = x; elseif (a <= 3.9e-96) tmp = Float64(z * y); elseif (a <= 140000000000.0) tmp = x; elseif ((a <= 1.95e+129) || !(a <= 1.9e+220)) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -1.25e+82) tmp = a * t; elseif (a <= -2.5e-83) tmp = t_1; elseif (a <= -4.2e-158) tmp = x; elseif (a <= 3.9e-96) tmp = z * y; elseif (a <= 140000000000.0) tmp = x; elseif ((a <= 1.95e+129) || ~((a <= 1.9e+220))) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.25e+82], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.5e-83], t$95$1, If[LessEqual[a, -4.2e-158], x, If[LessEqual[a, 3.9e-96], N[(z * y), $MachinePrecision], If[LessEqual[a, 140000000000.0], x, If[Or[LessEqual[a, 1.95e+129], N[Not[LessEqual[a, 1.9e+220]], $MachinePrecision]], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -1.25 \cdot 10^{+82}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-158}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{-96}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 140000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+129} \lor \neg \left(a \leq 1.9 \cdot 10^{+220}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.25000000000000004e82 or 1.9499999999999999e129 < a < 1.89999999999999992e220Initial program 92.1%
associate-+l+92.1%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in t around inf 61.2%
if -1.25000000000000004e82 < a < -2.5e-83 or 1.4e11 < a < 1.9499999999999999e129 or 1.89999999999999992e220 < a Initial program 85.2%
associate-+l+85.2%
associate-*l*92.6%
Simplified92.6%
fma-define92.6%
Applied egg-rr92.6%
Taylor expanded in b around inf 50.8%
if -2.5e-83 < a < -4.19999999999999983e-158 or 3.8999999999999998e-96 < a < 1.4e11Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 47.9%
if -4.19999999999999983e-158 < a < 3.8999999999999998e-96Initial program 98.8%
associate-+l+98.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 58.9%
*-commutative58.9%
Simplified58.9%
Final simplification55.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= a -2.85e+81)
(* a t)
(if (<= a -3.7e-83)
t_1
(if (<= a -6.4e-158)
x
(if (<= a 3.15e-96) (* z y) (if (<= a 2.35e+17) x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (a <= -2.85e+81) {
tmp = a * t;
} else if (a <= -3.7e-83) {
tmp = t_1;
} else if (a <= -6.4e-158) {
tmp = x;
} else if (a <= 3.15e-96) {
tmp = z * y;
} else if (a <= 2.35e+17) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (a <= (-2.85d+81)) then
tmp = a * t
else if (a <= (-3.7d-83)) then
tmp = t_1
else if (a <= (-6.4d-158)) then
tmp = x
else if (a <= 3.15d-96) then
tmp = z * y
else if (a <= 2.35d+17) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (a <= -2.85e+81) {
tmp = a * t;
} else if (a <= -3.7e-83) {
tmp = t_1;
} else if (a <= -6.4e-158) {
tmp = x;
} else if (a <= 3.15e-96) {
tmp = z * y;
} else if (a <= 2.35e+17) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if a <= -2.85e+81: tmp = a * t elif a <= -3.7e-83: tmp = t_1 elif a <= -6.4e-158: tmp = x elif a <= 3.15e-96: tmp = z * y elif a <= 2.35e+17: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (a <= -2.85e+81) tmp = Float64(a * t); elseif (a <= -3.7e-83) tmp = t_1; elseif (a <= -6.4e-158) tmp = x; elseif (a <= 3.15e-96) tmp = Float64(z * y); elseif (a <= 2.35e+17) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (a <= -2.85e+81) tmp = a * t; elseif (a <= -3.7e-83) tmp = t_1; elseif (a <= -6.4e-158) tmp = x; elseif (a <= 3.15e-96) tmp = z * y; elseif (a <= 2.35e+17) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.85e+81], N[(a * t), $MachinePrecision], If[LessEqual[a, -3.7e-83], t$95$1, If[LessEqual[a, -6.4e-158], x, If[LessEqual[a, 3.15e-96], N[(z * y), $MachinePrecision], If[LessEqual[a, 2.35e+17], x, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -2.85 \cdot 10^{+81}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -3.7 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -6.4 \cdot 10^{-158}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.15 \cdot 10^{-96}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.85000000000000017e81Initial program 90.2%
associate-+l+90.2%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in t around inf 61.7%
if -2.85000000000000017e81 < a < -3.69999999999999995e-83 or 2.35e17 < a Initial program 87.1%
associate-+l+87.1%
associate-*l*93.6%
Simplified93.6%
fma-define93.6%
Applied egg-rr93.6%
Taylor expanded in b around inf 46.7%
associate-*r*48.6%
*-commutative48.6%
Simplified48.6%
if -3.69999999999999995e-83 < a < -6.39999999999999993e-158 or 3.1499999999999998e-96 < a < 2.35e17Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 47.9%
if -6.39999999999999993e-158 < a < 3.1499999999999998e-96Initial program 98.8%
associate-+l+98.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 58.9%
*-commutative58.9%
Simplified58.9%
Final simplification54.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))) (t_2 (+ x (* a t))))
(if (<= a -1.8e+87)
t_2
(if (<= a 3.5e+67)
t_1
(if (<= a 2.3e+102)
(* a (* z b))
(if (<= a 2.2e+130) t_1 (if (<= a 1.28e+219) t_2 (* z (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = x + (a * t);
double tmp;
if (a <= -1.8e+87) {
tmp = t_2;
} else if (a <= 3.5e+67) {
tmp = t_1;
} else if (a <= 2.3e+102) {
tmp = a * (z * b);
} else if (a <= 2.2e+130) {
tmp = t_1;
} else if (a <= 1.28e+219) {
tmp = t_2;
} else {
tmp = z * (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) :: t_2
real(8) :: tmp
t_1 = x + (z * y)
t_2 = x + (a * t)
if (a <= (-1.8d+87)) then
tmp = t_2
else if (a <= 3.5d+67) then
tmp = t_1
else if (a <= 2.3d+102) then
tmp = a * (z * b)
else if (a <= 2.2d+130) then
tmp = t_1
else if (a <= 1.28d+219) then
tmp = t_2
else
tmp = z * (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 + (z * y);
double t_2 = x + (a * t);
double tmp;
if (a <= -1.8e+87) {
tmp = t_2;
} else if (a <= 3.5e+67) {
tmp = t_1;
} else if (a <= 2.3e+102) {
tmp = a * (z * b);
} else if (a <= 2.2e+130) {
tmp = t_1;
} else if (a <= 1.28e+219) {
tmp = t_2;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) t_2 = x + (a * t) tmp = 0 if a <= -1.8e+87: tmp = t_2 elif a <= 3.5e+67: tmp = t_1 elif a <= 2.3e+102: tmp = a * (z * b) elif a <= 2.2e+130: tmp = t_1 elif a <= 1.28e+219: tmp = t_2 else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) t_2 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -1.8e+87) tmp = t_2; elseif (a <= 3.5e+67) tmp = t_1; elseif (a <= 2.3e+102) tmp = Float64(a * Float64(z * b)); elseif (a <= 2.2e+130) tmp = t_1; elseif (a <= 1.28e+219) tmp = t_2; else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); t_2 = x + (a * t); tmp = 0.0; if (a <= -1.8e+87) tmp = t_2; elseif (a <= 3.5e+67) tmp = t_1; elseif (a <= 2.3e+102) tmp = a * (z * b); elseif (a <= 2.2e+130) tmp = t_1; elseif (a <= 1.28e+219) tmp = t_2; else tmp = z * (a * b); 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[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.8e+87], t$95$2, If[LessEqual[a, 3.5e+67], t$95$1, If[LessEqual[a, 2.3e+102], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.2e+130], t$95$1, If[LessEqual[a, 1.28e+219], t$95$2, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := x + a \cdot t\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+102}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{+130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.28 \cdot 10^{+219}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.79999999999999997e87 or 2.19999999999999993e130 < a < 1.27999999999999995e219Initial program 93.4%
associate-+l+93.4%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in z around 0 67.6%
+-commutative67.6%
Simplified67.6%
if -1.79999999999999997e87 < a < 3.5e67 or 2.2999999999999999e102 < a < 2.19999999999999993e130Initial program 95.1%
associate-+l+95.1%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in a around 0 72.6%
if 3.5e67 < a < 2.2999999999999999e102Initial program 90.6%
associate-+l+90.6%
associate-*l*99.8%
Simplified99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in b around inf 71.3%
if 1.27999999999999995e219 < a Initial program 76.8%
associate-+l+76.8%
associate-*l*90.4%
Simplified90.4%
fma-define90.4%
Applied egg-rr90.4%
Taylor expanded in b around inf 67.6%
associate-*r*71.9%
*-commutative71.9%
Simplified71.9%
Final simplification71.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z (+ y (* a b))))) (t_2 (+ x (* a (+ t (* z b))))))
(if (<= a -1.05e+86)
t_2
(if (<= a -1.25e-109)
t_1
(if (<= a 1.2e+27)
(+ x (+ (* z y) (* a t)))
(if (<= a 9e+128) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * (y + (a * b)));
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -1.05e+86) {
tmp = t_2;
} else if (a <= -1.25e-109) {
tmp = t_1;
} else if (a <= 1.2e+27) {
tmp = x + ((z * y) + (a * t));
} else if (a <= 9e+128) {
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 + (a * b)))
t_2 = x + (a * (t + (z * b)))
if (a <= (-1.05d+86)) then
tmp = t_2
else if (a <= (-1.25d-109)) then
tmp = t_1
else if (a <= 1.2d+27) then
tmp = x + ((z * y) + (a * t))
else if (a <= 9d+128) 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 + (a * b)));
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -1.05e+86) {
tmp = t_2;
} else if (a <= -1.25e-109) {
tmp = t_1;
} else if (a <= 1.2e+27) {
tmp = x + ((z * y) + (a * t));
} else if (a <= 9e+128) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * (y + (a * b))) t_2 = x + (a * (t + (z * b))) tmp = 0 if a <= -1.05e+86: tmp = t_2 elif a <= -1.25e-109: tmp = t_1 elif a <= 1.2e+27: tmp = x + ((z * y) + (a * t)) elif a <= 9e+128: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -1.05e+86) tmp = t_2; elseif (a <= -1.25e-109) tmp = t_1; elseif (a <= 1.2e+27) tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); elseif (a <= 9e+128) 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 + (a * b))); t_2 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -1.05e+86) tmp = t_2; elseif (a <= -1.25e-109) tmp = t_1; elseif (a <= 1.2e+27) tmp = x + ((z * y) + (a * t)); elseif (a <= 9e+128) 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 * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05e+86], t$95$2, If[LessEqual[a, -1.25e-109], t$95$1, If[LessEqual[a, 1.2e+27], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(y + a \cdot b\right)\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{+86}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+27}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -1.0499999999999999e86 or 9.0000000000000003e128 < a Initial program 89.2%
associate-+l+89.2%
+-commutative89.2%
fma-define89.2%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
distribute-rgt-out97.5%
remove-double-neg97.5%
*-commutative97.5%
distribute-lft-neg-out97.5%
sub-neg97.5%
sub-neg97.5%
distribute-lft-neg-out97.5%
*-commutative97.5%
remove-double-neg97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in y around 0 97.8%
if -1.0499999999999999e86 < a < -1.25000000000000005e-109 or 1.19999999999999999e27 < a < 9.0000000000000003e128Initial program 88.0%
associate-+l+88.0%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in t around 0 82.7%
+-commutative82.7%
+-commutative82.7%
associate-*r*82.6%
distribute-rgt-in88.5%
Simplified88.5%
if -1.25000000000000005e-109 < a < 1.19999999999999999e27Initial program 99.1%
associate-+l+99.1%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in b around 0 93.8%
Final simplification93.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z (+ y (* a b))))) (t_2 (* a (+ t (* z b)))))
(if (<= a -5e+90)
(+ (* z y) t_2)
(if (<= a -1.55e-109)
t_1
(if (<= a 1.85e+25)
(+ x (+ (* z y) (* a t)))
(if (<= a 1.1e+129) t_1 (+ x t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * (y + (a * b)));
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -5e+90) {
tmp = (z * y) + t_2;
} else if (a <= -1.55e-109) {
tmp = t_1;
} else if (a <= 1.85e+25) {
tmp = x + ((z * y) + (a * t));
} else if (a <= 1.1e+129) {
tmp = t_1;
} else {
tmp = x + 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 + (a * b)))
t_2 = a * (t + (z * b))
if (a <= (-5d+90)) then
tmp = (z * y) + t_2
else if (a <= (-1.55d-109)) then
tmp = t_1
else if (a <= 1.85d+25) then
tmp = x + ((z * y) + (a * t))
else if (a <= 1.1d+129) then
tmp = t_1
else
tmp = x + 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 + (a * b)));
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -5e+90) {
tmp = (z * y) + t_2;
} else if (a <= -1.55e-109) {
tmp = t_1;
} else if (a <= 1.85e+25) {
tmp = x + ((z * y) + (a * t));
} else if (a <= 1.1e+129) {
tmp = t_1;
} else {
tmp = x + t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * (y + (a * b))) t_2 = a * (t + (z * b)) tmp = 0 if a <= -5e+90: tmp = (z * y) + t_2 elif a <= -1.55e-109: tmp = t_1 elif a <= 1.85e+25: tmp = x + ((z * y) + (a * t)) elif a <= 1.1e+129: tmp = t_1 else: tmp = x + t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -5e+90) tmp = Float64(Float64(z * y) + t_2); elseif (a <= -1.55e-109) tmp = t_1; elseif (a <= 1.85e+25) tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); elseif (a <= 1.1e+129) tmp = t_1; else tmp = Float64(x + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * (y + (a * b))); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -5e+90) tmp = (z * y) + t_2; elseif (a <= -1.55e-109) tmp = t_1; elseif (a <= 1.85e+25) tmp = x + ((z * y) + (a * t)); elseif (a <= 1.1e+129) tmp = t_1; else tmp = x + t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5e+90], N[(N[(z * y), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[a, -1.55e-109], t$95$1, If[LessEqual[a, 1.85e+25], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.1e+129], t$95$1, N[(x + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(y + a \cdot b\right)\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -5 \cdot 10^{+90}:\\
\;\;\;\;z \cdot y + t_2\\
\mathbf{elif}\;a \leq -1.55 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+25}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t_2\\
\end{array}
\end{array}
if a < -5.0000000000000004e90Initial program 92.0%
associate-+l+92.0%
+-commutative92.0%
fma-define92.0%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
distribute-rgt-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
remove-double-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 98.2%
if -5.0000000000000004e90 < a < -1.55e-109 or 1.8499999999999999e25 < a < 1.1e129Initial program 88.0%
associate-+l+88.0%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in t around 0 82.7%
+-commutative82.7%
+-commutative82.7%
associate-*r*82.6%
distribute-rgt-in88.5%
Simplified88.5%
if -1.55e-109 < a < 1.8499999999999999e25Initial program 99.1%
associate-+l+99.1%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in b around 0 93.8%
if 1.1e129 < a Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
fma-define84.8%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
distribute-rgt-out93.7%
remove-double-neg93.7%
*-commutative93.7%
distribute-lft-neg-out93.7%
sub-neg93.7%
sub-neg93.7%
distribute-lft-neg-out93.7%
*-commutative93.7%
remove-double-neg93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in y around 0 100.0%
Final simplification94.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= a -3.8e+92)
(* a t)
(if (<= a 3.2e+69)
t_1
(if (<= a 5.2e+103)
(* a (* z b))
(if (<= a 1.1e+150) t_1 (* z (* a 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 <= -3.8e+92) {
tmp = a * t;
} else if (a <= 3.2e+69) {
tmp = t_1;
} else if (a <= 5.2e+103) {
tmp = a * (z * b);
} else if (a <= 1.1e+150) {
tmp = t_1;
} else {
tmp = z * (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 + (z * y)
if (a <= (-3.8d+92)) then
tmp = a * t
else if (a <= 3.2d+69) then
tmp = t_1
else if (a <= 5.2d+103) then
tmp = a * (z * b)
else if (a <= 1.1d+150) then
tmp = t_1
else
tmp = z * (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 + (z * y);
double tmp;
if (a <= -3.8e+92) {
tmp = a * t;
} else if (a <= 3.2e+69) {
tmp = t_1;
} else if (a <= 5.2e+103) {
tmp = a * (z * b);
} else if (a <= 1.1e+150) {
tmp = t_1;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) tmp = 0 if a <= -3.8e+92: tmp = a * t elif a <= 3.2e+69: tmp = t_1 elif a <= 5.2e+103: tmp = a * (z * b) elif a <= 1.1e+150: tmp = t_1 else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) tmp = 0.0 if (a <= -3.8e+92) tmp = Float64(a * t); elseif (a <= 3.2e+69) tmp = t_1; elseif (a <= 5.2e+103) tmp = Float64(a * Float64(z * b)); elseif (a <= 1.1e+150) tmp = t_1; else tmp = Float64(z * Float64(a * 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 <= -3.8e+92) tmp = a * t; elseif (a <= 3.2e+69) tmp = t_1; elseif (a <= 5.2e+103) tmp = a * (z * b); elseif (a <= 1.1e+150) tmp = t_1; else tmp = z * (a * 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[a, -3.8e+92], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.2e+69], t$95$1, If[LessEqual[a, 5.2e+103], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.1e+150], t$95$1, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;a \leq -3.8 \cdot 10^{+92}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+103}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -3.8e92Initial program 92.0%
associate-+l+92.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in t around inf 62.9%
if -3.8e92 < a < 3.19999999999999985e69 or 5.2000000000000003e103 < a < 1.1e150Initial program 95.1%
associate-+l+95.1%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in a around 0 72.0%
if 3.19999999999999985e69 < a < 5.2000000000000003e103Initial program 90.6%
associate-+l+90.6%
associate-*l*99.8%
Simplified99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in b around inf 71.3%
if 1.1e150 < a Initial program 83.2%
associate-+l+83.2%
associate-*l*93.0%
Simplified93.0%
fma-define93.0%
Applied egg-rr93.0%
Taylor expanded in b around inf 56.4%
associate-*r*62.8%
*-commutative62.8%
Simplified62.8%
Final simplification69.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -2.3e+88)
t_1
(if (<= a -3.9e-69)
(* z (+ y (* a b)))
(if (<= a 4.7e+14) (+ x (* z y)) 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 <= -2.3e+88) {
tmp = t_1;
} else if (a <= -3.9e-69) {
tmp = z * (y + (a * b));
} else if (a <= 4.7e+14) {
tmp = x + (z * y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-2.3d+88)) then
tmp = t_1
else if (a <= (-3.9d-69)) then
tmp = z * (y + (a * b))
else if (a <= 4.7d+14) then
tmp = x + (z * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -2.3e+88) {
tmp = t_1;
} else if (a <= -3.9e-69) {
tmp = z * (y + (a * b));
} else if (a <= 4.7e+14) {
tmp = x + (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -2.3e+88: tmp = t_1 elif a <= -3.9e-69: tmp = z * (y + (a * b)) elif a <= 4.7e+14: tmp = x + (z * y) 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 <= -2.3e+88) tmp = t_1; elseif (a <= -3.9e-69) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 4.7e+14) tmp = Float64(x + Float64(z * y)); 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 <= -2.3e+88) tmp = t_1; elseif (a <= -3.9e-69) tmp = z * (y + (a * b)); elseif (a <= 4.7e+14) tmp = x + (z * y); 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, -2.3e+88], t$95$1, If[LessEqual[a, -3.9e-69], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.7e+14], N[(x + N[(z * y), $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 -2.3 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -3.9 \cdot 10^{-69}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 4.7 \cdot 10^{+14}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.3000000000000002e88 or 4.7e14 < a Initial program 88.9%
associate-+l+88.9%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 83.2%
if -2.3000000000000002e88 < a < -3.89999999999999981e-69Initial program 84.8%
associate-+l+84.8%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in z around inf 69.1%
if -3.89999999999999981e-69 < a < 4.7e14Initial program 99.2%
associate-+l+99.2%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around 0 82.2%
Final simplification81.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z 6e+168) (+ (+ x (* z y)) (+ (* a t) (* a (* z b)))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e+168) {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 6d+168) then
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)))
else
tmp = x + (z * (y + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e+168) {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 6e+168: tmp = (x + (z * y)) + ((a * t) + (a * (z * b))) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 6e+168) tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 6e+168) tmp = (x + (z * y)) + ((a * t) + (a * (z * b))); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6e+168], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{+168}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 5.9999999999999996e168Initial program 96.2%
associate-+l+96.2%
associate-*l*97.1%
Simplified97.1%
if 5.9999999999999996e168 < z Initial program 77.6%
associate-+l+77.6%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
+-commutative77.9%
associate-*r*88.7%
distribute-rgt-in97.8%
Simplified97.8%
Final simplification97.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.8e-145) (not (<= a 5.2e-81))) (+ x (* a (+ t (* z b)))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.8e-145) || !(a <= 5.2e-81)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-3.8d-145)) .or. (.not. (a <= 5.2d-81))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.8e-145) || !(a <= 5.2e-81)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.8e-145) or not (a <= 5.2e-81): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.8e-145) || !(a <= 5.2e-81)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.8e-145) || ~((a <= 5.2e-81))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.8e-145], N[Not[LessEqual[a, 5.2e-81]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-145} \lor \neg \left(a \leq 5.2 \cdot 10^{-81}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -3.8000000000000002e-145 or 5.1999999999999998e-81 < a Initial program 90.1%
associate-+l+90.1%
+-commutative90.1%
fma-define90.1%
associate-*l*94.8%
*-commutative94.8%
*-commutative94.8%
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 87.3%
if -3.8000000000000002e-145 < a < 5.1999999999999998e-81Initial program 98.9%
associate-+l+98.9%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in a around 0 88.7%
Final simplification87.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.6e-68) (not (<= a 1.3e-38))) (+ x (* a (+ t (* z b)))) (+ x (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.6e-68) || !(a <= 1.3e-38)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((z * y) + (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.6d-68)) .or. (.not. (a <= 1.3d-38))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((z * y) + (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.6e-68) || !(a <= 1.3e-38)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.6e-68) or not (a <= 1.3e-38): tmp = x + (a * (t + (z * b))) else: tmp = x + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.6e-68) || !(a <= 1.3e-38)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.6e-68) || ~((a <= 1.3e-38))) tmp = x + (a * (t + (z * b))); else tmp = x + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.6e-68], N[Not[LessEqual[a, 1.3e-38]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{-68} \lor \neg \left(a \leq 1.3 \cdot 10^{-38}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if a < -3.60000000000000007e-68 or 1.30000000000000005e-38 < a Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-define88.5%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
distribute-rgt-out95.3%
remove-double-neg95.3%
*-commutative95.3%
distribute-lft-neg-out95.3%
sub-neg95.3%
sub-neg95.3%
distribute-lft-neg-out95.3%
*-commutative95.3%
remove-double-neg95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in y around 0 89.0%
if -3.60000000000000007e-68 < a < 1.30000000000000005e-38Initial program 99.2%
associate-+l+99.2%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in b around 0 92.1%
Final simplification90.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.2e+86) (* a t) (if (<= a 8.2e-95) (* z y) (if (<= a 1.32e+129) x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.2e+86) {
tmp = a * t;
} else if (a <= 8.2e-95) {
tmp = z * y;
} else if (a <= 1.32e+129) {
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 (a <= (-1.2d+86)) then
tmp = a * t
else if (a <= 8.2d-95) then
tmp = z * y
else if (a <= 1.32d+129) 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 (a <= -1.2e+86) {
tmp = a * t;
} else if (a <= 8.2e-95) {
tmp = z * y;
} else if (a <= 1.32e+129) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.2e+86: tmp = a * t elif a <= 8.2e-95: tmp = z * y elif a <= 1.32e+129: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.2e+86) tmp = Float64(a * t); elseif (a <= 8.2e-95) tmp = Float64(z * y); elseif (a <= 1.32e+129) 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 (a <= -1.2e+86) tmp = a * t; elseif (a <= 8.2e-95) tmp = z * y; elseif (a <= 1.32e+129) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.2e+86], N[(a * t), $MachinePrecision], If[LessEqual[a, 8.2e-95], N[(z * y), $MachinePrecision], If[LessEqual[a, 1.32e+129], x, N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+86}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-95}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 1.32 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.2e86 or 1.32e129 < a Initial program 89.2%
associate-+l+89.2%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in t around inf 57.1%
if -1.2e86 < a < 8.1999999999999995e-95Initial program 95.8%
associate-+l+95.8%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in y around inf 47.9%
*-commutative47.9%
Simplified47.9%
if 8.1999999999999995e-95 < a < 1.32e129Initial program 92.5%
associate-+l+92.5%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 32.7%
Final simplification47.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8e+38) (not (<= a 650000000000.0))) (* 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 <= -8e+38) || !(a <= 650000000000.0)) {
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 <= (-8d+38)) .or. (.not. (a <= 650000000000.0d0))) 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 <= -8e+38) || !(a <= 650000000000.0)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8e+38) or not (a <= 650000000000.0): 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 <= -8e+38) || !(a <= 650000000000.0)) 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 <= -8e+38) || ~((a <= 650000000000.0))) 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, -8e+38], N[Not[LessEqual[a, 650000000000.0]], $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 -8 \cdot 10^{+38} \lor \neg \left(a \leq 650000000000\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -7.99999999999999982e38 or 6.5e11 < a Initial program 87.4%
associate-+l+87.4%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around inf 81.4%
if -7.99999999999999982e38 < a < 6.5e11Initial program 98.4%
associate-+l+98.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in a around 0 77.4%
Final simplification79.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.8e+68) (not (<= a 9e+128))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.8e+68) || !(a <= 9e+128)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-4.8d+68)) .or. (.not. (a <= 9d+128))) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.8e+68) || !(a <= 9e+128)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.8e+68) or not (a <= 9e+128): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.8e+68) || !(a <= 9e+128)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.8e+68) || ~((a <= 9e+128))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.8e+68], N[Not[LessEqual[a, 9e+128]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{+68} \lor \neg \left(a \leq 9 \cdot 10^{+128}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.80000000000000016e68 or 9.0000000000000003e128 < a Initial program 87.8%
associate-+l+87.8%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in t around inf 53.9%
if -4.80000000000000016e68 < a < 9.0000000000000003e128Initial program 95.8%
associate-+l+95.8%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 32.8%
Final simplification40.1%
(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.0%
associate-+l+93.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around inf 23.8%
Final simplification23.8%
(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 2024026
(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)))