
(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 14 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 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 99.5%
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%
associate-*l*6.7%
Simplified6.7%
Taylor expanded in a around inf 93.3%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= b -7.6e+83)
t_1
(if (<= b -1e-45)
(* t a)
(if (<= b -4.2e-281)
x
(if (<= b 5.4e-148)
(* y z)
(if (<= b 7.5e-43)
x
(if (<= b 460000.0)
(* y z)
(if (<= b 1.95e+77) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (b <= -7.6e+83) {
tmp = t_1;
} else if (b <= -1e-45) {
tmp = t * a;
} else if (b <= -4.2e-281) {
tmp = x;
} else if (b <= 5.4e-148) {
tmp = y * z;
} else if (b <= 7.5e-43) {
tmp = x;
} else if (b <= 460000.0) {
tmp = y * z;
} else if (b <= 1.95e+77) {
tmp = t * a;
} 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 * (z * b)
if (b <= (-7.6d+83)) then
tmp = t_1
else if (b <= (-1d-45)) then
tmp = t * a
else if (b <= (-4.2d-281)) then
tmp = x
else if (b <= 5.4d-148) then
tmp = y * z
else if (b <= 7.5d-43) then
tmp = x
else if (b <= 460000.0d0) then
tmp = y * z
else if (b <= 1.95d+77) then
tmp = t * a
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 * (z * b);
double tmp;
if (b <= -7.6e+83) {
tmp = t_1;
} else if (b <= -1e-45) {
tmp = t * a;
} else if (b <= -4.2e-281) {
tmp = x;
} else if (b <= 5.4e-148) {
tmp = y * z;
} else if (b <= 7.5e-43) {
tmp = x;
} else if (b <= 460000.0) {
tmp = y * z;
} else if (b <= 1.95e+77) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if b <= -7.6e+83: tmp = t_1 elif b <= -1e-45: tmp = t * a elif b <= -4.2e-281: tmp = x elif b <= 5.4e-148: tmp = y * z elif b <= 7.5e-43: tmp = x elif b <= 460000.0: tmp = y * z elif b <= 1.95e+77: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (b <= -7.6e+83) tmp = t_1; elseif (b <= -1e-45) tmp = Float64(t * a); elseif (b <= -4.2e-281) tmp = x; elseif (b <= 5.4e-148) tmp = Float64(y * z); elseif (b <= 7.5e-43) tmp = x; elseif (b <= 460000.0) tmp = Float64(y * z); elseif (b <= 1.95e+77) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (b <= -7.6e+83) tmp = t_1; elseif (b <= -1e-45) tmp = t * a; elseif (b <= -4.2e-281) tmp = x; elseif (b <= 5.4e-148) tmp = y * z; elseif (b <= 7.5e-43) tmp = x; elseif (b <= 460000.0) tmp = y * z; elseif (b <= 1.95e+77) tmp = t * a; else tmp = t_1; 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[b, -7.6e+83], t$95$1, If[LessEqual[b, -1e-45], N[(t * a), $MachinePrecision], If[LessEqual[b, -4.2e-281], x, If[LessEqual[b, 5.4e-148], N[(y * z), $MachinePrecision], If[LessEqual[b, 7.5e-43], x, If[LessEqual[b, 460000.0], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.95e+77], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;b \leq -7.6 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1 \cdot 10^{-45}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{-148}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 460000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -7.6000000000000004e83 or 1.9499999999999999e77 < b Initial program 90.8%
associate-+l+90.8%
+-commutative90.8%
fma-def90.8%
associate-*l*82.2%
*-commutative82.2%
*-commutative82.2%
distribute-rgt-out87.2%
*-commutative87.2%
Simplified87.2%
add-cube-cbrt86.6%
pow386.7%
+-commutative86.7%
fma-def86.7%
Applied egg-rr86.7%
Taylor expanded in z around inf 71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in y around 0 57.3%
*-commutative57.3%
Simplified57.3%
if -7.6000000000000004e83 < b < -9.99999999999999984e-46 or 4.6e5 < b < 1.9499999999999999e77Initial program 95.4%
associate-+l+95.4%
*-commutative95.4%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in t around inf 47.3%
if -9.99999999999999984e-46 < b < -4.1999999999999998e-281 or 5.39999999999999976e-148 < b < 7.50000000000000068e-43Initial program 95.5%
associate-+l+95.5%
*-commutative95.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in x around inf 48.9%
if -4.1999999999999998e-281 < b < 5.39999999999999976e-148 or 7.50000000000000068e-43 < b < 4.6e5Initial program 95.7%
associate-+l+95.7%
*-commutative95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in y around inf 52.4%
*-commutative52.4%
Simplified52.4%
Final simplification52.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* z a))))
(if (<= b -7e+88)
t_1
(if (<= b -4.2e-45)
(* t a)
(if (<= b -4.2e-281)
x
(if (<= b 7.6e-148)
(* y z)
(if (<= b 5.8e-40)
x
(if (<= b 470000.0) (* y z) (if (<= b 1e+78) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (z * a);
double tmp;
if (b <= -7e+88) {
tmp = t_1;
} else if (b <= -4.2e-45) {
tmp = t * a;
} else if (b <= -4.2e-281) {
tmp = x;
} else if (b <= 7.6e-148) {
tmp = y * z;
} else if (b <= 5.8e-40) {
tmp = x;
} else if (b <= 470000.0) {
tmp = y * z;
} else if (b <= 1e+78) {
tmp = t * a;
} 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 = b * (z * a)
if (b <= (-7d+88)) then
tmp = t_1
else if (b <= (-4.2d-45)) then
tmp = t * a
else if (b <= (-4.2d-281)) then
tmp = x
else if (b <= 7.6d-148) then
tmp = y * z
else if (b <= 5.8d-40) then
tmp = x
else if (b <= 470000.0d0) then
tmp = y * z
else if (b <= 1d+78) then
tmp = t * a
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 = b * (z * a);
double tmp;
if (b <= -7e+88) {
tmp = t_1;
} else if (b <= -4.2e-45) {
tmp = t * a;
} else if (b <= -4.2e-281) {
tmp = x;
} else if (b <= 7.6e-148) {
tmp = y * z;
} else if (b <= 5.8e-40) {
tmp = x;
} else if (b <= 470000.0) {
tmp = y * z;
} else if (b <= 1e+78) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (z * a) tmp = 0 if b <= -7e+88: tmp = t_1 elif b <= -4.2e-45: tmp = t * a elif b <= -4.2e-281: tmp = x elif b <= 7.6e-148: tmp = y * z elif b <= 5.8e-40: tmp = x elif b <= 470000.0: tmp = y * z elif b <= 1e+78: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(z * a)) tmp = 0.0 if (b <= -7e+88) tmp = t_1; elseif (b <= -4.2e-45) tmp = Float64(t * a); elseif (b <= -4.2e-281) tmp = x; elseif (b <= 7.6e-148) tmp = Float64(y * z); elseif (b <= 5.8e-40) tmp = x; elseif (b <= 470000.0) tmp = Float64(y * z); elseif (b <= 1e+78) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (z * a); tmp = 0.0; if (b <= -7e+88) tmp = t_1; elseif (b <= -4.2e-45) tmp = t * a; elseif (b <= -4.2e-281) tmp = x; elseif (b <= 7.6e-148) tmp = y * z; elseif (b <= 5.8e-40) tmp = x; elseif (b <= 470000.0) tmp = y * z; elseif (b <= 1e+78) tmp = t * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7e+88], t$95$1, If[LessEqual[b, -4.2e-45], N[(t * a), $MachinePrecision], If[LessEqual[b, -4.2e-281], x, If[LessEqual[b, 7.6e-148], N[(y * z), $MachinePrecision], If[LessEqual[b, 5.8e-40], x, If[LessEqual[b, 470000.0], N[(y * z), $MachinePrecision], If[LessEqual[b, 1e+78], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;b \leq -7 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{-45}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 7.6 \cdot 10^{-148}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{-40}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 470000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 10^{+78}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -6.9999999999999995e88 or 1.00000000000000001e78 < b Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
fma-def90.7%
associate-*l*81.8%
*-commutative81.8%
*-commutative81.8%
distribute-rgt-out86.9%
*-commutative86.9%
Simplified86.9%
add-cube-cbrt86.4%
pow386.4%
+-commutative86.4%
fma-def86.4%
Applied egg-rr86.4%
Taylor expanded in z around inf 71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in y around 0 57.4%
*-commutative57.4%
associate-*r*58.4%
Simplified58.4%
if -6.9999999999999995e88 < b < -4.1999999999999999e-45 or 4.7e5 < b < 1.00000000000000001e78Initial program 95.6%
associate-+l+95.6%
*-commutative95.6%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in t around inf 47.5%
if -4.1999999999999999e-45 < b < -4.1999999999999998e-281 or 7.60000000000000028e-148 < b < 5.7999999999999998e-40Initial program 95.5%
associate-+l+95.5%
*-commutative95.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in x around inf 48.9%
if -4.1999999999999998e-281 < b < 7.60000000000000028e-148 or 5.7999999999999998e-40 < b < 4.7e5Initial program 95.7%
associate-+l+95.7%
*-commutative95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in y around inf 52.4%
*-commutative52.4%
Simplified52.4%
Final simplification52.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7.8e-30) (not (<= a 1.52e+66))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (+ (* z (* a b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7.8e-30) || !(a <= 1.52e+66)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
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 <= (-7.8d-30)) .or. (.not. (a <= 1.52d+66))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a))
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 <= -7.8e-30) || !(a <= 1.52e+66)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7.8e-30) or not (a <= 1.52e+66): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7.8e-30) || !(a <= 1.52e+66)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(z * Float64(a * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -7.8e-30) || ~((a <= 1.52e+66))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + ((z * (a * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7.8e-30], N[Not[LessEqual[a, 1.52e+66]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-30} \lor \neg \left(a \leq 1.52 \cdot 10^{+66}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if a < -7.8000000000000007e-30 or 1.52000000000000004e66 < a Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
fma-def86.8%
associate-*l*88.4%
*-commutative88.4%
*-commutative88.4%
distribute-rgt-out94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in y around 0 93.6%
if -7.8000000000000007e-30 < a < 1.52000000000000004e66Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification97.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* t a) (* y z))) (t_2 (+ x (* a (+ t (* z b))))))
(if (<= a -2.3e-39)
t_2
(if (<= a -1.12e-162)
(+ t_1 (* b (* z a)))
(if (<= a 5.5e-32) (+ x t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t * a) + (y * z);
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -2.3e-39) {
tmp = t_2;
} else if (a <= -1.12e-162) {
tmp = t_1 + (b * (z * a));
} else if (a <= 5.5e-32) {
tmp = x + 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 = (t * a) + (y * z)
t_2 = x + (a * (t + (z * b)))
if (a <= (-2.3d-39)) then
tmp = t_2
else if (a <= (-1.12d-162)) then
tmp = t_1 + (b * (z * a))
else if (a <= 5.5d-32) then
tmp = x + 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 = (t * a) + (y * z);
double t_2 = x + (a * (t + (z * b)));
double tmp;
if (a <= -2.3e-39) {
tmp = t_2;
} else if (a <= -1.12e-162) {
tmp = t_1 + (b * (z * a));
} else if (a <= 5.5e-32) {
tmp = x + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t * a) + (y * z) t_2 = x + (a * (t + (z * b))) tmp = 0 if a <= -2.3e-39: tmp = t_2 elif a <= -1.12e-162: tmp = t_1 + (b * (z * a)) elif a <= 5.5e-32: tmp = x + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t * a) + Float64(y * z)) t_2 = Float64(x + Float64(a * Float64(t + Float64(z * b)))) tmp = 0.0 if (a <= -2.3e-39) tmp = t_2; elseif (a <= -1.12e-162) tmp = Float64(t_1 + Float64(b * Float64(z * a))); elseif (a <= 5.5e-32) tmp = Float64(x + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t * a) + (y * z); t_2 = x + (a * (t + (z * b))); tmp = 0.0; if (a <= -2.3e-39) tmp = t_2; elseif (a <= -1.12e-162) tmp = t_1 + (b * (z * a)); elseif (a <= 5.5e-32) tmp = x + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.3e-39], t$95$2, If[LessEqual[a, -1.12e-162], N[(t$95$1 + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e-32], N[(x + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot a + y \cdot z\\
t_2 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{-39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.12 \cdot 10^{-162}:\\
\;\;\;\;t_1 + b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-32}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -2.30000000000000008e-39 or 5.50000000000000024e-32 < a Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
fma-def88.5%
associate-*l*89.8%
*-commutative89.8%
*-commutative89.8%
distribute-rgt-out94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in y around 0 92.9%
if -2.30000000000000008e-39 < a < -1.12e-162Initial program 99.8%
Taylor expanded in x around 0 95.3%
if -1.12e-162 < a < 5.50000000000000024e-32Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around 0 95.7%
Final simplification94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a (+ t (* z b))))))
(if (<= a -5.7e-14)
t_1
(if (<= a -1.95e-161)
(* z (+ y (* a b)))
(if (<= a 1e-118) (+ 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 + (z * b)));
double tmp;
if (a <= -5.7e-14) {
tmp = t_1;
} else if (a <= -1.95e-161) {
tmp = z * (y + (a * b));
} else if (a <= 1e-118) {
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 + (z * b)))
if (a <= (-5.7d-14)) then
tmp = t_1
else if (a <= (-1.95d-161)) then
tmp = z * (y + (a * b))
else if (a <= 1d-118) 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 + (z * b)));
double tmp;
if (a <= -5.7e-14) {
tmp = t_1;
} else if (a <= -1.95e-161) {
tmp = z * (y + (a * b));
} else if (a <= 1e-118) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * (t + (z * b))) tmp = 0 if a <= -5.7e-14: tmp = t_1 elif a <= -1.95e-161: tmp = z * (y + (a * b)) elif a <= 1e-118: 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(z * b)))) tmp = 0.0 if (a <= -5.7e-14) tmp = t_1; elseif (a <= -1.95e-161) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 1e-118) 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 + (z * b))); tmp = 0.0; if (a <= -5.7e-14) tmp = t_1; elseif (a <= -1.95e-161) tmp = z * (y + (a * b)); elseif (a <= 1e-118) 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[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.7e-14], t$95$1, If[LessEqual[a, -1.95e-161], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e-118], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -5.7 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-161}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 10^{-118}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.69999999999999969e-14 or 9.99999999999999985e-119 < a Initial program 90.3%
associate-+l+90.3%
+-commutative90.3%
fma-def90.3%
associate-*l*91.5%
*-commutative91.5%
*-commutative91.5%
distribute-rgt-out96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around 0 91.7%
if -5.69999999999999969e-14 < a < -1.94999999999999987e-161Initial program 96.3%
associate-+l+96.3%
*-commutative96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in z around inf 78.7%
if -1.94999999999999987e-161 < a < 9.99999999999999985e-119Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 91.9%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.2e-13)
(* t a)
(if (<= a -6.6e-214)
(* y z)
(if (<= a -4.9e-248)
x
(if (<= a 5e-126) (* y z) (if (<= a 1.25e-57) x (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.2e-13) {
tmp = t * a;
} else if (a <= -6.6e-214) {
tmp = y * z;
} else if (a <= -4.9e-248) {
tmp = x;
} else if (a <= 5e-126) {
tmp = y * z;
} else if (a <= 1.25e-57) {
tmp = x;
} else {
tmp = t * a;
}
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.2d-13)) then
tmp = t * a
else if (a <= (-6.6d-214)) then
tmp = y * z
else if (a <= (-4.9d-248)) then
tmp = x
else if (a <= 5d-126) then
tmp = y * z
else if (a <= 1.25d-57) then
tmp = x
else
tmp = t * a
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.2e-13) {
tmp = t * a;
} else if (a <= -6.6e-214) {
tmp = y * z;
} else if (a <= -4.9e-248) {
tmp = x;
} else if (a <= 5e-126) {
tmp = y * z;
} else if (a <= 1.25e-57) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.2e-13: tmp = t * a elif a <= -6.6e-214: tmp = y * z elif a <= -4.9e-248: tmp = x elif a <= 5e-126: tmp = y * z elif a <= 1.25e-57: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.2e-13) tmp = Float64(t * a); elseif (a <= -6.6e-214) tmp = Float64(y * z); elseif (a <= -4.9e-248) tmp = x; elseif (a <= 5e-126) tmp = Float64(y * z); elseif (a <= 1.25e-57) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.2e-13) tmp = t * a; elseif (a <= -6.6e-214) tmp = y * z; elseif (a <= -4.9e-248) tmp = x; elseif (a <= 5e-126) tmp = y * z; elseif (a <= 1.25e-57) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.2e-13], N[(t * a), $MachinePrecision], If[LessEqual[a, -6.6e-214], N[(y * z), $MachinePrecision], If[LessEqual[a, -4.9e-248], x, If[LessEqual[a, 5e-126], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.25e-57], x, N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-13}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq -6.6 \cdot 10^{-214}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq -4.9 \cdot 10^{-248}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-126}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -5.2000000000000001e-13 or 1.25e-57 < a Initial program 89.3%
associate-+l+89.3%
*-commutative89.3%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in t around inf 43.0%
if -5.2000000000000001e-13 < a < -6.5999999999999996e-214 or -4.8999999999999997e-248 < a < 5.00000000000000006e-126Initial program 98.9%
associate-+l+98.9%
*-commutative98.9%
associate-*l*98.9%
Simplified98.9%
Taylor expanded in y around inf 58.3%
*-commutative58.3%
Simplified58.3%
if -6.5999999999999996e-214 < a < -4.8999999999999997e-248 or 5.00000000000000006e-126 < a < 1.25e-57Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 65.2%
Final simplification50.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))))
(if (<= a -1.05e-13)
t_1
(if (<= a 2600000000.0)
(+ x (* y z))
(if (or (<= a 4e+196) (not (<= a 3.3e+292))) t_1 (* b (* z a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double tmp;
if (a <= -1.05e-13) {
tmp = t_1;
} else if (a <= 2600000000.0) {
tmp = x + (y * z);
} else if ((a <= 4e+196) || !(a <= 3.3e+292)) {
tmp = t_1;
} else {
tmp = b * (z * a);
}
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 + (t * a)
if (a <= (-1.05d-13)) then
tmp = t_1
else if (a <= 2600000000.0d0) then
tmp = x + (y * z)
else if ((a <= 4d+196) .or. (.not. (a <= 3.3d+292))) then
tmp = t_1
else
tmp = b * (z * a)
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 + (t * a);
double tmp;
if (a <= -1.05e-13) {
tmp = t_1;
} else if (a <= 2600000000.0) {
tmp = x + (y * z);
} else if ((a <= 4e+196) || !(a <= 3.3e+292)) {
tmp = t_1;
} else {
tmp = b * (z * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) tmp = 0 if a <= -1.05e-13: tmp = t_1 elif a <= 2600000000.0: tmp = x + (y * z) elif (a <= 4e+196) or not (a <= 3.3e+292): tmp = t_1 else: tmp = b * (z * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) tmp = 0.0 if (a <= -1.05e-13) tmp = t_1; elseif (a <= 2600000000.0) tmp = Float64(x + Float64(y * z)); elseif ((a <= 4e+196) || !(a <= 3.3e+292)) tmp = t_1; else tmp = Float64(b * Float64(z * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); tmp = 0.0; if (a <= -1.05e-13) tmp = t_1; elseif (a <= 2600000000.0) tmp = x + (y * z); elseif ((a <= 4e+196) || ~((a <= 3.3e+292))) tmp = t_1; else tmp = b * (z * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05e-13], t$95$1, If[LessEqual[a, 2600000000.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4e+196], N[Not[LessEqual[a, 3.3e+292]], $MachinePrecision]], t$95$1, N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2600000000:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+196} \lor \neg \left(a \leq 3.3 \cdot 10^{+292}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\end{array}
\end{array}
if a < -1.04999999999999994e-13 or 2.6e9 < a < 3.9999999999999998e196 or 3.3e292 < a Initial program 90.5%
associate-+l+90.5%
*-commutative90.5%
associate-*l*82.3%
Simplified82.3%
Taylor expanded in z around 0 60.7%
+-commutative60.7%
Simplified60.7%
if -1.04999999999999994e-13 < a < 2.6e9Initial program 99.2%
associate-+l+99.2%
*-commutative99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in a around 0 78.6%
if 3.9999999999999998e196 < a < 3.3e292Initial program 79.1%
associate-+l+79.1%
+-commutative79.1%
fma-def79.1%
associate-*l*83.3%
*-commutative83.3%
*-commutative83.3%
distribute-rgt-out87.4%
*-commutative87.4%
Simplified87.4%
add-cube-cbrt87.3%
pow387.3%
+-commutative87.3%
fma-def87.3%
Applied egg-rr87.3%
Taylor expanded in z around inf 59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in y around 0 66.8%
*-commutative66.8%
associate-*r*66.8%
Simplified66.8%
Final simplification70.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.75e-12)
t_1
(if (<= a -2.25e-160)
(* z (+ y (* a b)))
(if (<= a 3.8e-55) (+ x (* y z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.75e-12) {
tmp = t_1;
} else if (a <= -2.25e-160) {
tmp = z * (y + (a * b));
} else if (a <= 3.8e-55) {
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 + (z * b))
if (a <= (-1.75d-12)) then
tmp = t_1
else if (a <= (-2.25d-160)) then
tmp = z * (y + (a * b))
else if (a <= 3.8d-55) 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 + (z * b));
double tmp;
if (a <= -1.75e-12) {
tmp = t_1;
} else if (a <= -2.25e-160) {
tmp = z * (y + (a * b));
} else if (a <= 3.8e-55) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.75e-12: tmp = t_1 elif a <= -2.25e-160: tmp = z * (y + (a * b)) elif a <= 3.8e-55: 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(z * b))) tmp = 0.0 if (a <= -1.75e-12) tmp = t_1; elseif (a <= -2.25e-160) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 3.8e-55) 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 + (z * b)); tmp = 0.0; if (a <= -1.75e-12) tmp = t_1; elseif (a <= -2.25e-160) tmp = z * (y + (a * b)); elseif (a <= 3.8e-55) 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[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.75e-12], t$95$1, If[LessEqual[a, -2.25e-160], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e-55], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.75 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.25 \cdot 10^{-160}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-55}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.75e-12 or 3.7999999999999997e-55 < a Initial program 89.3%
associate-+l+89.3%
*-commutative89.3%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in a around inf 79.6%
if -1.75e-12 < a < -2.25000000000000013e-160Initial program 96.3%
associate-+l+96.3%
*-commutative96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in z around inf 78.7%
if -2.25000000000000013e-160 < a < 3.7999999999999997e-55Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around 0 88.9%
Final simplification82.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.3e-30) (not (<= a 2.5e-32))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.3e-30) || !(a <= 2.5e-32)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (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 <= (-6.3d-30)) .or. (.not. (a <= 2.5d-32))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (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 <= -6.3e-30) || !(a <= 2.5e-32)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.3e-30) or not (a <= 2.5e-32): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.3e-30) || !(a <= 2.5e-32)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.3e-30) || ~((a <= 2.5e-32))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.3e-30], N[Not[LessEqual[a, 2.5e-32]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.3 \cdot 10^{-30} \lor \neg \left(a \leq 2.5 \cdot 10^{-32}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if a < -6.29999999999999982e-30 or 2.5e-32 < a Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
fma-def88.3%
associate-*l*89.7%
*-commutative89.7%
*-commutative89.7%
distribute-rgt-out94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in y around 0 93.5%
if -6.29999999999999982e-30 < a < 2.5e-32Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in b around 0 91.2%
Final simplification92.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7e-30) (not (<= a 8e-55))) (* 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 <= -7e-30) || !(a <= 8e-55)) {
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 <= (-7d-30)) .or. (.not. (a <= 8d-55))) 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 <= -7e-30) || !(a <= 8e-55)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7e-30) or not (a <= 8e-55): 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 <= -7e-30) || !(a <= 8e-55)) 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 <= -7e-30) || ~((a <= 8e-55))) 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, -7e-30], N[Not[LessEqual[a, 8e-55]], $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 -7 \cdot 10^{-30} \lor \neg \left(a \leq 8 \cdot 10^{-55}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -7.0000000000000006e-30 or 7.99999999999999996e-55 < a Initial program 88.7%
associate-+l+88.7%
*-commutative88.7%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in a around inf 79.2%
if -7.0000000000000006e-30 < a < 7.99999999999999996e-55Initial program 99.9%
associate-+l+99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around 0 82.3%
Final simplification80.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.35e-12) (* t a) (if (<= a 7.8e+64) (+ x (* y z)) (* b (* z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.35e-12) {
tmp = t * a;
} else if (a <= 7.8e+64) {
tmp = x + (y * z);
} else {
tmp = b * (z * a);
}
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.35d-12)) then
tmp = t * a
else if (a <= 7.8d+64) then
tmp = x + (y * z)
else
tmp = b * (z * a)
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.35e-12) {
tmp = t * a;
} else if (a <= 7.8e+64) {
tmp = x + (y * z);
} else {
tmp = b * (z * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.35e-12: tmp = t * a elif a <= 7.8e+64: tmp = x + (y * z) else: tmp = b * (z * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.35e-12) tmp = Float64(t * a); elseif (a <= 7.8e+64) tmp = Float64(x + Float64(y * z)); else tmp = Float64(b * Float64(z * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.35e-12) tmp = t * a; elseif (a <= 7.8e+64) tmp = x + (y * z); else tmp = b * (z * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.35e-12], N[(t * a), $MachinePrecision], If[LessEqual[a, 7.8e+64], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.35 \cdot 10^{-12}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{+64}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\end{array}
\end{array}
if a < -2.34999999999999988e-12Initial program 86.4%
associate-+l+86.4%
*-commutative86.4%
associate-*l*80.5%
Simplified80.5%
Taylor expanded in t around inf 47.0%
if -2.34999999999999988e-12 < a < 7.7999999999999996e64Initial program 99.2%
associate-+l+99.2%
*-commutative99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in a around 0 75.9%
if 7.7999999999999996e64 < a Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
fma-def88.6%
associate-*l*90.4%
*-commutative90.4%
*-commutative90.4%
distribute-rgt-out92.3%
*-commutative92.3%
Simplified92.3%
add-cube-cbrt91.9%
pow391.9%
+-commutative91.9%
fma-def91.9%
Applied egg-rr91.9%
Taylor expanded in z around inf 51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in y around 0 52.3%
*-commutative52.3%
associate-*r*54.1%
Simplified54.1%
Final simplification63.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.9e+15) (not (<= t 1.3e-46))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.9e+15) || !(t <= 1.3e-46)) {
tmp = t * a;
} 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 ((t <= (-2.9d+15)) .or. (.not. (t <= 1.3d-46))) then
tmp = t * a
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 ((t <= -2.9e+15) || !(t <= 1.3e-46)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.9e+15) or not (t <= 1.3e-46): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.9e+15) || !(t <= 1.3e-46)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.9e+15) || ~((t <= 1.3e-46))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e+15], N[Not[LessEqual[t, 1.3e-46]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+15} \lor \neg \left(t \leq 1.3 \cdot 10^{-46}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.9e15 or 1.3000000000000001e-46 < t Initial program 90.7%
associate-+l+90.7%
*-commutative90.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around inf 46.8%
if -2.9e15 < t < 1.3000000000000001e-46Initial program 96.8%
associate-+l+96.8%
*-commutative96.8%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 32.6%
Final simplification39.8%
(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.7%
associate-+l+93.7%
*-commutative93.7%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in x around inf 22.9%
Final simplification22.9%
(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 2024024
(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)))