
(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 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (if (<= t_1 1e+261) t_1 (fma z (fma a b y) (fma t a x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 1e+261) {
tmp = t_1;
} else {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 1e+261) tmp = t_1; else tmp = fma(z, fma(a, b, y), fma(t, a, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+261], t$95$1, N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t_1 \leq 10^{+261}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 9.9999999999999993e260Initial program 99.9%
if 9.9999999999999993e260 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 77.1%
+-commutative77.1%
+-commutative77.1%
associate-+l+77.1%
associate-+r+77.1%
*-commutative77.1%
associate-*l*85.7%
*-commutative85.7%
distribute-lft-out94.6%
fma-def94.6%
fma-def94.6%
+-commutative94.6%
fma-def94.6%
Simplified94.6%
Final simplification98.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
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 = ((t * a) + (x + (y * z))) + ((z * a) * b) 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(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) 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 = ((t * a) + (x + (y * z))) + ((z * a) * b); 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[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $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 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\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.8%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
associate-+r+0.0%
*-commutative0.0%
associate-*l*20.0%
*-commutative20.0%
distribute-lft-out70.0%
fma-def70.0%
fma-def70.0%
+-commutative70.0%
fma-def70.0%
Simplified70.0%
Taylor expanded in z around inf 90.0%
Final simplification98.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.35e+124) (not (<= z 3.3e+84))) (+ x (* z (+ y (* a b)))) (+ (+ (* a (* z b)) (* t a)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+124) || !(z <= 3.3e+84)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = ((a * (z * b)) + (t * a)) + (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 ((z <= (-1.35d+124)) .or. (.not. (z <= 3.3d+84))) then
tmp = x + (z * (y + (a * b)))
else
tmp = ((a * (z * b)) + (t * a)) + (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 ((z <= -1.35e+124) || !(z <= 3.3e+84)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.35e+124) or not (z <= 3.3e+84): tmp = x + (z * (y + (a * b))) else: tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.35e+124) || !(z <= 3.3e+84)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(t * a)) + Float64(x + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.35e+124) || ~((z <= 3.3e+84))) tmp = x + (z * (y + (a * b))); else tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e+124], N[Not[LessEqual[z, 3.3e+84]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+124} \lor \neg \left(z \leq 3.3 \cdot 10^{+84}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.34999999999999989e124 or 3.30000000000000017e84 < z Initial program 87.8%
+-commutative87.8%
+-commutative87.8%
associate-+l+87.8%
associate-+r+87.8%
*-commutative87.8%
associate-*l*91.7%
*-commutative91.7%
distribute-lft-out96.9%
fma-def96.9%
fma-def96.9%
+-commutative96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in t around 0 97.9%
if -1.34999999999999989e124 < z < 3.30000000000000017e84Initial program 99.3%
associate-+l+99.3%
associate-*l*98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -5.9e+66)
t_1
(if (<= a -1.85e-152)
x
(if (<= a 9.2e-293)
(* y z)
(if (<= a 1.65e-222)
x
(if (<= a 2.3e-57) (* y z) (if (<= a 0.04) x 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 (a <= -5.9e+66) {
tmp = t_1;
} else if (a <= -1.85e-152) {
tmp = x;
} else if (a <= 9.2e-293) {
tmp = y * z;
} else if (a <= 1.65e-222) {
tmp = x;
} else if (a <= 2.3e-57) {
tmp = y * z;
} else if (a <= 0.04) {
tmp = 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 = a * (z * b)
if (a <= (-5.9d+66)) then
tmp = t_1
else if (a <= (-1.85d-152)) then
tmp = x
else if (a <= 9.2d-293) then
tmp = y * z
else if (a <= 1.65d-222) then
tmp = x
else if (a <= 2.3d-57) then
tmp = y * z
else if (a <= 0.04d0) then
tmp = 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 = a * (z * b);
double tmp;
if (a <= -5.9e+66) {
tmp = t_1;
} else if (a <= -1.85e-152) {
tmp = x;
} else if (a <= 9.2e-293) {
tmp = y * z;
} else if (a <= 1.65e-222) {
tmp = x;
} else if (a <= 2.3e-57) {
tmp = y * z;
} else if (a <= 0.04) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -5.9e+66: tmp = t_1 elif a <= -1.85e-152: tmp = x elif a <= 9.2e-293: tmp = y * z elif a <= 1.65e-222: tmp = x elif a <= 2.3e-57: tmp = y * z elif a <= 0.04: tmp = x 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 (a <= -5.9e+66) tmp = t_1; elseif (a <= -1.85e-152) tmp = x; elseif (a <= 9.2e-293) tmp = Float64(y * z); elseif (a <= 1.65e-222) tmp = x; elseif (a <= 2.3e-57) tmp = Float64(y * z); elseif (a <= 0.04) tmp = x; 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 (a <= -5.9e+66) tmp = t_1; elseif (a <= -1.85e-152) tmp = x; elseif (a <= 9.2e-293) tmp = y * z; elseif (a <= 1.65e-222) tmp = x; elseif (a <= 2.3e-57) tmp = y * z; elseif (a <= 0.04) tmp = x; 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[a, -5.9e+66], t$95$1, If[LessEqual[a, -1.85e-152], x, If[LessEqual[a, 9.2e-293], N[(y * z), $MachinePrecision], If[LessEqual[a, 1.65e-222], x, If[LessEqual[a, 2.3e-57], N[(y * z), $MachinePrecision], If[LessEqual[a, 0.04], x, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -5.9 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-152}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{-293}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-222}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-57}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 0.04:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.89999999999999988e66 or 0.0400000000000000008 < a Initial program 90.2%
+-commutative90.2%
+-commutative90.2%
associate-+l+90.2%
associate-+r+90.2%
*-commutative90.2%
associate-*l*89.3%
*-commutative89.3%
distribute-lft-out91.3%
fma-def91.3%
fma-def91.3%
+-commutative91.3%
fma-def91.3%
Simplified91.3%
Taylor expanded in b around inf 47.2%
*-commutative47.2%
Simplified47.2%
if -5.89999999999999988e66 < a < -1.8499999999999999e-152 or 9.1999999999999998e-293 < a < 1.65000000000000001e-222 or 2.3e-57 < a < 0.0400000000000000008Initial program 98.6%
+-commutative98.6%
+-commutative98.6%
associate-+l+98.6%
associate-+r+98.6%
*-commutative98.6%
associate-*l*98.7%
*-commutative98.7%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around inf 52.4%
if -1.8499999999999999e-152 < a < 9.1999999999999998e-293 or 1.65000000000000001e-222 < a < 2.3e-57Initial program 97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l+97.4%
associate-+r+97.4%
*-commutative97.4%
associate-*l*97.4%
*-commutative97.4%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in y around inf 58.0%
*-commutative58.0%
Simplified58.0%
Final simplification52.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -10000.0) (not (<= z 1.9e+78))) (+ x (* z (+ y (* a b)))) (+ (+ x (* t a)) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -10000.0) || !(z <= 1.9e+78)) {
tmp = x + (z * (y + (a * 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 ((z <= (-10000.0d0)) .or. (.not. (z <= 1.9d+78))) then
tmp = x + (z * (y + (a * 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 ((z <= -10000.0) || !(z <= 1.9e+78)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (t * a)) + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -10000.0) or not (z <= 1.9e+78): tmp = x + (z * (y + (a * b))) else: tmp = (x + (t * a)) + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -10000.0) || !(z <= 1.9e+78)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(x + Float64(t * a)) + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -10000.0) || ~((z <= 1.9e+78))) tmp = x + (z * (y + (a * b))); else tmp = (x + (t * a)) + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -10000.0], N[Not[LessEqual[z, 1.9e+78]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10000 \lor \neg \left(z \leq 1.9 \cdot 10^{+78}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\end{array}
\end{array}
if z < -1e4 or 1.9e78 < z Initial program 90.3%
+-commutative90.3%
+-commutative90.3%
associate-+l+90.3%
associate-+r+90.3%
*-commutative90.3%
associate-*l*93.4%
*-commutative93.4%
distribute-lft-out97.5%
fma-def97.5%
fma-def97.5%
+-commutative97.5%
fma-def97.5%
Simplified97.5%
Taylor expanded in t around 0 94.4%
if -1e4 < z < 1.9e78Initial program 99.2%
+-commutative99.2%
+-commutative99.2%
associate-+l+99.2%
associate-+r+99.2%
*-commutative99.2%
associate-*l*95.7%
*-commutative95.7%
distribute-lft-out95.7%
fma-def95.7%
fma-def95.7%
+-commutative95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in b around 0 90.4%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -8.2e-13)
(* y z)
(if (<= y 3.3e-237)
x
(if (<= y 2.9e-127) (* t a) (if (<= y 1.05e+127) x (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.2e-13) {
tmp = y * z;
} else if (y <= 3.3e-237) {
tmp = x;
} else if (y <= 2.9e-127) {
tmp = t * a;
} else if (y <= 1.05e+127) {
tmp = x;
} else {
tmp = 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 (y <= (-8.2d-13)) then
tmp = y * z
else if (y <= 3.3d-237) then
tmp = x
else if (y <= 2.9d-127) then
tmp = t * a
else if (y <= 1.05d+127) then
tmp = x
else
tmp = 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 (y <= -8.2e-13) {
tmp = y * z;
} else if (y <= 3.3e-237) {
tmp = x;
} else if (y <= 2.9e-127) {
tmp = t * a;
} else if (y <= 1.05e+127) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.2e-13: tmp = y * z elif y <= 3.3e-237: tmp = x elif y <= 2.9e-127: tmp = t * a elif y <= 1.05e+127: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.2e-13) tmp = Float64(y * z); elseif (y <= 3.3e-237) tmp = x; elseif (y <= 2.9e-127) tmp = Float64(t * a); elseif (y <= 1.05e+127) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8.2e-13) tmp = y * z; elseif (y <= 3.3e-237) tmp = x; elseif (y <= 2.9e-127) tmp = t * a; elseif (y <= 1.05e+127) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.2e-13], N[(y * z), $MachinePrecision], If[LessEqual[y, 3.3e-237], x, If[LessEqual[y, 2.9e-127], N[(t * a), $MachinePrecision], If[LessEqual[y, 1.05e+127], x, N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-13}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-237}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-127}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+127}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -8.2000000000000004e-13 or 1.04999999999999996e127 < y Initial program 94.5%
+-commutative94.5%
+-commutative94.5%
associate-+l+94.5%
associate-+r+94.5%
*-commutative94.5%
associate-*l*93.8%
*-commutative93.8%
distribute-lft-out97.4%
fma-def97.4%
fma-def97.4%
+-commutative97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in y around inf 57.5%
*-commutative57.5%
Simplified57.5%
if -8.2000000000000004e-13 < y < 3.3000000000000001e-237 or 2.9e-127 < y < 1.04999999999999996e127Initial program 94.4%
+-commutative94.4%
+-commutative94.4%
associate-+l+94.4%
associate-+r+94.4%
*-commutative94.4%
associate-*l*95.1%
*-commutative95.1%
distribute-lft-out95.9%
fma-def95.9%
fma-def95.9%
+-commutative95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in x around inf 39.5%
if 3.3000000000000001e-237 < y < 2.9e-127Initial program 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
*-commutative99.9%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-out95.9%
fma-def95.9%
fma-def95.9%
+-commutative95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in t around inf 39.1%
Final simplification47.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1e-72) (not (<= z 1e-30))) (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e-72) || !(z <= 1e-30)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (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 ((z <= (-1d-72)) .or. (.not. (z <= 1d-30))) then
tmp = z * (y + (a * b))
else
tmp = x + (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 ((z <= -1e-72) || !(z <= 1e-30)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1e-72) or not (z <= 1e-30): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1e-72) || !(z <= 1e-30)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1e-72) || ~((z <= 1e-30))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1e-72], N[Not[LessEqual[z, 1e-30]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-72} \lor \neg \left(z \leq 10^{-30}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -9.9999999999999997e-73 or 1e-30 < z Initial program 91.7%
+-commutative91.7%
+-commutative91.7%
associate-+l+91.7%
associate-+r+91.7%
*-commutative91.7%
associate-*l*94.8%
*-commutative94.8%
distribute-lft-out98.0%
fma-def98.0%
fma-def98.0%
+-commutative98.0%
fma-def98.0%
Simplified98.0%
Taylor expanded in z around inf 73.6%
if -9.9999999999999997e-73 < z < 1e-30Initial program 99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
*-commutative99.9%
associate-*l*94.3%
*-commutative94.3%
distribute-lft-out94.3%
fma-def94.3%
fma-def94.3%
+-commutative94.3%
fma-def94.3%
Simplified94.3%
Taylor expanded in z around 0 76.7%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -0.061) (not (<= a 2.5e-26))) (* 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 <= -0.061) || !(a <= 2.5e-26)) {
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 <= (-0.061d0)) .or. (.not. (a <= 2.5d-26))) 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 <= -0.061) || !(a <= 2.5e-26)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -0.061) or not (a <= 2.5e-26): 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 <= -0.061) || !(a <= 2.5e-26)) 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 <= -0.061) || ~((a <= 2.5e-26))) 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, -0.061], N[Not[LessEqual[a, 2.5e-26]], $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 -0.061 \lor \neg \left(a \leq 2.5 \cdot 10^{-26}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -0.060999999999999999 or 2.5000000000000001e-26 < a Initial program 90.7%
+-commutative90.7%
+-commutative90.7%
associate-+l+90.7%
associate-+r+90.7%
*-commutative90.7%
associate-*l*89.9%
*-commutative89.9%
distribute-lft-out92.5%
fma-def92.5%
fma-def92.5%
+-commutative92.5%
fma-def92.5%
Simplified92.5%
Taylor expanded in a around inf 76.1%
if -0.060999999999999999 < a < 2.5000000000000001e-26Initial program 98.5%
+-commutative98.5%
+-commutative98.5%
associate-+l+98.5%
associate-+r+98.5%
*-commutative98.5%
associate-*l*98.5%
*-commutative98.5%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a around 0 87.0%
Final simplification82.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z 1.4e+104) (+ (+ x (* t a)) (* y z)) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+104) {
tmp = (x + (t * a)) + (y * z);
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.4d+104) then
tmp = (x + (t * a)) + (y * z)
else
tmp = z * (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+104) {
tmp = (x + (t * a)) + (y * z);
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 1.4e+104: tmp = (x + (t * a)) + (y * z) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.4e+104) tmp = Float64(Float64(x + Float64(t * a)) + Float64(y * z)); else tmp = 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 (z <= 1.4e+104) tmp = (x + (t * a)) + (y * z); else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.4e+104], N[(N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+104}:\\
\;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 1.4e104Initial program 97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l+97.7%
associate-+r+97.7%
*-commutative97.7%
associate-*l*96.8%
*-commutative96.8%
distribute-lft-out97.3%
fma-def97.3%
fma-def97.3%
+-commutative97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in b around 0 84.6%
if 1.4e104 < z Initial program 81.0%
+-commutative81.0%
+-commutative81.0%
associate-+l+81.0%
associate-+r+81.0%
*-commutative81.0%
associate-*l*83.3%
*-commutative83.3%
distribute-lft-out92.8%
fma-def92.8%
fma-def92.8%
+-commutative92.8%
fma-def92.8%
Simplified92.8%
Taylor expanded in z around inf 86.0%
Final simplification84.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.65e-40) (* y z) (if (<= y 7.9e-75) (* z (* a b)) (if (<= y 2e+127) x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.65e-40) {
tmp = y * z;
} else if (y <= 7.9e-75) {
tmp = z * (a * b);
} else if (y <= 2e+127) {
tmp = x;
} else {
tmp = 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 (y <= (-2.65d-40)) then
tmp = y * z
else if (y <= 7.9d-75) then
tmp = z * (a * b)
else if (y <= 2d+127) then
tmp = x
else
tmp = 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 (y <= -2.65e-40) {
tmp = y * z;
} else if (y <= 7.9e-75) {
tmp = z * (a * b);
} else if (y <= 2e+127) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.65e-40: tmp = y * z elif y <= 7.9e-75: tmp = z * (a * b) elif y <= 2e+127: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.65e-40) tmp = Float64(y * z); elseif (y <= 7.9e-75) tmp = Float64(z * Float64(a * b)); elseif (y <= 2e+127) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.65e-40) tmp = y * z; elseif (y <= 7.9e-75) tmp = z * (a * b); elseif (y <= 2e+127) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.65e-40], N[(y * z), $MachinePrecision], If[LessEqual[y, 7.9e-75], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+127], x, N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{-40}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 7.9 \cdot 10^{-75}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+127}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -2.6500000000000001e-40 or 1.99999999999999991e127 < y Initial program 94.7%
+-commutative94.7%
+-commutative94.7%
associate-+l+94.7%
associate-+r+94.7%
*-commutative94.7%
associate-*l*94.0%
*-commutative94.0%
distribute-lft-out97.5%
fma-def97.5%
fma-def97.5%
+-commutative97.5%
fma-def97.5%
Simplified97.5%
Taylor expanded in y around inf 56.9%
*-commutative56.9%
Simplified56.9%
if -2.6500000000000001e-40 < y < 7.9e-75Initial program 96.1%
+-commutative96.1%
+-commutative96.1%
associate-+l+96.1%
associate-+r+96.1%
*-commutative96.1%
associate-*l*96.0%
*-commutative96.0%
distribute-lft-out96.0%
fma-def96.0%
fma-def96.0%
+-commutative96.0%
fma-def96.0%
Simplified96.0%
Taylor expanded in b around inf 35.3%
*-commutative35.3%
associate-*r*39.1%
*-commutative39.1%
associate-*r*39.2%
Simplified39.2%
if 7.9e-75 < y < 1.99999999999999991e127Initial program 92.9%
+-commutative92.9%
+-commutative92.9%
associate-+l+92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*l*93.0%
*-commutative93.0%
distribute-lft-out95.3%
fma-def95.3%
fma-def95.3%
+-commutative95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in x around inf 41.2%
Final simplification47.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.4e+42) (not (<= y 1.15e+127))) (* y z) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e+42) || !(y <= 1.15e+127)) {
tmp = y * z;
} else {
tmp = x + (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 ((y <= (-3.4d+42)) .or. (.not. (y <= 1.15d+127))) then
tmp = y * z
else
tmp = x + (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 ((y <= -3.4e+42) || !(y <= 1.15e+127)) {
tmp = y * z;
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.4e+42) or not (y <= 1.15e+127): tmp = y * z else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.4e+42) || !(y <= 1.15e+127)) tmp = Float64(y * z); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.4e+42) || ~((y <= 1.15e+127))) tmp = y * z; else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.4e+42], N[Not[LessEqual[y, 1.15e+127]], $MachinePrecision]], N[(y * z), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+42} \lor \neg \left(y \leq 1.15 \cdot 10^{+127}\right):\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -3.39999999999999975e42 or 1.1500000000000001e127 < y Initial program 94.1%
+-commutative94.1%
+-commutative94.1%
associate-+l+94.1%
associate-+r+94.1%
*-commutative94.1%
associate-*l*93.3%
*-commutative93.3%
distribute-lft-out97.2%
fma-def97.2%
fma-def97.2%
+-commutative97.2%
fma-def97.2%
Simplified97.2%
Taylor expanded in y around inf 58.9%
*-commutative58.9%
Simplified58.9%
if -3.39999999999999975e42 < y < 1.1500000000000001e127Initial program 95.5%
+-commutative95.5%
+-commutative95.5%
associate-+l+95.5%
associate-+r+95.5%
*-commutative95.5%
associate-*l*95.4%
*-commutative95.4%
distribute-lft-out96.1%
fma-def96.1%
fma-def96.1%
+-commutative96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in z around 0 62.9%
Final simplification61.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.1e-40) (not (<= y 1.16e+49))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.1e-40) || !(y <= 1.16e+49)) {
tmp = x + (y * z);
} else {
tmp = x + (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 ((y <= (-6.1d-40)) .or. (.not. (y <= 1.16d+49))) then
tmp = x + (y * z)
else
tmp = x + (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 ((y <= -6.1e-40) || !(y <= 1.16e+49)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.1e-40) or not (y <= 1.16e+49): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.1e-40) || !(y <= 1.16e+49)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.1e-40) || ~((y <= 1.16e+49))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.1e-40], N[Not[LessEqual[y, 1.16e+49]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-40} \lor \neg \left(y \leq 1.16 \cdot 10^{+49}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -6.1000000000000003e-40 or 1.16e49 < y Initial program 93.3%
+-commutative93.3%
+-commutative93.3%
associate-+l+93.3%
associate-+r+93.3%
*-commutative93.3%
associate-*l*92.7%
*-commutative92.7%
distribute-lft-out96.4%
fma-def96.4%
fma-def96.4%
+-commutative96.4%
fma-def96.4%
Simplified96.4%
Taylor expanded in a around 0 74.1%
if -6.1000000000000003e-40 < y < 1.16e49Initial program 96.8%
+-commutative96.8%
+-commutative96.8%
associate-+l+96.8%
associate-+r+96.8%
*-commutative96.8%
associate-*l*96.7%
*-commutative96.7%
distribute-lft-out96.7%
fma-def96.7%
fma-def96.7%
+-commutative96.7%
fma-def96.7%
Simplified96.7%
Taylor expanded in z around 0 63.8%
Final simplification69.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -0.22) (* t a) (if (<= a 0.34) x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -0.22) {
tmp = t * a;
} else if (a <= 0.34) {
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 <= (-0.22d0)) then
tmp = t * a
else if (a <= 0.34d0) 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 <= -0.22) {
tmp = t * a;
} else if (a <= 0.34) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -0.22: tmp = t * a elif a <= 0.34: tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -0.22) tmp = Float64(t * a); elseif (a <= 0.34) 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 <= -0.22) tmp = t * a; elseif (a <= 0.34) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -0.22], N[(t * a), $MachinePrecision], If[LessEqual[a, 0.34], x, N[(t * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.22:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;a \leq 0.34:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if a < -0.220000000000000001 or 0.340000000000000024 < a Initial program 91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l+91.2%
associate-+r+91.2%
*-commutative91.2%
associate-*l*90.4%
*-commutative90.4%
distribute-lft-out92.1%
fma-def92.1%
fma-def92.1%
+-commutative92.1%
fma-def92.1%
Simplified92.1%
Taylor expanded in t around inf 40.2%
if -0.220000000000000001 < a < 0.340000000000000024Initial program 97.9%
+-commutative97.9%
+-commutative97.9%
associate-+l+97.9%
associate-+r+97.9%
*-commutative97.9%
associate-*l*97.9%
*-commutative97.9%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around inf 43.6%
Final simplification42.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 94.9%
+-commutative94.9%
+-commutative94.9%
associate-+l+94.9%
associate-+r+94.9%
*-commutative94.9%
associate-*l*94.6%
*-commutative94.6%
distribute-lft-out96.5%
fma-def96.5%
fma-def96.5%
+-commutative96.5%
fma-def96.5%
Simplified96.5%
Taylor expanded in x around inf 29.4%
Final simplification29.4%
(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 2023230
(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)))