
(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 (<= a -2e+68) (+ (fma y z x) (* a (+ t (* z b)))) (+ (* b (* a z)) (+ (+ x (* y z)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2e+68) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = (b * (a * z)) + ((x + (y * z)) + (a * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2e+68) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(b * Float64(a * z)) + Float64(Float64(x + Float64(y * z)) + Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2e+68], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision] + N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+68}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot z\right) + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\
\end{array}
\end{array}
if a < -1.99999999999999991e68Initial program 77.2%
associate-+l+77.2%
+-commutative77.2%
fma-def77.2%
*-commutative77.2%
associate-*l*87.4%
*-commutative87.4%
distribute-lft-out92.8%
remove-double-neg92.8%
*-commutative92.8%
distribute-lft-neg-out92.8%
sub-neg92.8%
sub-neg92.8%
distribute-lft-neg-in92.8%
remove-double-neg92.8%
Simplified92.8%
if -1.99999999999999991e68 < a Initial program 98.5%
Final simplification97.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (* b (* a z)) (+ (+ x (* y z)) (* a t))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a * z)) + ((x + (y * z)) + (a * t));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a * z)) + ((x + (y * z)) + (a * t));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * (a * z)) + ((x + (y * z)) + (a * t)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a * z)) + Float64(Float64(x + Float64(y * z)) + Float64(a * t))) tmp = 0.0 if (t_1 <= Inf) 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 = (b * (a * z)) + ((x + (y * z)) + (a * t)); tmp = 0.0; if (t_1 <= Inf) 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[(N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision] + N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot z\right) + \left(\left(x + y \cdot z\right) + a \cdot t\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \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.4%
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*25.0%
Simplified25.0%
Taylor expanded in z around inf 66.7%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3e+222)
x
(if (<= x -1.25e+171)
(* a t)
(if (<= x -7.5e+110)
x
(if (<= x -3.2e-297)
(* y z)
(if (<= x 2.5e-140)
(* a t)
(if (<= x 820000000.0)
(* b (* a z))
(if (<= x 5e+94) (* a t) x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e+222) {
tmp = x;
} else if (x <= -1.25e+171) {
tmp = a * t;
} else if (x <= -7.5e+110) {
tmp = x;
} else if (x <= -3.2e-297) {
tmp = y * z;
} else if (x <= 2.5e-140) {
tmp = a * t;
} else if (x <= 820000000.0) {
tmp = b * (a * z);
} else if (x <= 5e+94) {
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 <= (-3d+222)) then
tmp = x
else if (x <= (-1.25d+171)) then
tmp = a * t
else if (x <= (-7.5d+110)) then
tmp = x
else if (x <= (-3.2d-297)) then
tmp = y * z
else if (x <= 2.5d-140) then
tmp = a * t
else if (x <= 820000000.0d0) then
tmp = b * (a * z)
else if (x <= 5d+94) 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 <= -3e+222) {
tmp = x;
} else if (x <= -1.25e+171) {
tmp = a * t;
} else if (x <= -7.5e+110) {
tmp = x;
} else if (x <= -3.2e-297) {
tmp = y * z;
} else if (x <= 2.5e-140) {
tmp = a * t;
} else if (x <= 820000000.0) {
tmp = b * (a * z);
} else if (x <= 5e+94) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3e+222: tmp = x elif x <= -1.25e+171: tmp = a * t elif x <= -7.5e+110: tmp = x elif x <= -3.2e-297: tmp = y * z elif x <= 2.5e-140: tmp = a * t elif x <= 820000000.0: tmp = b * (a * z) elif x <= 5e+94: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e+222) tmp = x; elseif (x <= -1.25e+171) tmp = Float64(a * t); elseif (x <= -7.5e+110) tmp = x; elseif (x <= -3.2e-297) tmp = Float64(y * z); elseif (x <= 2.5e-140) tmp = Float64(a * t); elseif (x <= 820000000.0) tmp = Float64(b * Float64(a * z)); elseif (x <= 5e+94) 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 <= -3e+222) tmp = x; elseif (x <= -1.25e+171) tmp = a * t; elseif (x <= -7.5e+110) tmp = x; elseif (x <= -3.2e-297) tmp = y * z; elseif (x <= 2.5e-140) tmp = a * t; elseif (x <= 820000000.0) tmp = b * (a * z); elseif (x <= 5e+94) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e+222], x, If[LessEqual[x, -1.25e+171], N[(a * t), $MachinePrecision], If[LessEqual[x, -7.5e+110], x, If[LessEqual[x, -3.2e-297], N[(y * z), $MachinePrecision], If[LessEqual[x, 2.5e-140], N[(a * t), $MachinePrecision], If[LessEqual[x, 820000000.0], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+94], N[(a * t), $MachinePrecision], x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+222}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{+171}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+110}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-297}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-140}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 820000000:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+94}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.00000000000000014e222 or -1.2500000000000001e171 < x < -7.5e110 or 5.0000000000000001e94 < x Initial program 100.0%
associate-+l+100.0%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around inf 64.5%
if -3.00000000000000014e222 < x < -1.2500000000000001e171 or -3.19999999999999972e-297 < x < 2.50000000000000007e-140 or 8.2e8 < x < 5.0000000000000001e94Initial program 92.6%
associate-+l+92.6%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in t around inf 79.6%
Taylor expanded in a around inf 52.4%
if -7.5e110 < x < -3.19999999999999972e-297Initial program 90.2%
associate-+l+90.2%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around inf 41.6%
*-commutative41.6%
Simplified41.6%
if 2.50000000000000007e-140 < x < 8.2e8Initial program 93.7%
associate-+l+93.7%
+-commutative93.7%
fma-def93.7%
*-commutative93.7%
associate-*l*84.8%
*-commutative84.8%
distribute-lft-out87.9%
remove-double-neg87.9%
*-commutative87.9%
distribute-lft-neg-out87.9%
sub-neg87.9%
sub-neg87.9%
distribute-lft-neg-in87.9%
remove-double-neg87.9%
Simplified87.9%
Taylor expanded in y around 0 61.5%
Taylor expanded in x around 0 55.4%
Taylor expanded in t around 0 40.4%
associate-*r*46.1%
*-commutative46.1%
associate-*l*51.6%
Simplified51.6%
Final simplification51.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b 2.6e+117) (+ (+ x (* y z)) (+ (* a (* z b)) (* a t))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 2.6e+117) {
tmp = (x + (y * z)) + ((a * (z * b)) + (a * t));
} 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.6d+117) then
tmp = (x + (y * z)) + ((a * (z * b)) + (a * t))
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.6e+117) {
tmp = (x + (y * z)) + ((a * (z * b)) + (a * t));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 2.6e+117: tmp = (x + (y * z)) + ((a * (z * b)) + (a * t)) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 2.6e+117) tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); 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.6e+117) tmp = (x + (y * z)) + ((a * (z * b)) + (a * t)); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 2.6e+117], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $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.6 \cdot 10^{+117}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < 2.5999999999999999e117Initial program 95.1%
associate-+l+95.1%
associate-*l*95.9%
Simplified95.9%
if 2.5999999999999999e117 < b Initial program 86.4%
associate-+l+86.4%
associate-*l*70.7%
Simplified70.7%
Taylor expanded in t around 0 68.4%
+-commutative68.4%
+-commutative68.4%
associate-*r*79.2%
distribute-rgt-in84.7%
Simplified84.7%
Final simplification94.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.12e+152)
(* a t)
(if (<= a -8.6e+99)
x
(if (<= a -2.7e+28)
(* a t)
(if (<= a 1.5e-265)
(* y z)
(if (<= a 2e-202) x (if (<= a 1.1e+19) (* y z) (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.12e+152) {
tmp = a * t;
} else if (a <= -8.6e+99) {
tmp = x;
} else if (a <= -2.7e+28) {
tmp = a * t;
} else if (a <= 1.5e-265) {
tmp = y * z;
} else if (a <= 2e-202) {
tmp = x;
} else if (a <= 1.1e+19) {
tmp = y * z;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.12d+152)) then
tmp = a * t
else if (a <= (-8.6d+99)) then
tmp = x
else if (a <= (-2.7d+28)) then
tmp = a * t
else if (a <= 1.5d-265) then
tmp = y * z
else if (a <= 2d-202) then
tmp = x
else if (a <= 1.1d+19) then
tmp = y * z
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.12e+152) {
tmp = a * t;
} else if (a <= -8.6e+99) {
tmp = x;
} else if (a <= -2.7e+28) {
tmp = a * t;
} else if (a <= 1.5e-265) {
tmp = y * z;
} else if (a <= 2e-202) {
tmp = x;
} else if (a <= 1.1e+19) {
tmp = y * z;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.12e+152: tmp = a * t elif a <= -8.6e+99: tmp = x elif a <= -2.7e+28: tmp = a * t elif a <= 1.5e-265: tmp = y * z elif a <= 2e-202: tmp = x elif a <= 1.1e+19: tmp = y * z else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.12e+152) tmp = Float64(a * t); elseif (a <= -8.6e+99) tmp = x; elseif (a <= -2.7e+28) tmp = Float64(a * t); elseif (a <= 1.5e-265) tmp = Float64(y * z); elseif (a <= 2e-202) tmp = x; elseif (a <= 1.1e+19) tmp = Float64(y * z); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.12e+152) tmp = a * t; elseif (a <= -8.6e+99) tmp = x; elseif (a <= -2.7e+28) tmp = a * t; elseif (a <= 1.5e-265) tmp = y * z; elseif (a <= 2e-202) tmp = x; elseif (a <= 1.1e+19) tmp = y * z; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.12e+152], N[(a * t), $MachinePrecision], If[LessEqual[a, -8.6e+99], x, If[LessEqual[a, -2.7e+28], N[(a * t), $MachinePrecision], If[LessEqual[a, 1.5e-265], N[(y * z), $MachinePrecision], If[LessEqual[a, 2e-202], x, If[LessEqual[a, 1.1e+19], N[(y * z), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{+152}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -8.6 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{+28}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-265}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-202}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+19}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.11999999999999995e152 or -8.6000000000000003e99 < a < -2.7000000000000002e28 or 1.1e19 < a Initial program 88.9%
associate-+l+88.9%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in t around inf 71.1%
Taylor expanded in a around inf 54.2%
if -1.11999999999999995e152 < a < -8.6000000000000003e99 or 1.4999999999999999e-265 < a < 2.0000000000000001e-202Initial program 89.1%
associate-+l+89.1%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around inf 46.0%
if -2.7000000000000002e28 < a < 1.4999999999999999e-265 or 2.0000000000000001e-202 < a < 1.1e19Initial program 99.1%
associate-+l+99.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 47.3%
*-commutative47.3%
Simplified47.3%
Final simplification50.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.12e+152)
(and (not (<= a -5.2e+127))
(or (<= a -22500.0) (not (<= a 2.05e+17)))))
(* a (+ t (* z b)))
(+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.12e+152) || (!(a <= -5.2e+127) && ((a <= -22500.0) || !(a <= 2.05e+17)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
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.12d+152)) .or. (.not. (a <= (-5.2d+127))) .and. (a <= (-22500.0d0)) .or. (.not. (a <= 2.05d+17))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
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.12e+152) || (!(a <= -5.2e+127) && ((a <= -22500.0) || !(a <= 2.05e+17)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.12e+152) or (not (a <= -5.2e+127) and ((a <= -22500.0) or not (a <= 2.05e+17))): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.12e+152) || (!(a <= -5.2e+127) && ((a <= -22500.0) || !(a <= 2.05e+17)))) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.12e+152) || (~((a <= -5.2e+127)) && ((a <= -22500.0) || ~((a <= 2.05e+17))))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.12e+152], And[N[Not[LessEqual[a, -5.2e+127]], $MachinePrecision], Or[LessEqual[a, -22500.0], N[Not[LessEqual[a, 2.05e+17]], $MachinePrecision]]]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{+152} \lor \neg \left(a \leq -5.2 \cdot 10^{+127}\right) \land \left(a \leq -22500 \lor \neg \left(a \leq 2.05 \cdot 10^{+17}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.11999999999999995e152 or -5.2000000000000004e127 < a < -22500 or 2.05e17 < a Initial program 89.2%
associate-+l+89.2%
+-commutative89.2%
fma-def89.2%
*-commutative89.2%
associate-*l*94.0%
*-commutative94.0%
distribute-lft-out97.4%
remove-double-neg97.4%
*-commutative97.4%
distribute-lft-neg-out97.4%
sub-neg97.4%
sub-neg97.4%
distribute-lft-neg-in97.4%
remove-double-neg97.4%
Simplified97.4%
Taylor expanded in y around 0 88.4%
Taylor expanded in x around 0 80.1%
if -1.11999999999999995e152 < a < -5.2000000000000004e127 or -22500 < a < 2.05e17Initial program 97.8%
associate-+l+97.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around 0 74.0%
Final simplification76.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))) (t_2 (* z (+ y (* a b)))))
(if (<= z -5.3e-52)
t_2
(if (<= z 3.75e-152)
t_1
(if (<= z 5.2e-61)
(* a (+ t (* z b)))
(if (<= z 2100000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -5.3e-52) {
tmp = t_2;
} else if (z <= 3.75e-152) {
tmp = t_1;
} else if (z <= 5.2e-61) {
tmp = a * (t + (z * b));
} else if (z <= 2100000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (a * t)
t_2 = z * (y + (a * b))
if (z <= (-5.3d-52)) then
tmp = t_2
else if (z <= 3.75d-152) then
tmp = t_1
else if (z <= 5.2d-61) then
tmp = a * (t + (z * b))
else if (z <= 2100000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -5.3e-52) {
tmp = t_2;
} else if (z <= 3.75e-152) {
tmp = t_1;
} else if (z <= 5.2e-61) {
tmp = a * (t + (z * b));
} else if (z <= 2100000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) t_2 = z * (y + (a * b)) tmp = 0 if z <= -5.3e-52: tmp = t_2 elif z <= 3.75e-152: tmp = t_1 elif z <= 5.2e-61: tmp = a * (t + (z * b)) elif z <= 2100000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -5.3e-52) tmp = t_2; elseif (z <= 3.75e-152) tmp = t_1; elseif (z <= 5.2e-61) tmp = Float64(a * Float64(t + Float64(z * b))); elseif (z <= 2100000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -5.3e-52) tmp = t_2; elseif (z <= 3.75e-152) tmp = t_1; elseif (z <= 5.2e-61) tmp = a * (t + (z * b)); elseif (z <= 2100000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.3e-52], t$95$2, If[LessEqual[z, 3.75e-152], t$95$1, If[LessEqual[z, 5.2e-61], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2100000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -5.3 \cdot 10^{-52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.75 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 2100000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.3000000000000003e-52 or 2.1e12 < z Initial program 88.4%
associate-+l+88.4%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in z around inf 72.9%
if -5.3000000000000003e-52 < z < 3.75e-152 or 5.20000000000000021e-61 < z < 2.1e12Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 80.2%
+-commutative80.2%
Simplified80.2%
if 3.75e-152 < z < 5.20000000000000021e-61Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-out99.9%
remove-double-neg99.9%
*-commutative99.9%
distribute-lft-neg-out99.9%
sub-neg99.9%
sub-neg99.9%
distribute-lft-neg-in99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 89.8%
Taylor expanded in x around 0 83.7%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.9e+129) (+ (* b (* a z)) (+ (* y z) (* a t))) (if (<= b 2.4e+18) (+ (+ x (* y z)) (* a t)) (+ x (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.9e+129) {
tmp = (b * (a * z)) + ((y * z) + (a * t));
} else if (b <= 2.4e+18) {
tmp = (x + (y * z)) + (a * t);
} 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 <= (-1.9d+129)) then
tmp = (b * (a * z)) + ((y * z) + (a * t))
else if (b <= 2.4d+18) then
tmp = (x + (y * z)) + (a * t)
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 <= -1.9e+129) {
tmp = (b * (a * z)) + ((y * z) + (a * t));
} else if (b <= 2.4e+18) {
tmp = (x + (y * z)) + (a * t);
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.9e+129: tmp = (b * (a * z)) + ((y * z) + (a * t)) elif b <= 2.4e+18: tmp = (x + (y * z)) + (a * t) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.9e+129) tmp = Float64(Float64(b * Float64(a * z)) + Float64(Float64(y * z) + Float64(a * t))); elseif (b <= 2.4e+18) tmp = Float64(Float64(x + Float64(y * z)) + Float64(a * t)); 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 <= -1.9e+129) tmp = (b * (a * z)) + ((y * z) + (a * t)); elseif (b <= 2.4e+18) tmp = (x + (y * z)) + (a * t); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.9e+129], N[(N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4e+18], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $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 -1.9 \cdot 10^{+129}:\\
\;\;\;\;b \cdot \left(a \cdot z\right) + \left(y \cdot z + a \cdot t\right)\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+18}:\\
\;\;\;\;\left(x + y \cdot z\right) + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.90000000000000003e129Initial program 99.9%
Taylor expanded in x around 0 87.0%
if -1.90000000000000003e129 < b < 2.4e18Initial program 94.3%
associate-+l+94.3%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in t around inf 94.0%
if 2.4e18 < b Initial program 88.8%
associate-+l+88.8%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in t around 0 69.2%
+-commutative69.2%
+-commutative69.2%
associate-*r*76.6%
distribute-rgt-in82.2%
Simplified82.2%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -2.05e+152)
(not
(or (<= a -1.05e+101) (and (not (<= a -1.55e+31)) (<= a 7.4e+18)))))
(* a t)
(+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.05e+152) || !((a <= -1.05e+101) || (!(a <= -1.55e+31) && (a <= 7.4e+18)))) {
tmp = a * t;
} else {
tmp = x + (y * z);
}
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 <= (-2.05d+152)) .or. (.not. (a <= (-1.05d+101)) .or. (.not. (a <= (-1.55d+31))) .and. (a <= 7.4d+18))) then
tmp = a * t
else
tmp = x + (y * z)
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 <= -2.05e+152) || !((a <= -1.05e+101) || (!(a <= -1.55e+31) && (a <= 7.4e+18)))) {
tmp = a * t;
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.05e+152) or not ((a <= -1.05e+101) or (not (a <= -1.55e+31) and (a <= 7.4e+18))): tmp = a * t else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.05e+152) || !((a <= -1.05e+101) || (!(a <= -1.55e+31) && (a <= 7.4e+18)))) tmp = Float64(a * t); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.05e+152) || ~(((a <= -1.05e+101) || (~((a <= -1.55e+31)) && (a <= 7.4e+18))))) tmp = a * t; else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.05e+152], N[Not[Or[LessEqual[a, -1.05e+101], And[N[Not[LessEqual[a, -1.55e+31]], $MachinePrecision], LessEqual[a, 7.4e+18]]]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+152} \lor \neg \left(a \leq -1.05 \cdot 10^{+101} \lor \neg \left(a \leq -1.55 \cdot 10^{+31}\right) \land a \leq 7.4 \cdot 10^{+18}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.0499999999999999e152 or -1.05e101 < a < -1.5500000000000001e31 or 7.4e18 < a Initial program 88.9%
associate-+l+88.9%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in t around inf 71.1%
Taylor expanded in a around inf 54.2%
if -2.0499999999999999e152 < a < -1.05e101 or -1.5500000000000001e31 < a < 7.4e18Initial program 97.3%
associate-+l+97.3%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in a around 0 72.2%
Final simplification64.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.1e+41) (not (<= z 1.8e+125))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.1e+41) || !(z <= 1.8e+125)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6.1d+41)) .or. (.not. (z <= 1.8d+125))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.1e+41) || !(z <= 1.8e+125)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.1e+41) or not (z <= 1.8e+125): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.1e+41) || !(z <= 1.8e+125)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.1e+41) || ~((z <= 1.8e+125))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.1e+41], N[Not[LessEqual[z, 1.8e+125]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.1 \cdot 10^{+41} \lor \neg \left(z \leq 1.8 \cdot 10^{+125}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -6.09999999999999998e41 or 1.8000000000000002e125 < z Initial program 86.4%
associate-+l+86.4%
associate-*l*82.3%
Simplified82.3%
Taylor expanded in z around inf 79.6%
if -6.09999999999999998e41 < z < 1.8000000000000002e125Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
fma-def98.1%
*-commutative98.1%
associate-*l*98.1%
*-commutative98.1%
distribute-lft-out100.0%
remove-double-neg100.0%
*-commutative100.0%
distribute-lft-neg-out100.0%
sub-neg100.0%
sub-neg100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 84.8%
Final simplification82.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.02e+24) (not (<= a 2.35e+15))) (+ x (* a (+ t (* z b)))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.02e+24) || !(a <= 2.35e+15)) {
tmp = x + (a * (t + (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 <= (-1.02d+24)) .or. (.not. (a <= 2.35d+15))) then
tmp = x + (a * (t + (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 <= -1.02e+24) || !(a <= 2.35e+15)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.02e+24) or not (a <= 2.35e+15): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.02e+24) || !(a <= 2.35e+15)) tmp = Float64(x + Float64(a * Float64(t + 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 <= -1.02e+24) || ~((a <= 2.35e+15))) tmp = x + (a * (t + (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, -1.02e+24], N[Not[LessEqual[a, 2.35e+15]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{+24} \lor \neg \left(a \leq 2.35 \cdot 10^{+15}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.02000000000000004e24 or 2.35e15 < a Initial program 87.8%
associate-+l+87.8%
+-commutative87.8%
fma-def87.8%
*-commutative87.8%
associate-*l*93.3%
*-commutative93.3%
distribute-lft-out96.6%
remove-double-neg96.6%
*-commutative96.6%
distribute-lft-neg-out96.6%
sub-neg96.6%
sub-neg96.6%
distribute-lft-neg-in96.6%
remove-double-neg96.6%
Simplified96.6%
Taylor expanded in y around 0 88.7%
if -1.02000000000000004e24 < a < 2.35e15Initial program 99.2%
associate-+l+99.2%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in t around 0 78.4%
+-commutative78.4%
+-commutative78.4%
associate-*r*86.2%
distribute-rgt-in86.9%
Simplified86.9%
Final simplification87.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -9.2e+86) (+ x (* a (+ t (* z b)))) (if (<= b 9.8e+17) (+ (+ x (* y z)) (* a t)) (+ x (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -9.2e+86) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 9.8e+17) {
tmp = (x + (y * z)) + (a * t);
} 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 <= (-9.2d+86)) then
tmp = x + (a * (t + (z * b)))
else if (b <= 9.8d+17) then
tmp = (x + (y * z)) + (a * t)
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 <= -9.2e+86) {
tmp = x + (a * (t + (z * b)));
} else if (b <= 9.8e+17) {
tmp = (x + (y * z)) + (a * t);
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -9.2e+86: tmp = x + (a * (t + (z * b))) elif b <= 9.8e+17: tmp = (x + (y * z)) + (a * t) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -9.2e+86) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); elseif (b <= 9.8e+17) tmp = Float64(Float64(x + Float64(y * z)) + Float64(a * t)); 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 <= -9.2e+86) tmp = x + (a * (t + (z * b))); elseif (b <= 9.8e+17) tmp = (x + (y * z)) + (a * t); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -9.2e+86], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e+17], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $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 -9.2 \cdot 10^{+86}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{+17}:\\
\;\;\;\;\left(x + y \cdot z\right) + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -9.19999999999999958e86Initial program 93.7%
associate-+l+93.7%
+-commutative93.7%
fma-def93.7%
*-commutative93.7%
associate-*l*85.7%
*-commutative85.7%
distribute-lft-out87.8%
remove-double-neg87.8%
*-commutative87.8%
distribute-lft-neg-out87.8%
sub-neg87.8%
sub-neg87.8%
distribute-lft-neg-in87.8%
remove-double-neg87.8%
Simplified87.8%
Taylor expanded in y around 0 79.4%
if -9.19999999999999958e86 < b < 9.8e17Initial program 95.6%
associate-+l+95.6%
associate-*l*99.3%
Simplified99.3%
Taylor expanded in t around inf 95.9%
if 9.8e17 < b Initial program 88.8%
associate-+l+88.8%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in t around 0 69.2%
+-commutative69.2%
+-commutative69.2%
associate-*r*76.6%
distribute-rgt-in82.2%
Simplified82.2%
Final simplification89.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3e+222)
x
(if (or (<= x -1.25e+171) (and (not (<= x -4.8e+103)) (<= x 8.6e+93)))
(* a t)
x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e+222) {
tmp = x;
} else if ((x <= -1.25e+171) || (!(x <= -4.8e+103) && (x <= 8.6e+93))) {
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 <= (-3d+222)) then
tmp = x
else if ((x <= (-1.25d+171)) .or. (.not. (x <= (-4.8d+103))) .and. (x <= 8.6d+93)) 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 <= -3e+222) {
tmp = x;
} else if ((x <= -1.25e+171) || (!(x <= -4.8e+103) && (x <= 8.6e+93))) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3e+222: tmp = x elif (x <= -1.25e+171) or (not (x <= -4.8e+103) and (x <= 8.6e+93)): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e+222) tmp = x; elseif ((x <= -1.25e+171) || (!(x <= -4.8e+103) && (x <= 8.6e+93))) 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 <= -3e+222) tmp = x; elseif ((x <= -1.25e+171) || (~((x <= -4.8e+103)) && (x <= 8.6e+93))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e+222], x, If[Or[LessEqual[x, -1.25e+171], And[N[Not[LessEqual[x, -4.8e+103]], $MachinePrecision], LessEqual[x, 8.6e+93]]], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+222}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{+171} \lor \neg \left(x \leq -4.8 \cdot 10^{+103}\right) \land x \leq 8.6 \cdot 10^{+93}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.00000000000000014e222 or -1.2500000000000001e171 < x < -4.7999999999999997e103 or 8.6e93 < x Initial program 100.0%
associate-+l+100.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in x around inf 61.9%
if -3.00000000000000014e222 < x < -1.2500000000000001e171 or -4.7999999999999997e103 < x < 8.6e93Initial program 91.5%
associate-+l+91.5%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in t around inf 75.1%
Taylor expanded in a around inf 38.9%
Final simplification45.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7e+30) (not (<= a 5e+16))) (+ x (* a t)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7e+30) || !(a <= 5e+16)) {
tmp = x + (a * t);
} else {
tmp = x + (y * z);
}
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 <= (-7d+30)) .or. (.not. (a <= 5d+16))) then
tmp = x + (a * t)
else
tmp = x + (y * z)
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 <= -7e+30) || !(a <= 5e+16)) {
tmp = x + (a * t);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7e+30) or not (a <= 5e+16): tmp = x + (a * t) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7e+30) || !(a <= 5e+16)) tmp = Float64(x + Float64(a * t)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -7e+30) || ~((a <= 5e+16))) tmp = x + (a * t); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7e+30], N[Not[LessEqual[a, 5e+16]], $MachinePrecision]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+30} \lor \neg \left(a \leq 5 \cdot 10^{+16}\right):\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -7.00000000000000042e30 or 5e16 < a Initial program 87.8%
associate-+l+87.8%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in z around 0 60.0%
+-commutative60.0%
Simplified60.0%
if -7.00000000000000042e30 < a < 5e16Initial program 99.2%
associate-+l+99.2%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around 0 72.7%
Final simplification66.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.8%
associate-+l+93.8%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around inf 23.0%
Final simplification23.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 2023334
(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)))