
(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 16 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 4.1e+173) (fma a (+ t (* z b)) (fma y z x)) (fma z (fma a b y) (fma t a x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4.1e+173) {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4.1e+173) tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); else tmp = fma(z, fma(a, b, y), fma(t, a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4.1e+173], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.1 \cdot 10^{+173}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\end{array}
if z < 4.09999999999999976e173Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
*-commutative91.3%
associate-*l*95.5%
distribute-lft-out97.8%
fma-def98.6%
+-commutative98.6%
fma-def98.6%
Simplified98.6%
if 4.09999999999999976e173 < z Initial program 82.8%
+-commutative82.8%
+-commutative82.8%
associate-+l+82.8%
associate-+r+82.8%
*-commutative82.8%
associate-*l*82.8%
*-commutative82.8%
distribute-lft-out93.1%
fma-def96.6%
fma-def96.6%
+-commutative96.6%
fma-def96.6%
Simplified96.6%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2.42e+129) (fma a (+ t (* z b)) (fma y z x)) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.42e+129) {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.42e+129) tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); 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.42e+129], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $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.42 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 2.41999999999999999e129Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
*-commutative91.3%
associate-*l*96.3%
distribute-lft-out98.1%
fma-def99.0%
+-commutative99.0%
fma-def99.0%
Simplified99.0%
if 2.41999999999999999e129 < z Initial program 84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
associate-+r+84.2%
*-commutative84.2%
associate-*l*84.2%
*-commutative84.2%
distribute-lft-out92.1%
fma-def94.7%
fma-def94.7%
+-commutative94.7%
fma-def94.7%
Simplified94.7%
Taylor expanded in t around 0 94.8%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= (+ (+ (* a t) t_1) (* b (* z a))) INFINITY)
(+ (+ (* a (* z b)) (* a t)) t_1)
(* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if ((((a * t) + t_1) + (b * (z * a))) <= ((double) INFINITY)) {
tmp = ((a * (z * b)) + (a * t)) + t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if ((((a * t) + t_1) + (b * (z * a))) <= Double.POSITIVE_INFINITY) {
tmp = ((a * (z * b)) + (a * t)) + t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) tmp = 0 if (((a * t) + t_1) + (b * (z * a))) <= math.inf: tmp = ((a * (z * b)) + (a * t)) + t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) tmp = 0.0 if (Float64(Float64(Float64(a * t) + t_1) + Float64(b * Float64(z * a))) <= Inf) tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(a * t)) + t_1); else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); tmp = 0.0; if ((((a * t) + t_1) + (b * (z * a))) <= Inf) tmp = ((a * (z * b)) + (a * t)) + t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(a * t), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;\left(a \cdot t + t_1\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 96.7%
associate-+l+96.7%
associate-*l*98.7%
Simplified98.7%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*17.6%
Simplified17.6%
Taylor expanded in a around inf 76.5%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))) (t_2 (* a (+ t (* z b)))))
(if (<= a -9e+55)
t_2
(if (<= a 1.7e-77)
t_1
(if (<= a 1.35e-62)
t_2
(if (<= a 4e-46) t_1 (if (<= a 3.8e+72) (+ (* a t) (* z y)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -9e+55) {
tmp = t_2;
} else if (a <= 1.7e-77) {
tmp = t_1;
} else if (a <= 1.35e-62) {
tmp = t_2;
} else if (a <= 4e-46) {
tmp = t_1;
} else if (a <= 3.8e+72) {
tmp = (a * t) + (z * y);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (z * y)
t_2 = a * (t + (z * b))
if (a <= (-9d+55)) then
tmp = t_2
else if (a <= 1.7d-77) then
tmp = t_1
else if (a <= 1.35d-62) then
tmp = t_2
else if (a <= 4d-46) then
tmp = t_1
else if (a <= 3.8d+72) then
tmp = (a * t) + (z * y)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -9e+55) {
tmp = t_2;
} else if (a <= 1.7e-77) {
tmp = t_1;
} else if (a <= 1.35e-62) {
tmp = t_2;
} else if (a <= 4e-46) {
tmp = t_1;
} else if (a <= 3.8e+72) {
tmp = (a * t) + (z * y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) t_2 = a * (t + (z * b)) tmp = 0 if a <= -9e+55: tmp = t_2 elif a <= 1.7e-77: tmp = t_1 elif a <= 1.35e-62: tmp = t_2 elif a <= 4e-46: tmp = t_1 elif a <= 3.8e+72: tmp = (a * t) + (z * y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -9e+55) tmp = t_2; elseif (a <= 1.7e-77) tmp = t_1; elseif (a <= 1.35e-62) tmp = t_2; elseif (a <= 4e-46) tmp = t_1; elseif (a <= 3.8e+72) tmp = Float64(Float64(a * t) + Float64(z * y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -9e+55) tmp = t_2; elseif (a <= 1.7e-77) tmp = t_1; elseif (a <= 1.35e-62) tmp = t_2; elseif (a <= 4e-46) tmp = t_1; elseif (a <= 3.8e+72) tmp = (a * t) + (z * y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9e+55], t$95$2, If[LessEqual[a, 1.7e-77], t$95$1, If[LessEqual[a, 1.35e-62], t$95$2, If[LessEqual[a, 4e-46], t$95$1, If[LessEqual[a, 3.8e+72], N[(N[(a * t), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -9 \cdot 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 4 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+72}:\\
\;\;\;\;a \cdot t + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -8.99999999999999996e55 or 1.69999999999999991e-77 < a < 1.3500000000000001e-62 or 3.80000000000000006e72 < a Initial program 81.1%
associate-+l+81.1%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in a around inf 85.5%
if -8.99999999999999996e55 < a < 1.69999999999999991e-77 or 1.3500000000000001e-62 < a < 4.00000000000000009e-46Initial program 98.4%
associate-+l+98.4%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in a around 0 81.3%
if 4.00000000000000009e-46 < a < 3.80000000000000006e72Initial program 89.5%
associate-+l+89.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in b around 0 79.9%
Taylor expanded in x around 0 74.9%
Final simplification82.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -1.7e+56)
t_1
(if (<= a 1.1e-120)
(+ x (* z y))
(if (or (<= a 4.1e+26) (not (<= a 3.1e+57)))
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 (a <= -1.7e+56) {
tmp = t_1;
} else if (a <= 1.1e-120) {
tmp = x + (z * y);
} else if ((a <= 4.1e+26) || !(a <= 3.1e+57)) {
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 (a <= (-1.7d+56)) then
tmp = t_1
else if (a <= 1.1d-120) then
tmp = x + (z * y)
else if ((a <= 4.1d+26) .or. (.not. (a <= 3.1d+57))) 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 (a <= -1.7e+56) {
tmp = t_1;
} else if (a <= 1.1e-120) {
tmp = x + (z * y);
} else if ((a <= 4.1e+26) || !(a <= 3.1e+57)) {
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 a <= -1.7e+56: tmp = t_1 elif a <= 1.1e-120: tmp = x + (z * y) elif (a <= 4.1e+26) or not (a <= 3.1e+57): 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 (a <= -1.7e+56) tmp = t_1; elseif (a <= 1.1e-120) tmp = Float64(x + Float64(z * y)); elseif ((a <= 4.1e+26) || !(a <= 3.1e+57)) 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 (a <= -1.7e+56) tmp = t_1; elseif (a <= 1.1e-120) tmp = x + (z * y); elseif ((a <= 4.1e+26) || ~((a <= 3.1e+57))) 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[a, -1.7e+56], t$95$1, If[LessEqual[a, 1.1e-120], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4.1e+26], N[Not[LessEqual[a, 3.1e+57]], $MachinePrecision]], 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}\;a \leq -1.7 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-120}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+26} \lor \neg \left(a \leq 3.1 \cdot 10^{+57}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.7e56 or 1.10000000000000006e-120 < a < 4.09999999999999983e26 or 3.10000000000000013e57 < a Initial program 83.9%
associate-+l+83.9%
+-commutative83.9%
*-commutative83.9%
associate-*l*90.3%
distribute-lft-out94.8%
fma-def96.2%
+-commutative96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in y around 0 91.3%
if -1.7e56 < a < 1.10000000000000006e-120Initial program 98.2%
associate-+l+98.2%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in a around 0 81.8%
if 4.09999999999999983e26 < a < 3.10000000000000013e57Initial program 83.3%
associate-+l+83.3%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in z around inf 100.0%
Final simplification87.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.3e+47)
(* z y)
(if (<= z -1.8e-122)
(* a (* z b))
(if (<= z -7e-295)
(* a t)
(if (<= z 6.6e+52) x (if (<= z 3.6e+227) (* b (* z a)) (* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.3e+47) {
tmp = z * y;
} else if (z <= -1.8e-122) {
tmp = a * (z * b);
} else if (z <= -7e-295) {
tmp = a * t;
} else if (z <= 6.6e+52) {
tmp = x;
} else if (z <= 3.6e+227) {
tmp = b * (z * a);
} 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 (z <= (-4.3d+47)) then
tmp = z * y
else if (z <= (-1.8d-122)) then
tmp = a * (z * b)
else if (z <= (-7d-295)) then
tmp = a * t
else if (z <= 6.6d+52) then
tmp = x
else if (z <= 3.6d+227) then
tmp = b * (z * a)
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 (z <= -4.3e+47) {
tmp = z * y;
} else if (z <= -1.8e-122) {
tmp = a * (z * b);
} else if (z <= -7e-295) {
tmp = a * t;
} else if (z <= 6.6e+52) {
tmp = x;
} else if (z <= 3.6e+227) {
tmp = b * (z * a);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.3e+47: tmp = z * y elif z <= -1.8e-122: tmp = a * (z * b) elif z <= -7e-295: tmp = a * t elif z <= 6.6e+52: tmp = x elif z <= 3.6e+227: tmp = b * (z * a) else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.3e+47) tmp = Float64(z * y); elseif (z <= -1.8e-122) tmp = Float64(a * Float64(z * b)); elseif (z <= -7e-295) tmp = Float64(a * t); elseif (z <= 6.6e+52) tmp = x; elseif (z <= 3.6e+227) tmp = Float64(b * Float64(z * a)); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.3e+47) tmp = z * y; elseif (z <= -1.8e-122) tmp = a * (z * b); elseif (z <= -7e-295) tmp = a * t; elseif (z <= 6.6e+52) tmp = x; elseif (z <= 3.6e+227) tmp = b * (z * a); else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.3e+47], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.8e-122], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-295], N[(a * t), $MachinePrecision], If[LessEqual[z, 6.6e+52], x, If[LessEqual[z, 3.6e+227], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+47}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-122}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-295}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+52}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+227}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -4.29999999999999995e47 or 3.59999999999999991e227 < z Initial program 76.1%
associate-+l+76.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in y around inf 58.4%
*-commutative58.4%
Simplified58.4%
if -4.29999999999999995e47 < z < -1.79999999999999997e-122Initial program 91.9%
associate-+l+91.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 54.4%
Taylor expanded in a around inf 45.8%
*-commutative45.8%
Simplified45.8%
if -1.79999999999999997e-122 < z < -6.99999999999999977e-295Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 56.6%
if -6.99999999999999977e-295 < z < 6.6e52Initial program 98.6%
associate-+l+98.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 44.6%
if 6.6e52 < z < 3.59999999999999991e227Initial program 86.3%
associate-+l+86.3%
associate-*l*79.9%
Simplified79.9%
Taylor expanded in z around inf 82.0%
Taylor expanded in a around inf 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in b around 0 47.1%
associate-*r*49.1%
*-commutative49.1%
associate-*r*51.2%
Simplified51.2%
Final simplification50.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= z -4.7e+144)
(* z y)
(if (<= z -2.7e+17)
t_1
(if (<= z -2.05e-32)
(* a (* z b))
(if (<= z 8.2e+109)
t_1
(if (<= z 1.6e+226) (* b (* z a)) (* 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 (z <= -4.7e+144) {
tmp = z * y;
} else if (z <= -2.7e+17) {
tmp = t_1;
} else if (z <= -2.05e-32) {
tmp = a * (z * b);
} else if (z <= 8.2e+109) {
tmp = t_1;
} else if (z <= 1.6e+226) {
tmp = b * (z * a);
} 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 (z <= (-4.7d+144)) then
tmp = z * y
else if (z <= (-2.7d+17)) then
tmp = t_1
else if (z <= (-2.05d-32)) then
tmp = a * (z * b)
else if (z <= 8.2d+109) then
tmp = t_1
else if (z <= 1.6d+226) then
tmp = b * (z * a)
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 (z <= -4.7e+144) {
tmp = z * y;
} else if (z <= -2.7e+17) {
tmp = t_1;
} else if (z <= -2.05e-32) {
tmp = a * (z * b);
} else if (z <= 8.2e+109) {
tmp = t_1;
} else if (z <= 1.6e+226) {
tmp = b * (z * a);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if z <= -4.7e+144: tmp = z * y elif z <= -2.7e+17: tmp = t_1 elif z <= -2.05e-32: tmp = a * (z * b) elif z <= 8.2e+109: tmp = t_1 elif z <= 1.6e+226: tmp = b * (z * a) 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 (z <= -4.7e+144) tmp = Float64(z * y); elseif (z <= -2.7e+17) tmp = t_1; elseif (z <= -2.05e-32) tmp = Float64(a * Float64(z * b)); elseif (z <= 8.2e+109) tmp = t_1; elseif (z <= 1.6e+226) tmp = Float64(b * Float64(z * a)); 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 (z <= -4.7e+144) tmp = z * y; elseif (z <= -2.7e+17) tmp = t_1; elseif (z <= -2.05e-32) tmp = a * (z * b); elseif (z <= 8.2e+109) tmp = t_1; elseif (z <= 1.6e+226) tmp = b * (z * a); 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[z, -4.7e+144], N[(z * y), $MachinePrecision], If[LessEqual[z, -2.7e+17], t$95$1, If[LessEqual[z, -2.05e-32], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+109], t$95$1, If[LessEqual[z, 1.6e+226], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+144}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-32}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+226}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -4.7000000000000002e144 or 1.59999999999999989e226 < z Initial program 75.6%
associate-+l+75.6%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around inf 62.5%
*-commutative62.5%
Simplified62.5%
if -4.7000000000000002e144 < z < -2.7e17 or -2.04999999999999988e-32 < z < 8.19999999999999939e109Initial program 96.4%
associate-+l+96.4%
associate-*l*99.3%
Simplified99.3%
Taylor expanded in z around 0 70.6%
if -2.7e17 < z < -2.04999999999999988e-32Initial program 90.5%
associate-+l+90.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in z around inf 80.2%
Taylor expanded in a around inf 70.5%
*-commutative70.5%
Simplified70.5%
if 8.19999999999999939e109 < z < 1.59999999999999989e226Initial program 82.1%
associate-+l+82.1%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in z around inf 85.9%
Taylor expanded in a around inf 51.7%
*-commutative51.7%
Simplified51.7%
Taylor expanded in b around 0 51.7%
associate-*r*54.9%
*-commutative54.9%
associate-*r*58.2%
Simplified58.2%
Final simplification67.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= a -9.5e+243)
t_1
(if (<= a -1.22e+151)
(* z (* a b))
(if (or (<= a -1.5e+58) (not (<= a 6.6e+60))) t_1 (+ x (* 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 (a <= -9.5e+243) {
tmp = t_1;
} else if (a <= -1.22e+151) {
tmp = z * (a * b);
} else if ((a <= -1.5e+58) || !(a <= 6.6e+60)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (a * t)
if (a <= (-9.5d+243)) then
tmp = t_1
else if (a <= (-1.22d+151)) then
tmp = z * (a * b)
else if ((a <= (-1.5d+58)) .or. (.not. (a <= 6.6d+60))) then
tmp = t_1
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 t_1 = x + (a * t);
double tmp;
if (a <= -9.5e+243) {
tmp = t_1;
} else if (a <= -1.22e+151) {
tmp = z * (a * b);
} else if ((a <= -1.5e+58) || !(a <= 6.6e+60)) {
tmp = t_1;
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if a <= -9.5e+243: tmp = t_1 elif a <= -1.22e+151: tmp = z * (a * b) elif (a <= -1.5e+58) or not (a <= 6.6e+60): tmp = t_1 else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -9.5e+243) tmp = t_1; elseif (a <= -1.22e+151) tmp = Float64(z * Float64(a * b)); elseif ((a <= -1.5e+58) || !(a <= 6.6e+60)) tmp = t_1; else tmp = Float64(x + 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 (a <= -9.5e+243) tmp = t_1; elseif (a <= -1.22e+151) tmp = z * (a * b); elseif ((a <= -1.5e+58) || ~((a <= 6.6e+60))) tmp = t_1; else tmp = x + (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[a, -9.5e+243], t$95$1, If[LessEqual[a, -1.22e+151], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -1.5e+58], N[Not[LessEqual[a, 6.6e+60]], $MachinePrecision]], t$95$1, N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+243}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.22 \cdot 10^{+151}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq -1.5 \cdot 10^{+58} \lor \neg \left(a \leq 6.6 \cdot 10^{+60}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -9.49999999999999957e243 or -1.22000000000000005e151 < a < -1.5000000000000001e58 or 6.5999999999999995e60 < a Initial program 81.8%
associate-+l+81.8%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in z around 0 62.5%
if -9.49999999999999957e243 < a < -1.22000000000000005e151Initial program 71.0%
+-commutative71.0%
+-commutative71.0%
associate-+l+71.0%
associate-+r+71.0%
*-commutative71.0%
associate-*l*82.3%
*-commutative82.3%
distribute-lft-out88.1%
fma-def88.1%
fma-def88.1%
+-commutative88.1%
fma-def88.1%
Simplified88.1%
Taylor expanded in t around 0 77.6%
Taylor expanded in a around inf 71.7%
*-commutative65.9%
Simplified71.7%
Taylor expanded in a around inf 65.9%
associate-*r*66.0%
*-commutative66.0%
associate-*r*71.4%
Simplified71.4%
if -1.5000000000000001e58 < a < 6.5999999999999995e60Initial program 97.3%
associate-+l+97.3%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in a around 0 74.2%
Final simplification70.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -5e-75)
t_1
(if (<= z 7e-79) (+ x (* a t)) (if (<= z 6.1e+53) (+ x (* z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -5e-75) {
tmp = t_1;
} else if (z <= 7e-79) {
tmp = x + (a * t);
} else if (z <= 6.1e+53) {
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 = z * (y + (a * b))
if (z <= (-5d-75)) then
tmp = t_1
else if (z <= 7d-79) then
tmp = x + (a * t)
else if (z <= 6.1d+53) 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 = z * (y + (a * b));
double tmp;
if (z <= -5e-75) {
tmp = t_1;
} else if (z <= 7e-79) {
tmp = x + (a * t);
} else if (z <= 6.1e+53) {
tmp = x + (z * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -5e-75: tmp = t_1 elif z <= 7e-79: tmp = x + (a * t) elif z <= 6.1e+53: tmp = x + (z * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -5e-75) tmp = t_1; elseif (z <= 7e-79) tmp = Float64(x + Float64(a * t)); elseif (z <= 6.1e+53) 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 = z * (y + (a * b)); tmp = 0.0; if (z <= -5e-75) tmp = t_1; elseif (z <= 7e-79) tmp = x + (a * t); elseif (z <= 6.1e+53) 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[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-75], t$95$1, If[LessEqual[z, 7e-79], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.1e+53], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{-75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-79}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{+53}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.99999999999999979e-75 or 6.1000000000000002e53 < z Initial program 82.2%
associate-+l+82.2%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in z around inf 77.9%
if -4.99999999999999979e-75 < z < 7.00000000000000059e-79Initial program 99.0%
associate-+l+99.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 82.5%
if 7.00000000000000059e-79 < z < 6.1000000000000002e53Initial program 96.0%
associate-+l+96.0%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around 0 71.4%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9e+48) (not (<= b 4.8e-23))) (+ x (* a (+ t (* z b)))) (+ (+ x (* a t)) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9e+48) || !(b <= 4.8e-23)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (a * t)) + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-9d+48)) .or. (.not. (b <= 4.8d-23))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (a * t)) + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9e+48) || !(b <= 4.8e-23)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (a * t)) + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9e+48) or not (b <= 4.8e-23): tmp = x + (a * (t + (z * b))) else: tmp = (x + (a * t)) + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9e+48) || !(b <= 4.8e-23)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(a * t)) + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -9e+48) || ~((b <= 4.8e-23))) tmp = x + (a * (t + (z * b))); else tmp = (x + (a * t)) + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9e+48], N[Not[LessEqual[b, 4.8e-23]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{+48} \lor \neg \left(b \leq 4.8 \cdot 10^{-23}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\end{array}
\end{array}
if b < -8.99999999999999991e48 or 4.79999999999999993e-23 < b Initial program 89.2%
associate-+l+89.2%
+-commutative89.2%
*-commutative89.2%
associate-*l*87.5%
distribute-lft-out92.9%
fma-def92.9%
+-commutative92.9%
fma-def92.9%
Simplified92.9%
Taylor expanded in y around 0 85.6%
if -8.99999999999999991e48 < b < 4.79999999999999993e-23Initial program 91.1%
associate-+l+91.1%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in b around 0 96.0%
Final simplification91.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.05e+52) (+ x (* a (+ t (* z b)))) (if (<= b 1.95e-25) (+ (+ x (* a t)) (* z y)) (+ x (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.05e+52) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 1.95e-25) {
tmp = (x + (a * t)) + (z * y);
} 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 (b <= (-2.05d+52)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 1.95d-25) then
tmp = (x + (a * t)) + (z * y)
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 (b <= -2.05e+52) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 1.95e-25) {
tmp = (x + (a * t)) + (z * y);
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.05e+52: tmp = x + (a * (t + (z * b))) elif b <= 1.95e-25: tmp = (x + (a * t)) + (z * y) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.05e+52) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 1.95e-25) tmp = Float64(Float64(x + Float64(a * t)) + Float64(z * y)); 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 (b <= -2.05e+52) tmp = x + (a * (t + (z * b))); elseif (b <= 1.95e-25) tmp = (x + (a * t)) + (z * y); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.05e+52], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e-25], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.05 \cdot 10^{+52}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{-25}:\\
\;\;\;\;\left(x + a \cdot t\right) + z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -2.05e52Initial program 87.9%
associate-+l+87.9%
+-commutative87.9%
*-commutative87.9%
associate-*l*87.9%
distribute-lft-out93.9%
fma-def93.9%
+-commutative93.9%
fma-def93.9%
Simplified93.9%
Taylor expanded in y around 0 90.1%
if -2.05e52 < b < 1.95e-25Initial program 91.0%
associate-+l+91.0%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in b around 0 96.0%
if 1.95e-25 < b Initial program 90.6%
+-commutative90.6%
+-commutative90.6%
associate-+l+90.6%
associate-+r+90.6%
*-commutative90.6%
associate-*l*86.0%
*-commutative86.0%
distribute-lft-out90.7%
fma-def90.7%
fma-def90.7%
+-commutative90.7%
fma-def90.7%
Simplified90.7%
Taylor expanded in t around 0 90.3%
Final simplification93.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.4e+39)
(* z y)
(if (<= z -1.8e-122)
(* a (* z b))
(if (<= z -3.6e-290) (* a t) (if (<= z 8.8e-14) x (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.4e+39) {
tmp = z * y;
} else if (z <= -1.8e-122) {
tmp = a * (z * b);
} else if (z <= -3.6e-290) {
tmp = a * t;
} else if (z <= 8.8e-14) {
tmp = x;
} 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 (z <= (-3.4d+39)) then
tmp = z * y
else if (z <= (-1.8d-122)) then
tmp = a * (z * b)
else if (z <= (-3.6d-290)) then
tmp = a * t
else if (z <= 8.8d-14) then
tmp = x
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 (z <= -3.4e+39) {
tmp = z * y;
} else if (z <= -1.8e-122) {
tmp = a * (z * b);
} else if (z <= -3.6e-290) {
tmp = a * t;
} else if (z <= 8.8e-14) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.4e+39: tmp = z * y elif z <= -1.8e-122: tmp = a * (z * b) elif z <= -3.6e-290: tmp = a * t elif z <= 8.8e-14: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.4e+39) tmp = Float64(z * y); elseif (z <= -1.8e-122) tmp = Float64(a * Float64(z * b)); elseif (z <= -3.6e-290) tmp = Float64(a * t); elseif (z <= 8.8e-14) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.4e+39) tmp = z * y; elseif (z <= -1.8e-122) tmp = a * (z * b); elseif (z <= -3.6e-290) tmp = a * t; elseif (z <= 8.8e-14) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.4e+39], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.8e-122], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-290], N[(a * t), $MachinePrecision], If[LessEqual[z, 8.8e-14], x, N[(z * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+39}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-122}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-290}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -3.3999999999999999e39 or 8.8000000000000004e-14 < z Initial program 81.2%
associate-+l+81.2%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in y around inf 48.1%
*-commutative48.1%
Simplified48.1%
if -3.3999999999999999e39 < z < -1.79999999999999997e-122Initial program 91.9%
associate-+l+91.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 54.4%
Taylor expanded in a around inf 45.8%
*-commutative45.8%
Simplified45.8%
if -1.79999999999999997e-122 < z < -3.59999999999999979e-290Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 56.6%
if -3.59999999999999979e-290 < z < 8.8000000000000004e-14Initial program 99.9%
associate-+l+99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 48.0%
Final simplification49.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9e+55) (not (<= a 2.3e-77))) (* 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 <= -9e+55) || !(a <= 2.3e-77)) {
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 <= (-9d+55)) .or. (.not. (a <= 2.3d-77))) 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 <= -9e+55) || !(a <= 2.3e-77)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9e+55) or not (a <= 2.3e-77): 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 <= -9e+55) || !(a <= 2.3e-77)) 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 <= -9e+55) || ~((a <= 2.3e-77))) 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, -9e+55], N[Not[LessEqual[a, 2.3e-77]], $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 -9 \cdot 10^{+55} \lor \neg \left(a \leq 2.3 \cdot 10^{-77}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -8.99999999999999996e55 or 2.29999999999999999e-77 < a Initial program 82.6%
associate-+l+82.6%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in a around inf 79.7%
if -8.99999999999999996e55 < a < 2.29999999999999999e-77Initial program 98.4%
associate-+l+98.4%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in a around 0 81.0%
Final simplification80.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.3e+144) (* z y) (if (<= z -2.45e-297) (* a t) (if (<= z 5.5e-23) x (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.3e+144) {
tmp = z * y;
} else if (z <= -2.45e-297) {
tmp = a * t;
} else if (z <= 5.5e-23) {
tmp = x;
} 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 (z <= (-4.3d+144)) then
tmp = z * y
else if (z <= (-2.45d-297)) then
tmp = a * t
else if (z <= 5.5d-23) then
tmp = x
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 (z <= -4.3e+144) {
tmp = z * y;
} else if (z <= -2.45e-297) {
tmp = a * t;
} else if (z <= 5.5e-23) {
tmp = x;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.3e+144: tmp = z * y elif z <= -2.45e-297: tmp = a * t elif z <= 5.5e-23: tmp = x else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.3e+144) tmp = Float64(z * y); elseif (z <= -2.45e-297) tmp = Float64(a * t); elseif (z <= 5.5e-23) tmp = x; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.3e+144) tmp = z * y; elseif (z <= -2.45e-297) tmp = a * t; elseif (z <= 5.5e-23) tmp = x; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.3e+144], N[(z * y), $MachinePrecision], If[LessEqual[z, -2.45e-297], N[(a * t), $MachinePrecision], If[LessEqual[z, 5.5e-23], x, N[(z * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+144}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-297}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -4.29999999999999984e144 or 5.5000000000000001e-23 < z Initial program 81.4%
associate-+l+81.4%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in y around inf 49.3%
*-commutative49.3%
Simplified49.3%
if -4.29999999999999984e144 < z < -2.44999999999999999e-297Initial program 94.0%
associate-+l+94.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 41.2%
if -2.44999999999999999e-297 < z < 5.5000000000000001e-23Initial program 99.9%
associate-+l+99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 48.0%
Final simplification46.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6e+106) (* a t) (if (<= a 8e-78) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6e+106) {
tmp = a * t;
} else if (a <= 8e-78) {
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 <= (-6d+106)) then
tmp = a * t
else if (a <= 8d-78) 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 <= -6e+106) {
tmp = a * t;
} else if (a <= 8e-78) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6e+106: tmp = a * t elif a <= 8e-78: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6e+106) tmp = Float64(a * t); elseif (a <= 8e-78) 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 <= -6e+106) tmp = a * t; elseif (a <= 8e-78) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6e+106], N[(a * t), $MachinePrecision], If[LessEqual[a, 8e-78], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+106}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -6.0000000000000001e106 or 7.99999999999999999e-78 < a Initial program 82.1%
associate-+l+82.1%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in t around inf 45.8%
if -6.0000000000000001e106 < a < 7.99999999999999999e-78Initial program 97.7%
associate-+l+97.7%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 42.3%
Final simplification44.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 90.3%
associate-+l+90.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around inf 26.7%
Final simplification26.7%
(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 2023174
(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)))