
(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 2e+81) (fma a (fma z b t) (fma y z x)) (+ (+ x (* z y)) (+ (* z (* a b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e+81) {
tmp = fma(a, fma(z, b, t), fma(y, z, x));
} else {
tmp = (x + (z * y)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e+81) tmp = fma(a, fma(z, b, t), fma(y, z, x)); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(z * Float64(a * b)) + Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e+81], N[(a * N[(z * b + t), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(z \cdot \left(a \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < 1.99999999999999984e81Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
*-commutative95.8%
associate-*l*96.1%
*-commutative96.1%
distribute-lft-out98.5%
fma-def98.5%
+-commutative98.5%
remove-double-neg98.5%
sub-neg98.5%
*-commutative98.5%
fma-neg98.5%
remove-double-neg98.5%
+-commutative98.5%
fma-def98.5%
Simplified98.5%
if 1.99999999999999984e81 < z Initial program 94.4%
associate-+l+94.4%
*-commutative94.4%
associate-*l*98.0%
Simplified98.0%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2.7e+82) (fma a (+ t (* z b)) (fma y z x)) (+ (+ x (* z y)) (+ (* z (* a b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.7e+82) {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
} else {
tmp = (x + (z * y)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.7e+82) tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(z * Float64(a * b)) + Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.7e+82], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.7 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(z \cdot \left(a \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < 2.6999999999999999e82Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
*-commutative95.8%
associate-*l*96.1%
*-commutative96.1%
distribute-lft-out98.5%
fma-def98.5%
*-commutative98.5%
+-commutative98.5%
fma-def98.5%
Simplified98.5%
if 2.6999999999999999e82 < z Initial program 94.4%
associate-+l+94.4%
*-commutative94.4%
associate-*l*98.0%
Simplified98.0%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2e+80) (+ (fma y z x) (* a (+ t (* z b)))) (+ (+ x (* z y)) (+ (* z (* a b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e+80) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = (x + (z * y)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e+80) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(z * Float64(a * b)) + Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e+80], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(z \cdot \left(a \cdot b\right) + a \cdot t\right)\\
\end{array}
\end{array}
if z < 2e80Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
fma-def95.8%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
distribute-rgt-out98.5%
*-commutative98.5%
Simplified98.5%
if 2e80 < z Initial program 94.4%
associate-+l+94.4%
*-commutative94.4%
associate-*l*98.0%
Simplified98.0%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= (+ (+ t_1 (* a t)) (* b (* z a))) INFINITY)
(+ t_1 (+ (* z (* a b)) (* a t)))
(* 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 (((t_1 + (a * t)) + (b * (z * a))) <= ((double) INFINITY)) {
tmp = t_1 + ((z * (a * b)) + (a * t));
} 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 (((t_1 + (a * t)) + (b * (z * a))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + ((z * (a * b)) + (a * t));
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) tmp = 0 if ((t_1 + (a * t)) + (b * (z * a))) <= math.inf: tmp = t_1 + ((z * (a * b)) + (a * t)) 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(t_1 + Float64(a * t)) + Float64(b * Float64(z * a))) <= Inf) tmp = Float64(t_1 + Float64(Float64(z * Float64(a * b)) + Float64(a * t))); 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 (((t_1 + (a * t)) + (b * (z * a))) <= Inf) tmp = t_1 + ((z * (a * b)) + (a * t)); 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[(t$95$1 + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $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(t_1 + a \cdot t\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\
\;\;\;\;t_1 + \left(z \cdot \left(a \cdot b\right) + a \cdot t\right)\\
\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 98.2%
associate-+l+98.2%
*-commutative98.2%
associate-*l*98.8%
Simplified98.8%
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%
+-commutative0.0%
*-commutative0.0%
associate-*l*0.0%
*-commutative0.0%
distribute-lft-out71.4%
fma-def71.4%
+-commutative71.4%
remove-double-neg71.4%
sub-neg71.4%
*-commutative71.4%
fma-neg71.4%
remove-double-neg71.4%
+-commutative71.4%
fma-def71.4%
Simplified71.4%
Taylor expanded in a around inf 71.4%
Final simplification98.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= x -4.8e+33)
x
(if (<= x -6e-180)
(* a t)
(if (<= x -1.65e-298)
(* z y)
(if (<= x 6.2e-267)
(* a t)
(if (<= x 1.08e-159)
t_1
(if (<= x 1.22e-17) (* a t) (if (<= x 2.6e+113) t_1 x)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (x <= -4.8e+33) {
tmp = x;
} else if (x <= -6e-180) {
tmp = a * t;
} else if (x <= -1.65e-298) {
tmp = z * y;
} else if (x <= 6.2e-267) {
tmp = a * t;
} else if (x <= 1.08e-159) {
tmp = t_1;
} else if (x <= 1.22e-17) {
tmp = a * t;
} else if (x <= 2.6e+113) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (x <= (-4.8d+33)) then
tmp = x
else if (x <= (-6d-180)) then
tmp = a * t
else if (x <= (-1.65d-298)) then
tmp = z * y
else if (x <= 6.2d-267) then
tmp = a * t
else if (x <= 1.08d-159) then
tmp = t_1
else if (x <= 1.22d-17) then
tmp = a * t
else if (x <= 2.6d+113) then
tmp = t_1
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 t_1 = z * (a * b);
double tmp;
if (x <= -4.8e+33) {
tmp = x;
} else if (x <= -6e-180) {
tmp = a * t;
} else if (x <= -1.65e-298) {
tmp = z * y;
} else if (x <= 6.2e-267) {
tmp = a * t;
} else if (x <= 1.08e-159) {
tmp = t_1;
} else if (x <= 1.22e-17) {
tmp = a * t;
} else if (x <= 2.6e+113) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if x <= -4.8e+33: tmp = x elif x <= -6e-180: tmp = a * t elif x <= -1.65e-298: tmp = z * y elif x <= 6.2e-267: tmp = a * t elif x <= 1.08e-159: tmp = t_1 elif x <= 1.22e-17: tmp = a * t elif x <= 2.6e+113: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (x <= -4.8e+33) tmp = x; elseif (x <= -6e-180) tmp = Float64(a * t); elseif (x <= -1.65e-298) tmp = Float64(z * y); elseif (x <= 6.2e-267) tmp = Float64(a * t); elseif (x <= 1.08e-159) tmp = t_1; elseif (x <= 1.22e-17) tmp = Float64(a * t); elseif (x <= 2.6e+113) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (x <= -4.8e+33) tmp = x; elseif (x <= -6e-180) tmp = a * t; elseif (x <= -1.65e-298) tmp = z * y; elseif (x <= 6.2e-267) tmp = a * t; elseif (x <= 1.08e-159) tmp = t_1; elseif (x <= 1.22e-17) tmp = a * t; elseif (x <= 2.6e+113) tmp = t_1; else tmp = x; 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[x, -4.8e+33], x, If[LessEqual[x, -6e-180], N[(a * t), $MachinePrecision], If[LessEqual[x, -1.65e-298], N[(z * y), $MachinePrecision], If[LessEqual[x, 6.2e-267], N[(a * t), $MachinePrecision], If[LessEqual[x, 1.08e-159], t$95$1, If[LessEqual[x, 1.22e-17], N[(a * t), $MachinePrecision], If[LessEqual[x, 2.6e+113], t$95$1, x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+33}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-180}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-298}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-267}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-17}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+113}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.8e33 or 2.5999999999999999e113 < x Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
*-commutative98.0%
associate-*l*95.3%
*-commutative95.3%
distribute-lft-out97.2%
fma-def97.2%
+-commutative97.2%
remove-double-neg97.2%
sub-neg97.2%
*-commutative97.2%
fma-neg97.2%
remove-double-neg97.2%
+-commutative97.2%
fma-def97.2%
Simplified97.2%
Taylor expanded in x around inf 62.5%
if -4.8e33 < x < -6.0000000000000001e-180 or -1.6500000000000001e-298 < x < 6.2000000000000002e-267 or 1.08000000000000004e-159 < x < 1.22e-17Initial program 94.2%
associate-+l+94.2%
+-commutative94.2%
*-commutative94.2%
associate-*l*95.5%
*-commutative95.5%
distribute-lft-out97.0%
fma-def97.0%
+-commutative97.0%
remove-double-neg97.0%
sub-neg97.0%
*-commutative97.0%
fma-neg97.0%
remove-double-neg97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in t around inf 54.8%
if -6.0000000000000001e-180 < x < -1.6500000000000001e-298Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
*-commutative97.8%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around inf 52.6%
if 6.2000000000000002e-267 < x < 1.08000000000000004e-159 or 1.22e-17 < x < 2.5999999999999999e113Initial program 91.5%
associate-+l+91.5%
+-commutative91.5%
*-commutative91.5%
associate-*l*90.0%
*-commutative90.0%
distribute-lft-out93.5%
fma-def93.5%
+-commutative93.5%
remove-double-neg93.5%
sub-neg93.5%
*-commutative93.5%
fma-neg93.5%
remove-double-neg93.5%
+-commutative93.5%
fma-def93.5%
Simplified93.5%
Taylor expanded in b around inf 43.2%
associate-*r*46.3%
*-commutative46.3%
Simplified46.3%
Final simplification55.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -8.4e+33) (not (<= x 14500000000000.0))) (+ x (* z (+ y (* a b)))) (+ (* b (* z a)) (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -8.4e+33) || !(x <= 14500000000000.0)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (b * (z * a)) + ((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 ((x <= (-8.4d+33)) .or. (.not. (x <= 14500000000000.0d0))) then
tmp = x + (z * (y + (a * b)))
else
tmp = (b * (z * a)) + ((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 ((x <= -8.4e+33) || !(x <= 14500000000000.0)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (b * (z * a)) + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -8.4e+33) or not (x <= 14500000000000.0): tmp = x + (z * (y + (a * b))) else: tmp = (b * (z * a)) + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -8.4e+33) || !(x <= 14500000000000.0)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(b * Float64(z * a)) + 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 ((x <= -8.4e+33) || ~((x <= 14500000000000.0))) tmp = x + (z * (y + (a * b))); else tmp = (b * (z * a)) + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -8.4e+33], N[Not[LessEqual[x, 14500000000000.0]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{+33} \lor \neg \left(x \leq 14500000000000\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(z \cdot a\right) + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if x < -8.4000000000000002e33 or 1.45e13 < x Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
*-commutative97.6%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out97.0%
fma-def97.0%
+-commutative97.0%
remove-double-neg97.0%
sub-neg97.0%
*-commutative97.0%
fma-neg97.0%
remove-double-neg97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in t around 0 90.3%
+-commutative90.3%
associate-*r*93.3%
distribute-rgt-in93.3%
Simplified93.3%
if -8.4000000000000002e33 < x < 1.45e13Initial program 93.5%
Taylor expanded in x around 0 89.2%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))) (t_2 (* a (* z b))))
(if (<= a -1.04e+251)
t_2
(if (<= a -1.75e+153)
t_1
(if (<= a -2.3e+82)
t_2
(if (or (<= a -0.00019) (not (<= a 4.4e-23))) 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 t_2 = a * (z * b);
double tmp;
if (a <= -1.04e+251) {
tmp = t_2;
} else if (a <= -1.75e+153) {
tmp = t_1;
} else if (a <= -2.3e+82) {
tmp = t_2;
} else if ((a <= -0.00019) || !(a <= 4.4e-23)) {
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) :: t_2
real(8) :: tmp
t_1 = x + (a * t)
t_2 = a * (z * b)
if (a <= (-1.04d+251)) then
tmp = t_2
else if (a <= (-1.75d+153)) then
tmp = t_1
else if (a <= (-2.3d+82)) then
tmp = t_2
else if ((a <= (-0.00019d0)) .or. (.not. (a <= 4.4d-23))) 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 t_2 = a * (z * b);
double tmp;
if (a <= -1.04e+251) {
tmp = t_2;
} else if (a <= -1.75e+153) {
tmp = t_1;
} else if (a <= -2.3e+82) {
tmp = t_2;
} else if ((a <= -0.00019) || !(a <= 4.4e-23)) {
tmp = t_1;
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) t_2 = a * (z * b) tmp = 0 if a <= -1.04e+251: tmp = t_2 elif a <= -1.75e+153: tmp = t_1 elif a <= -2.3e+82: tmp = t_2 elif (a <= -0.00019) or not (a <= 4.4e-23): 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)) t_2 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -1.04e+251) tmp = t_2; elseif (a <= -1.75e+153) tmp = t_1; elseif (a <= -2.3e+82) tmp = t_2; elseif ((a <= -0.00019) || !(a <= 4.4e-23)) 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); t_2 = a * (z * b); tmp = 0.0; if (a <= -1.04e+251) tmp = t_2; elseif (a <= -1.75e+153) tmp = t_1; elseif (a <= -2.3e+82) tmp = t_2; elseif ((a <= -0.00019) || ~((a <= 4.4e-23))) 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]}, Block[{t$95$2 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.04e+251], t$95$2, If[LessEqual[a, -1.75e+153], t$95$1, If[LessEqual[a, -2.3e+82], t$95$2, If[Or[LessEqual[a, -0.00019], N[Not[LessEqual[a, 4.4e-23]], $MachinePrecision]], t$95$1, N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -1.04 \cdot 10^{+251}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.75 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -0.00019 \lor \neg \left(a \leq 4.4 \cdot 10^{-23}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.04000000000000005e251 or -1.75e153 < a < -2.29999999999999988e82Initial program 88.1%
associate-+l+88.1%
+-commutative88.1%
*-commutative88.1%
associate-*l*90.9%
*-commutative90.9%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
fma-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in b around inf 67.6%
*-commutative67.6%
Simplified67.6%
if -1.04000000000000005e251 < a < -1.75e153 or -2.29999999999999988e82 < a < -1.9000000000000001e-4 or 4.3999999999999999e-23 < a Initial program 93.4%
associate-+l+93.4%
+-commutative93.4%
*-commutative93.4%
associate-*l*96.6%
*-commutative96.6%
distribute-lft-out98.8%
fma-def98.8%
+-commutative98.8%
remove-double-neg98.8%
sub-neg98.8%
*-commutative98.8%
fma-neg98.8%
remove-double-neg98.8%
+-commutative98.8%
fma-def98.8%
Simplified98.8%
Taylor expanded in z around 0 65.4%
if -1.9000000000000001e-4 < a < 4.3999999999999999e-23Initial program 98.8%
associate-+l+98.8%
+-commutative98.8%
*-commutative98.8%
associate-*l*94.3%
*-commutative94.3%
distribute-lft-out94.3%
fma-def94.3%
+-commutative94.3%
remove-double-neg94.3%
sub-neg94.3%
*-commutative94.3%
fma-neg94.3%
remove-double-neg94.3%
+-commutative94.3%
fma-def94.3%
Simplified94.3%
Taylor expanded in a around 0 78.6%
Final simplification72.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -0.000112) (not (<= a 2.55e-89))) (+ x (+ (* 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 ((a <= -0.000112) || !(a <= 2.55e-89)) {
tmp = x + ((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 ((a <= (-0.000112d0)) .or. (.not. (a <= 2.55d-89))) then
tmp = x + ((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 ((a <= -0.000112) || !(a <= 2.55e-89)) {
tmp = x + ((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 (a <= -0.000112) or not (a <= 2.55e-89): tmp = x + ((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 ((a <= -0.000112) || !(a <= 2.55e-89)) tmp = Float64(x + 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 ((a <= -0.000112) || ~((a <= 2.55e-89))) tmp = x + ((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[Or[LessEqual[a, -0.000112], N[Not[LessEqual[a, 2.55e-89]], $MachinePrecision]], N[(x + 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}\;a \leq -0.000112 \lor \neg \left(a \leq 2.55 \cdot 10^{-89}\right):\\
\;\;\;\;x + \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 a < -1.11999999999999998e-4 or 2.55000000000000002e-89 < a Initial program 93.0%
associate-+l+93.0%
*-commutative93.0%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in y around 0 88.9%
if -1.11999999999999998e-4 < a < 2.55000000000000002e-89Initial program 98.6%
associate-+l+98.6%
+-commutative98.6%
*-commutative98.6%
associate-*l*93.3%
*-commutative93.3%
distribute-lft-out93.3%
fma-def93.3%
+-commutative93.3%
remove-double-neg93.3%
sub-neg93.3%
*-commutative93.3%
fma-neg93.3%
remove-double-neg93.3%
+-commutative93.3%
fma-def93.3%
Simplified93.3%
Taylor expanded in t around 0 85.1%
+-commutative85.1%
associate-*r*90.9%
distribute-rgt-in91.8%
Simplified91.8%
Final simplification90.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -5.5e+239)
t_1
(if (<= a -5.3e+156)
(* a t)
(if (<= a -1.26e-6)
t_1
(if (<= a -4.4e-52) (* z y) (if (<= a 1.8e-32) x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -5.5e+239) {
tmp = t_1;
} else if (a <= -5.3e+156) {
tmp = a * t;
} else if (a <= -1.26e-6) {
tmp = t_1;
} else if (a <= -4.4e-52) {
tmp = z * y;
} else if (a <= 1.8e-32) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-5.5d+239)) then
tmp = t_1
else if (a <= (-5.3d+156)) then
tmp = a * t
else if (a <= (-1.26d-6)) then
tmp = t_1
else if (a <= (-4.4d-52)) then
tmp = z * y
else if (a <= 1.8d-32) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -5.5e+239) {
tmp = t_1;
} else if (a <= -5.3e+156) {
tmp = a * t;
} else if (a <= -1.26e-6) {
tmp = t_1;
} else if (a <= -4.4e-52) {
tmp = z * y;
} else if (a <= 1.8e-32) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -5.5e+239: tmp = t_1 elif a <= -5.3e+156: tmp = a * t elif a <= -1.26e-6: tmp = t_1 elif a <= -4.4e-52: tmp = z * y elif a <= 1.8e-32: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -5.5e+239) tmp = t_1; elseif (a <= -5.3e+156) tmp = Float64(a * t); elseif (a <= -1.26e-6) tmp = t_1; elseif (a <= -4.4e-52) tmp = Float64(z * y); elseif (a <= 1.8e-32) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -5.5e+239) tmp = t_1; elseif (a <= -5.3e+156) tmp = a * t; elseif (a <= -1.26e-6) tmp = t_1; elseif (a <= -4.4e-52) tmp = z * y; elseif (a <= 1.8e-32) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.5e+239], t$95$1, If[LessEqual[a, -5.3e+156], N[(a * t), $MachinePrecision], If[LessEqual[a, -1.26e-6], t$95$1, If[LessEqual[a, -4.4e-52], N[(z * y), $MachinePrecision], If[LessEqual[a, 1.8e-32], x, N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -5.3 \cdot 10^{+156}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -1.26 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.4 \cdot 10^{-52}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -5.5000000000000004e239 or -5.2999999999999998e156 < a < -1.26000000000000001e-6Initial program 92.2%
associate-+l+92.2%
+-commutative92.2%
*-commutative92.2%
associate-*l*94.1%
*-commutative94.1%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
*-commutative99.9%
fma-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around inf 58.0%
*-commutative58.0%
Simplified58.0%
if -5.5000000000000004e239 < a < -5.2999999999999998e156 or 1.79999999999999996e-32 < a Initial program 92.3%
associate-+l+92.3%
+-commutative92.3%
*-commutative92.3%
associate-*l*96.0%
*-commutative96.0%
distribute-lft-out98.6%
fma-def98.6%
+-commutative98.6%
remove-double-neg98.6%
sub-neg98.6%
*-commutative98.6%
fma-neg98.6%
remove-double-neg98.6%
+-commutative98.6%
fma-def98.6%
Simplified98.6%
Taylor expanded in t around inf 50.5%
if -1.26000000000000001e-6 < a < -4.40000000000000018e-52Initial program 92.9%
associate-+l+92.9%
+-commutative92.9%
*-commutative92.9%
associate-*l*92.9%
*-commutative92.9%
distribute-lft-out92.9%
fma-def92.9%
+-commutative92.9%
remove-double-neg92.9%
sub-neg92.9%
*-commutative92.9%
fma-neg92.9%
remove-double-neg92.9%
+-commutative92.9%
fma-def92.9%
Simplified92.9%
Taylor expanded in y around inf 65.2%
if -4.40000000000000018e-52 < a < 1.79999999999999996e-32Initial program 99.4%
associate-+l+99.4%
+-commutative99.4%
*-commutative99.4%
associate-*l*94.2%
*-commutative94.2%
distribute-lft-out94.2%
fma-def94.2%
+-commutative94.2%
remove-double-neg94.2%
sub-neg94.2%
*-commutative94.2%
fma-neg94.2%
remove-double-neg94.2%
+-commutative94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in x around inf 47.4%
Final simplification51.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.3e-161) (not (<= z 2.65e-11))) (+ x (* z (+ y (* a b)))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-161) || !(z <= 2.65e-11)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.3d-161)) .or. (.not. (z <= 2.65d-11))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-161) || !(z <= 2.65e-11)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.3e-161) or not (z <= 2.65e-11): tmp = x + (z * (y + (a * b))) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.3e-161) || !(z <= 2.65e-11)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.3e-161) || ~((z <= 2.65e-11))) tmp = x + (z * (y + (a * b))); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.3e-161], N[Not[LessEqual[z, 2.65e-11]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-161} \lor \neg \left(z \leq 2.65 \cdot 10^{-11}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -1.29999999999999998e-161 or 2.6499999999999999e-11 < z Initial program 93.7%
associate-+l+93.7%
+-commutative93.7%
*-commutative93.7%
associate-*l*91.9%
*-commutative91.9%
distribute-lft-out94.5%
fma-def94.5%
+-commutative94.5%
remove-double-neg94.5%
sub-neg94.5%
*-commutative94.5%
fma-neg94.5%
remove-double-neg94.5%
+-commutative94.5%
fma-def94.5%
Simplified94.5%
Taylor expanded in t around 0 84.0%
+-commutative84.0%
associate-*r*88.8%
distribute-rgt-in90.1%
Simplified90.1%
if -1.29999999999999998e-161 < z < 2.6499999999999999e-11Initial program 98.4%
associate-+l+98.4%
+-commutative98.4%
*-commutative98.4%
associate-*l*99.0%
*-commutative99.0%
distribute-lft-out99.9%
fma-def100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
fma-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around 0 80.4%
Final simplification86.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1e+33)
x
(if (<= x -1.18e-179)
(* a t)
(if (<= x 1.5e-158) (* z y) (if (<= x 5.2e+104) (* a t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1e+33) {
tmp = x;
} else if (x <= -1.18e-179) {
tmp = a * t;
} else if (x <= 1.5e-158) {
tmp = z * y;
} else if (x <= 5.2e+104) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1d+33)) then
tmp = x
else if (x <= (-1.18d-179)) then
tmp = a * t
else if (x <= 1.5d-158) then
tmp = z * y
else if (x <= 5.2d+104) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1e+33) {
tmp = x;
} else if (x <= -1.18e-179) {
tmp = a * t;
} else if (x <= 1.5e-158) {
tmp = z * y;
} else if (x <= 5.2e+104) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1e+33: tmp = x elif x <= -1.18e-179: tmp = a * t elif x <= 1.5e-158: tmp = z * y elif x <= 5.2e+104: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1e+33) tmp = x; elseif (x <= -1.18e-179) tmp = Float64(a * t); elseif (x <= 1.5e-158) tmp = Float64(z * y); elseif (x <= 5.2e+104) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1e+33) tmp = x; elseif (x <= -1.18e-179) tmp = a * t; elseif (x <= 1.5e-158) tmp = z * y; elseif (x <= 5.2e+104) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1e+33], x, If[LessEqual[x, -1.18e-179], N[(a * t), $MachinePrecision], If[LessEqual[x, 1.5e-158], N[(z * y), $MachinePrecision], If[LessEqual[x, 5.2e+104], N[(a * t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+33}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.18 \cdot 10^{-179}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-158}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+104}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.9999999999999995e32 or 5.20000000000000001e104 < x Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
*-commutative98.1%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out97.3%
fma-def97.3%
+-commutative97.3%
remove-double-neg97.3%
sub-neg97.3%
*-commutative97.3%
fma-neg97.3%
remove-double-neg97.3%
+-commutative97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in x around inf 62.2%
if -9.9999999999999995e32 < x < -1.1800000000000001e-179 or 1.5e-158 < x < 5.20000000000000001e104Initial program 93.3%
associate-+l+93.3%
+-commutative93.3%
*-commutative93.3%
associate-*l*94.5%
*-commutative94.5%
distribute-lft-out96.7%
fma-def96.7%
+-commutative96.7%
remove-double-neg96.7%
sub-neg96.7%
*-commutative96.7%
fma-neg96.7%
remove-double-neg96.7%
+-commutative96.7%
fma-def96.7%
Simplified96.7%
Taylor expanded in t around inf 46.0%
if -1.1800000000000001e-179 < x < 1.5e-158Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
*-commutative94.3%
associate-*l*93.7%
*-commutative93.7%
distribute-lft-out95.3%
fma-def95.3%
+-commutative95.3%
remove-double-neg95.3%
sub-neg95.3%
*-commutative95.3%
fma-neg95.3%
remove-double-neg95.3%
+-commutative95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in y around inf 45.4%
Final simplification52.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.55e-5) (not (<= a 7.4e-47))) (* a (+ t (* z b))) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e-5) || !(a <= 7.4e-47)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.55d-5)) .or. (.not. (a <= 7.4d-47))) then
tmp = a * (t + (z * b))
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e-5) || !(a <= 7.4e-47)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.55e-5) or not (a <= 7.4e-47): tmp = a * (t + (z * b)) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.55e-5) || !(a <= 7.4e-47)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.55e-5) || ~((a <= 7.4e-47))) tmp = a * (t + (z * b)); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.55e-5], N[Not[LessEqual[a, 7.4e-47]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{-5} \lor \neg \left(a \leq 7.4 \cdot 10^{-47}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -1.55000000000000007e-5 or 7.4000000000000001e-47 < a Initial program 92.5%
associate-+l+92.5%
+-commutative92.5%
*-commutative92.5%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out99.2%
fma-def99.2%
+-commutative99.2%
remove-double-neg99.2%
sub-neg99.2%
*-commutative99.2%
fma-neg99.2%
remove-double-neg99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Taylor expanded in a around inf 77.8%
if -1.55000000000000007e-5 < a < 7.4000000000000001e-47Initial program 98.7%
associate-+l+98.7%
+-commutative98.7%
*-commutative98.7%
associate-*l*93.9%
*-commutative93.9%
distribute-lft-out93.9%
fma-def93.9%
+-commutative93.9%
remove-double-neg93.9%
sub-neg93.9%
*-commutative93.9%
fma-neg93.9%
remove-double-neg93.9%
+-commutative93.9%
fma-def93.9%
Simplified93.9%
Taylor expanded in a around 0 81.1%
Final simplification79.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.4e+187) (not (<= y 2.6e+240))) (* z y) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+187) || !(y <= 2.6e+240)) {
tmp = z * y;
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.4d+187)) .or. (.not. (y <= 2.6d+240))) then
tmp = z * y
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+187) || !(y <= 2.6e+240)) {
tmp = z * y;
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.4e+187) or not (y <= 2.6e+240): tmp = z * y else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.4e+187) || !(y <= 2.6e+240)) tmp = Float64(z * y); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.4e+187) || ~((y <= 2.6e+240))) tmp = z * y; else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.4e+187], N[Not[LessEqual[y, 2.6e+240]], $MachinePrecision]], N[(z * y), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+187} \lor \neg \left(y \leq 2.6 \cdot 10^{+240}\right):\\
\;\;\;\;z \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if y < -2.39999999999999985e187 or 2.6e240 < y Initial program 94.6%
associate-+l+94.6%
+-commutative94.6%
*-commutative94.6%
associate-*l*94.6%
*-commutative94.6%
distribute-lft-out94.6%
fma-def94.6%
+-commutative94.6%
remove-double-neg94.6%
sub-neg94.6%
*-commutative94.6%
fma-neg94.6%
remove-double-neg94.6%
+-commutative94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in y around inf 79.3%
if -2.39999999999999985e187 < y < 2.6e240Initial program 95.7%
associate-+l+95.7%
+-commutative95.7%
*-commutative95.7%
associate-*l*94.7%
*-commutative94.7%
distribute-lft-out96.9%
fma-def96.9%
+-commutative96.9%
remove-double-neg96.9%
sub-neg96.9%
*-commutative96.9%
fma-neg97.0%
remove-double-neg97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around 0 61.3%
Final simplification63.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.5e+32) x (if (<= x 5.8e+107) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+32) {
tmp = x;
} else if (x <= 5.8e+107) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-2.5d+32)) then
tmp = x
else if (x <= 5.8d+107) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+32) {
tmp = x;
} else if (x <= 5.8e+107) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.5e+32: tmp = x elif x <= 5.8e+107: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.5e+32) tmp = x; elseif (x <= 5.8e+107) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.5e+32) tmp = x; elseif (x <= 5.8e+107) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.5e+32], x, If[LessEqual[x, 5.8e+107], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+107}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4999999999999999e32 or 5.79999999999999975e107 < x Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
*-commutative98.1%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out97.3%
fma-def97.3%
+-commutative97.3%
remove-double-neg97.3%
sub-neg97.3%
*-commutative97.3%
fma-neg97.3%
remove-double-neg97.3%
+-commutative97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in x around inf 62.2%
if -2.4999999999999999e32 < x < 5.79999999999999975e107Initial program 93.7%
associate-+l+93.7%
+-commutative93.7%
*-commutative93.7%
associate-*l*94.2%
*-commutative94.2%
distribute-lft-out96.1%
fma-def96.1%
+-commutative96.1%
remove-double-neg96.1%
sub-neg96.1%
*-commutative96.1%
fma-neg96.1%
remove-double-neg96.1%
+-commutative96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in t around inf 39.7%
Final simplification48.9%
(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 95.5%
associate-+l+95.5%
+-commutative95.5%
*-commutative95.5%
associate-*l*94.7%
*-commutative94.7%
distribute-lft-out96.6%
fma-def96.6%
+-commutative96.6%
remove-double-neg96.6%
sub-neg96.6%
*-commutative96.6%
fma-neg96.6%
remove-double-neg96.6%
+-commutative96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in x around inf 31.0%
Final simplification31.0%
(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 2023320
(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)))