
(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 12 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 (<= b 5.4e+215) (+ (fma y z x) (* a (+ t (* b z)))) (+ x (* b (* a (+ z (/ t b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.4e+215) {
tmp = fma(y, z, x) + (a * (t + (b * z)));
} else {
tmp = x + (b * (a * (z + (t / b))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 5.4e+215) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(b * z)))); else tmp = Float64(x + Float64(b * Float64(a * Float64(z + Float64(t / b))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 5.4e+215], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.4 \cdot 10^{+215}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\end{array}
\end{array}
if b < 5.4e215Initial program 93.0%
associate-+l+93.0%
+-commutative93.0%
fma-define93.0%
associate-*l*95.5%
*-commutative95.5%
*-commutative95.5%
distribute-rgt-out97.2%
remove-double-neg97.2%
*-commutative97.2%
distribute-lft-neg-out97.2%
sub-neg97.2%
sub-neg97.2%
distribute-lft-neg-in97.2%
remove-double-neg97.2%
Simplified97.2%
if 5.4e215 < b Initial program 81.2%
associate-+l+81.2%
+-commutative81.2%
fma-define81.2%
associate-*l*58.3%
*-commutative58.3%
*-commutative58.3%
distribute-rgt-out64.6%
remove-double-neg64.6%
*-commutative64.6%
distribute-lft-neg-out64.6%
sub-neg64.6%
sub-neg64.6%
distribute-lft-neg-in64.6%
remove-double-neg64.6%
Simplified64.6%
Taylor expanded in y around 0 77.1%
Taylor expanded in b around inf 81.5%
associate-/l*94.0%
distribute-lft-out94.0%
Simplified94.0%
Final simplification97.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* b z))))
(if (<= a -1.05e+168)
t_1
(if (<= a -1.7e+56)
(* a t)
(if (<= a -3.5e-59)
(* z (* b a))
(if (<= a -1.15e-211)
(* y z)
(if (<= a 3.4e-34) x (if (<= a 4.2e+248) t_1 (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (b * z);
double tmp;
if (a <= -1.05e+168) {
tmp = t_1;
} else if (a <= -1.7e+56) {
tmp = a * t;
} else if (a <= -3.5e-59) {
tmp = z * (b * a);
} else if (a <= -1.15e-211) {
tmp = y * z;
} else if (a <= 3.4e-34) {
tmp = x;
} else if (a <= 4.2e+248) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (b * z)
if (a <= (-1.05d+168)) then
tmp = t_1
else if (a <= (-1.7d+56)) then
tmp = a * t
else if (a <= (-3.5d-59)) then
tmp = z * (b * a)
else if (a <= (-1.15d-211)) then
tmp = y * z
else if (a <= 3.4d-34) then
tmp = x
else if (a <= 4.2d+248) then
tmp = t_1
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (b * z);
double tmp;
if (a <= -1.05e+168) {
tmp = t_1;
} else if (a <= -1.7e+56) {
tmp = a * t;
} else if (a <= -3.5e-59) {
tmp = z * (b * a);
} else if (a <= -1.15e-211) {
tmp = y * z;
} else if (a <= 3.4e-34) {
tmp = x;
} else if (a <= 4.2e+248) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (b * z) tmp = 0 if a <= -1.05e+168: tmp = t_1 elif a <= -1.7e+56: tmp = a * t elif a <= -3.5e-59: tmp = z * (b * a) elif a <= -1.15e-211: tmp = y * z elif a <= 3.4e-34: tmp = x elif a <= 4.2e+248: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(b * z)) tmp = 0.0 if (a <= -1.05e+168) tmp = t_1; elseif (a <= -1.7e+56) tmp = Float64(a * t); elseif (a <= -3.5e-59) tmp = Float64(z * Float64(b * a)); elseif (a <= -1.15e-211) tmp = Float64(y * z); elseif (a <= 3.4e-34) tmp = x; elseif (a <= 4.2e+248) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (b * z); tmp = 0.0; if (a <= -1.05e+168) tmp = t_1; elseif (a <= -1.7e+56) tmp = a * t; elseif (a <= -3.5e-59) tmp = z * (b * a); elseif (a <= -1.15e-211) tmp = y * z; elseif (a <= 3.4e-34) tmp = x; elseif (a <= 4.2e+248) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05e+168], t$95$1, If[LessEqual[a, -1.7e+56], N[(a * t), $MachinePrecision], If[LessEqual[a, -3.5e-59], N[(z * N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.15e-211], N[(y * z), $MachinePrecision], If[LessEqual[a, 3.4e-34], x, If[LessEqual[a, 4.2e+248], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot z\right)\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{+56}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -3.5 \cdot 10^{-59}:\\
\;\;\;\;z \cdot \left(b \cdot a\right)\\
\mathbf{elif}\;a \leq -1.15 \cdot 10^{-211}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-34}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.05000000000000001e168 or 3.4000000000000001e-34 < a < 4.19999999999999977e248Initial program 82.8%
associate-+l+82.8%
+-commutative82.8%
fma-define82.8%
associate-*l*90.6%
*-commutative90.6%
*-commutative90.6%
distribute-rgt-out96.4%
remove-double-neg96.4%
*-commutative96.4%
distribute-lft-neg-out96.4%
sub-neg96.4%
sub-neg96.4%
distribute-lft-neg-in96.4%
remove-double-neg96.4%
Simplified96.4%
Taylor expanded in y around 0 89.9%
Taylor expanded in x around 0 79.3%
Taylor expanded in t around 0 55.1%
if -1.05000000000000001e168 < a < -1.7e56 or 4.19999999999999977e248 < a Initial program 91.1%
associate-+l+91.1%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in z around 0 73.9%
Taylor expanded in x around 0 58.2%
if -1.7e56 < a < -3.5000000000000001e-59Initial program 96.6%
add-cbrt-cube69.5%
pow369.5%
*-commutative69.5%
Applied egg-rr69.5%
Taylor expanded in z around inf 62.9%
+-commutative62.9%
Simplified62.9%
Taylor expanded in a around inf 50.1%
if -3.5000000000000001e-59 < a < -1.14999999999999994e-211Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
distribute-rgt-out95.1%
remove-double-neg95.1%
*-commutative95.1%
distribute-lft-neg-out95.1%
sub-neg95.1%
sub-neg95.1%
distribute-lft-neg-in95.1%
remove-double-neg95.1%
Simplified95.1%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in t around inf 79.3%
Taylor expanded in z around inf 56.3%
*-commutative56.3%
Simplified56.3%
if -1.14999999999999994e-211 < a < 3.4000000000000001e-34Initial program 98.6%
associate-+l+98.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in z around 0 53.7%
Taylor expanded in x around inf 46.8%
Final simplification52.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= (+ (+ t_1 (* a t)) (* b (* z a))) INFINITY)
(+ t_1 (+ (* a t) (* a (* b z))))
(+ x (* a (+ t (* b z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((t_1 + (a * t)) + (b * (z * a))) <= ((double) INFINITY)) {
tmp = t_1 + ((a * t) + (a * (b * z)));
} else {
tmp = x + (a * (t + (b * z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((t_1 + (a * t)) + (b * (z * a))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + ((a * t) + (a * (b * z)));
} else {
tmp = x + (a * (t + (b * z)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if ((t_1 + (a * t)) + (b * (z * a))) <= math.inf: tmp = t_1 + ((a * t) + (a * (b * z))) else: tmp = x + (a * (t + (b * z))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (Float64(Float64(t_1 + Float64(a * t)) + Float64(b * Float64(z * a))) <= Inf) tmp = Float64(t_1 + Float64(Float64(a * t) + Float64(a * Float64(b * z)))); else tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (((t_1 + (a * t)) + (b * (z * a))) <= Inf) tmp = t_1 + ((a * t) + (a * (b * z))); else tmp = x + (a * (t + (b * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $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[(a * t), $MachinePrecision] + N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;\left(t\_1 + a \cdot t\right) + b \cdot \left(z \cdot a\right) \leq \infty:\\
\;\;\;\;t\_1 + \left(a \cdot t + a \cdot \left(b \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 96.8%
associate-+l+96.8%
associate-*l*97.4%
Simplified97.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%
+-commutative0.0%
fma-define0.0%
associate-*l*8.3%
*-commutative8.3%
*-commutative8.3%
distribute-rgt-out50.0%
remove-double-neg50.0%
*-commutative50.0%
distribute-lft-neg-out50.0%
sub-neg50.0%
sub-neg50.0%
distribute-lft-neg-in50.0%
remove-double-neg50.0%
Simplified50.0%
Taylor expanded in y around 0 83.3%
Final simplification96.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* b z))))
(if (<= a -7.2e-59)
t_1
(if (<= a -2.05e-210)
(* y z)
(if (<= a 5.1e-28) x (if (<= a 2.3e+247) t_1 (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (b * z);
double tmp;
if (a <= -7.2e-59) {
tmp = t_1;
} else if (a <= -2.05e-210) {
tmp = y * z;
} else if (a <= 5.1e-28) {
tmp = x;
} else if (a <= 2.3e+247) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (b * z)
if (a <= (-7.2d-59)) then
tmp = t_1
else if (a <= (-2.05d-210)) then
tmp = y * z
else if (a <= 5.1d-28) then
tmp = x
else if (a <= 2.3d+247) then
tmp = t_1
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (b * z);
double tmp;
if (a <= -7.2e-59) {
tmp = t_1;
} else if (a <= -2.05e-210) {
tmp = y * z;
} else if (a <= 5.1e-28) {
tmp = x;
} else if (a <= 2.3e+247) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (b * z) tmp = 0 if a <= -7.2e-59: tmp = t_1 elif a <= -2.05e-210: tmp = y * z elif a <= 5.1e-28: tmp = x elif a <= 2.3e+247: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(b * z)) tmp = 0.0 if (a <= -7.2e-59) tmp = t_1; elseif (a <= -2.05e-210) tmp = Float64(y * z); elseif (a <= 5.1e-28) tmp = x; elseif (a <= 2.3e+247) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (b * z); tmp = 0.0; if (a <= -7.2e-59) tmp = t_1; elseif (a <= -2.05e-210) tmp = y * z; elseif (a <= 5.1e-28) tmp = x; elseif (a <= 2.3e+247) tmp = t_1; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.2e-59], t$95$1, If[LessEqual[a, -2.05e-210], N[(y * z), $MachinePrecision], If[LessEqual[a, 5.1e-28], x, If[LessEqual[a, 2.3e+247], t$95$1, N[(a * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot z\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.05 \cdot 10^{-210}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -7.20000000000000001e-59 or 5.10000000000000009e-28 < a < 2.29999999999999991e247Initial program 86.9%
associate-+l+86.9%
+-commutative86.9%
fma-define86.9%
associate-*l*91.7%
*-commutative91.7%
*-commutative91.7%
distribute-rgt-out95.1%
remove-double-neg95.1%
*-commutative95.1%
distribute-lft-neg-out95.1%
sub-neg95.1%
sub-neg95.1%
distribute-lft-neg-in95.1%
remove-double-neg95.1%
Simplified95.1%
Taylor expanded in y around 0 89.2%
Taylor expanded in x around 0 75.0%
Taylor expanded in t around 0 47.7%
if -7.20000000000000001e-59 < a < -2.04999999999999995e-210Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
distribute-rgt-out95.1%
remove-double-neg95.1%
*-commutative95.1%
distribute-lft-neg-out95.1%
sub-neg95.1%
sub-neg95.1%
distribute-lft-neg-in95.1%
remove-double-neg95.1%
Simplified95.1%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in t around inf 79.3%
Taylor expanded in z around inf 56.3%
*-commutative56.3%
Simplified56.3%
if -2.04999999999999995e-210 < a < 5.10000000000000009e-28Initial program 98.6%
associate-+l+98.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in z around 0 53.7%
Taylor expanded in x around inf 46.8%
if 2.29999999999999991e247 < a Initial program 99.8%
associate-+l+99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around 0 93.7%
Taylor expanded in x around 0 79.9%
Final simplification49.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* b z))))))
(if (<= a -1.72e-59)
t_1
(if (<= a -1.25e-135)
(+ (* a t) (* y z))
(if (<= a 1.35e-35) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * (t + (b * z)));
double tmp;
if (a <= -1.72e-59) {
tmp = t_1;
} else if (a <= -1.25e-135) {
tmp = (a * t) + (y * z);
} else if (a <= 1.35e-35) {
tmp = x + (y * z);
} 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 = x + (a * (t + (b * z)))
if (a <= (-1.72d-59)) then
tmp = t_1
else if (a <= (-1.25d-135)) then
tmp = (a * t) + (y * z)
else if (a <= 1.35d-35) then
tmp = x + (y * z)
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 = x + (a * (t + (b * z)));
double tmp;
if (a <= -1.72e-59) {
tmp = t_1;
} else if (a <= -1.25e-135) {
tmp = (a * t) + (y * z);
} else if (a <= 1.35e-35) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (b * z))) tmp = 0 if a <= -1.72e-59: tmp = t_1 elif a <= -1.25e-135: tmp = (a * t) + (y * z) elif a <= 1.35e-35: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * Float64(t + Float64(b * z)))) tmp = 0.0 if (a <= -1.72e-59) tmp = t_1; elseif (a <= -1.25e-135) tmp = Float64(Float64(a * t) + Float64(y * z)); elseif (a <= 1.35e-35) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * (t + (b * z))); tmp = 0.0; if (a <= -1.72e-59) tmp = t_1; elseif (a <= -1.25e-135) tmp = (a * t) + (y * z); elseif (a <= 1.35e-35) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.72e-59], t$95$1, If[LessEqual[a, -1.25e-135], N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.35e-35], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{if}\;a \leq -1.72 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-135}:\\
\;\;\;\;a \cdot t + y \cdot z\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-35}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.72e-59 or 1.3499999999999999e-35 < a Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
fma-define87.7%
associate-*l*91.6%
*-commutative91.6%
*-commutative91.6%
distribute-rgt-out94.9%
remove-double-neg94.9%
*-commutative94.9%
distribute-lft-neg-out94.9%
sub-neg94.9%
sub-neg94.9%
distribute-lft-neg-in94.9%
remove-double-neg94.9%
Simplified94.9%
Taylor expanded in y around 0 89.1%
if -1.72e-59 < a < -1.25000000000000005e-135Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*95.9%
*-commutative95.9%
*-commutative95.9%
distribute-rgt-out95.9%
remove-double-neg95.9%
*-commutative95.9%
distribute-lft-neg-out95.9%
sub-neg95.9%
sub-neg95.9%
distribute-lft-neg-in95.9%
remove-double-neg95.9%
Simplified95.9%
Taylor expanded in y around inf 91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in t around inf 87.5%
if -1.25000000000000005e-135 < a < 1.3499999999999999e-35Initial program 98.8%
add-cbrt-cube91.4%
pow391.4%
*-commutative91.4%
Applied egg-rr91.4%
Taylor expanded in a around 0 84.8%
Final simplification87.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* b z)))))
(if (<= a -3.5e-59)
t_1
(if (<= a -7.5e-138)
(+ (* a t) (* y z))
(if (<= a 7e+69) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (b * z));
double tmp;
if (a <= -3.5e-59) {
tmp = t_1;
} else if (a <= -7.5e-138) {
tmp = (a * t) + (y * z);
} else if (a <= 7e+69) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (t + (b * z))
if (a <= (-3.5d-59)) then
tmp = t_1
else if (a <= (-7.5d-138)) then
tmp = (a * t) + (y * z)
else if (a <= 7d+69) then
tmp = x + (y * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (b * z));
double tmp;
if (a <= -3.5e-59) {
tmp = t_1;
} else if (a <= -7.5e-138) {
tmp = (a * t) + (y * z);
} else if (a <= 7e+69) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (b * z)) tmp = 0 if a <= -3.5e-59: tmp = t_1 elif a <= -7.5e-138: tmp = (a * t) + (y * z) elif a <= 7e+69: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(b * z))) tmp = 0.0 if (a <= -3.5e-59) tmp = t_1; elseif (a <= -7.5e-138) tmp = Float64(Float64(a * t) + Float64(y * z)); elseif (a <= 7e+69) tmp = Float64(x + Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (b * z)); tmp = 0.0; if (a <= -3.5e-59) tmp = t_1; elseif (a <= -7.5e-138) tmp = (a * t) + (y * z); elseif (a <= 7e+69) tmp = x + (y * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.5e-59], t$95$1, If[LessEqual[a, -7.5e-138], N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+69], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + b \cdot z\right)\\
\mathbf{if}\;a \leq -3.5 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-138}:\\
\;\;\;\;a \cdot t + y \cdot z\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+69}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.5000000000000001e-59 or 6.99999999999999974e69 < a Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
fma-define86.1%
associate-*l*91.1%
*-commutative91.1%
*-commutative91.1%
distribute-rgt-out94.8%
remove-double-neg94.8%
*-commutative94.8%
distribute-lft-neg-out94.8%
sub-neg94.8%
sub-neg94.8%
distribute-lft-neg-in94.8%
remove-double-neg94.8%
Simplified94.8%
Taylor expanded in y around 0 92.2%
Taylor expanded in x around 0 78.1%
if -3.5000000000000001e-59 < a < -7.4999999999999995e-138Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
associate-*l*95.9%
*-commutative95.9%
*-commutative95.9%
distribute-rgt-out95.9%
remove-double-neg95.9%
*-commutative95.9%
distribute-lft-neg-out95.9%
sub-neg95.9%
sub-neg95.9%
distribute-lft-neg-in95.9%
remove-double-neg95.9%
Simplified95.9%
Taylor expanded in y around inf 91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in t around inf 87.5%
if -7.4999999999999995e-138 < a < 6.99999999999999974e69Initial program 99.0%
add-cbrt-cube90.0%
pow390.0%
*-commutative90.0%
Applied egg-rr90.0%
Taylor expanded in a around 0 79.6%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -9.5e+125)
(* y z)
(if (or (<= z -5.7e+57) (not (<= z 1.55e+79)))
(* z (* b a))
(+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.5e+125) {
tmp = y * z;
} else if ((z <= -5.7e+57) || !(z <= 1.55e+79)) {
tmp = z * (b * a);
} 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 <= (-9.5d+125)) then
tmp = y * z
else if ((z <= (-5.7d+57)) .or. (.not. (z <= 1.55d+79))) then
tmp = z * (b * a)
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 <= -9.5e+125) {
tmp = y * z;
} else if ((z <= -5.7e+57) || !(z <= 1.55e+79)) {
tmp = z * (b * a);
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -9.5e+125: tmp = y * z elif (z <= -5.7e+57) or not (z <= 1.55e+79): tmp = z * (b * a) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.5e+125) tmp = Float64(y * z); elseif ((z <= -5.7e+57) || !(z <= 1.55e+79)) tmp = Float64(z * Float64(b * a)); 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 <= -9.5e+125) tmp = y * z; elseif ((z <= -5.7e+57) || ~((z <= 1.55e+79))) tmp = z * (b * a); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.5e+125], N[(y * z), $MachinePrecision], If[Or[LessEqual[z, -5.7e+57], N[Not[LessEqual[z, 1.55e+79]], $MachinePrecision]], N[(z * N[(b * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+125}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -5.7 \cdot 10^{+57} \lor \neg \left(z \leq 1.55 \cdot 10^{+79}\right):\\
\;\;\;\;z \cdot \left(b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -9.50000000000000041e125Initial program 83.1%
associate-+l+83.1%
+-commutative83.1%
fma-define83.1%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
distribute-rgt-out97.0%
remove-double-neg97.0%
*-commutative97.0%
distribute-lft-neg-out97.0%
sub-neg97.0%
sub-neg97.0%
distribute-lft-neg-in97.0%
remove-double-neg97.0%
Simplified97.0%
Taylor expanded in y around inf 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 68.9%
Taylor expanded in z around inf 53.9%
*-commutative53.9%
Simplified53.9%
if -9.50000000000000041e125 < z < -5.6999999999999998e57 or 1.5499999999999999e79 < z Initial program 85.7%
add-cbrt-cube69.6%
pow369.6%
*-commutative69.6%
Applied egg-rr69.6%
Taylor expanded in z around inf 82.6%
+-commutative82.6%
Simplified82.6%
Taylor expanded in a around inf 61.1%
if -5.6999999999999998e57 < z < 1.5499999999999999e79Initial program 97.9%
associate-+l+97.9%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in z around 0 69.7%
Final simplification65.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= y -4.5e+76)
t_1
(if (<= y -2.15e-58)
(* z (* b a))
(if (<= y 1.6e+49) (+ x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (y <= -4.5e+76) {
tmp = t_1;
} else if (y <= -2.15e-58) {
tmp = z * (b * a);
} else if (y <= 1.6e+49) {
tmp = x + (a * t);
} 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 = x + (y * z)
if (y <= (-4.5d+76)) then
tmp = t_1
else if (y <= (-2.15d-58)) then
tmp = z * (b * a)
else if (y <= 1.6d+49) then
tmp = x + (a * t)
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 = x + (y * z);
double tmp;
if (y <= -4.5e+76) {
tmp = t_1;
} else if (y <= -2.15e-58) {
tmp = z * (b * a);
} else if (y <= 1.6e+49) {
tmp = x + (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if y <= -4.5e+76: tmp = t_1 elif y <= -2.15e-58: tmp = z * (b * a) elif y <= 1.6e+49: tmp = x + (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (y <= -4.5e+76) tmp = t_1; elseif (y <= -2.15e-58) tmp = Float64(z * Float64(b * a)); elseif (y <= 1.6e+49) tmp = Float64(x + Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (y <= -4.5e+76) tmp = t_1; elseif (y <= -2.15e-58) tmp = z * (b * a); elseif (y <= 1.6e+49) tmp = x + (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e+76], t$95$1, If[LessEqual[y, -2.15e-58], N[(z * N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+49], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.15 \cdot 10^{-58}:\\
\;\;\;\;z \cdot \left(b \cdot a\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+49}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.4999999999999997e76 or 1.60000000000000007e49 < y Initial program 95.0%
add-cbrt-cube85.3%
pow385.3%
*-commutative85.3%
Applied egg-rr85.3%
Taylor expanded in a around 0 71.9%
if -4.4999999999999997e76 < y < -2.15e-58Initial program 92.0%
add-cbrt-cube65.2%
pow365.2%
*-commutative65.2%
Applied egg-rr65.2%
Taylor expanded in z around inf 76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in a around inf 61.0%
if -2.15e-58 < y < 1.60000000000000007e49Initial program 90.2%
associate-+l+90.2%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in z around 0 62.4%
Final simplification66.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5.3e-59) (not (<= a 1.65e-35))) (+ x (* a (+ t (* b z)))) (+ x (+ (* a t) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5.3e-59) || !(a <= 1.65e-35)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (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 <= (-5.3d-59)) .or. (.not. (a <= 1.65d-35))) then
tmp = x + (a * (t + (b * z)))
else
tmp = x + ((a * t) + (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 <= -5.3e-59) || !(a <= 1.65e-35)) {
tmp = x + (a * (t + (b * z)));
} else {
tmp = x + ((a * t) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5.3e-59) or not (a <= 1.65e-35): tmp = x + (a * (t + (b * z))) else: tmp = x + ((a * t) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5.3e-59) || !(a <= 1.65e-35)) tmp = Float64(x + Float64(a * Float64(t + Float64(b * z)))); else tmp = Float64(x + Float64(Float64(a * t) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -5.3e-59) || ~((a <= 1.65e-35))) tmp = x + (a * (t + (b * z))); else tmp = x + ((a * t) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5.3e-59], N[Not[LessEqual[a, 1.65e-35]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.3 \cdot 10^{-59} \lor \neg \left(a \leq 1.65 \cdot 10^{-35}\right):\\
\;\;\;\;x + a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot t + y \cdot z\right)\\
\end{array}
\end{array}
if a < -5.3000000000000003e-59 or 1.65e-35 < a Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
fma-define87.7%
associate-*l*91.6%
*-commutative91.6%
*-commutative91.6%
distribute-rgt-out94.9%
remove-double-neg94.9%
*-commutative94.9%
distribute-lft-neg-out94.9%
sub-neg94.9%
sub-neg94.9%
distribute-lft-neg-in94.9%
remove-double-neg94.9%
Simplified94.9%
Taylor expanded in y around 0 89.1%
if -5.3000000000000003e-59 < a < 1.65e-35Initial program 99.0%
associate-+l+99.0%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in b around 0 92.6%
Final simplification90.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.15e-106) (not (<= a 1.55e+72))) (* a (+ t (* b z))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.15e-106) || !(a <= 1.55e+72)) {
tmp = a * (t + (b * z));
} 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 <= (-4.15d-106)) .or. (.not. (a <= 1.55d+72))) then
tmp = a * (t + (b * z))
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 <= -4.15e-106) || !(a <= 1.55e+72)) {
tmp = a * (t + (b * z));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.15e-106) or not (a <= 1.55e+72): tmp = a * (t + (b * z)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.15e-106) || !(a <= 1.55e+72)) tmp = Float64(a * Float64(t + Float64(b * z))); 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 <= -4.15e-106) || ~((a <= 1.55e+72))) tmp = a * (t + (b * z)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.15e-106], N[Not[LessEqual[a, 1.55e+72]], $MachinePrecision]], N[(a * N[(t + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.15 \cdot 10^{-106} \lor \neg \left(a \leq 1.55 \cdot 10^{+72}\right):\\
\;\;\;\;a \cdot \left(t + b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -4.15000000000000023e-106 or 1.54999999999999994e72 < a Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
fma-define87.2%
associate-*l*91.2%
*-commutative91.2%
*-commutative91.2%
distribute-rgt-out94.6%
remove-double-neg94.6%
*-commutative94.6%
distribute-lft-neg-out94.6%
sub-neg94.6%
sub-neg94.6%
distribute-lft-neg-in94.6%
remove-double-neg94.6%
Simplified94.6%
Taylor expanded in y around 0 88.9%
Taylor expanded in x around 0 75.9%
if -4.15000000000000023e-106 < a < 1.54999999999999994e72Initial program 99.1%
add-cbrt-cube90.0%
pow390.0%
*-commutative90.0%
Applied egg-rr90.0%
Taylor expanded in a around 0 79.8%
Final simplification77.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.3e+31) x (if (<= x 2.9e+105) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.3e+31) {
tmp = x;
} else if (x <= 2.9e+105) {
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 <= (-3.3d+31)) then
tmp = x
else if (x <= 2.9d+105) 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 <= -3.3e+31) {
tmp = x;
} else if (x <= 2.9e+105) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.3e+31: tmp = x elif x <= 2.9e+105: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.3e+31) tmp = x; elseif (x <= 2.9e+105) 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 <= -3.3e+31) tmp = x; elseif (x <= 2.9e+105) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.3e+31], x, If[LessEqual[x, 2.9e+105], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+105}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.29999999999999992e31 or 2.9000000000000001e105 < x Initial program 90.5%
associate-+l+90.5%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in z around 0 61.8%
Taylor expanded in x around inf 57.1%
if -3.29999999999999992e31 < x < 2.9000000000000001e105Initial program 93.1%
associate-+l+93.1%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in z around 0 42.3%
Taylor expanded in x around 0 36.1%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 92.3%
associate-+l+92.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in z around 0 48.7%
Taylor expanded in x around inf 24.5%
(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 2024143
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))