
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (* z b))))
(if (<= a -20000000.0)
(+ (fma y z x) (* a t_1))
(if (<= a 1e-80)
(+ (+ x (* y z)) (+ (* z (* a b)) (* a t)))
(fma a t_1 (fma y z x))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (z * b);
double tmp;
if (a <= -20000000.0) {
tmp = fma(y, z, x) + (a * t_1);
} else if (a <= 1e-80) {
tmp = (x + (y * z)) + ((z * (a * b)) + (a * t));
} else {
tmp = fma(a, t_1, fma(y, z, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(z * b)) tmp = 0.0 if (a <= -20000000.0) tmp = Float64(fma(y, z, x) + Float64(a * t_1)); elseif (a <= 1e-80) tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(z * Float64(a * b)) + Float64(a * t))); else tmp = fma(a, t_1, fma(y, z, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -20000000.0], N[(N[(y * z + x), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e-80], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * t$95$1 + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + z \cdot b\\
\mathbf{if}\;a \leq -20000000:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot t_1\\
\mathbf{elif}\;a \leq 10^{-80}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t_1, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\end{array}
if a < -2e7Initial program 87.5%
associate-+l+87.5%
+-commutative87.5%
fma-def87.5%
associate-*l*96.3%
*-commutative96.3%
*-commutative96.3%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
if -2e7 < a < 9.99999999999999961e-81Initial program 98.1%
associate-+l+98.1%
*-commutative98.1%
associate-*l*98.2%
Simplified98.2%
if 9.99999999999999961e-81 < a Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
*-commutative89.7%
associate-*l*94.1%
*-commutative94.1%
distribute-lft-out96.5%
fma-def97.6%
*-commutative97.6%
+-commutative97.6%
fma-def97.6%
Simplified97.6%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.46e+113) (not (<= z 1.45e+144))) (+ x (* z (+ y (* a b)))) (+ (fma y z x) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.46e+113) || !(z <= 1.45e+144)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = fma(y, z, x) + (a * (t + (z * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.46e+113) || !(z <= 1.45e+144)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.46e+113], N[Not[LessEqual[z, 1.45e+144]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{+113} \lor \neg \left(z \leq 1.45 \cdot 10^{+144}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.46e113 or 1.44999999999999999e144 < z Initial program 82.8%
associate-+l+82.8%
*-commutative82.8%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in t around 0 75.0%
+-commutative75.0%
+-commutative75.0%
associate-*r*90.7%
distribute-rgt-in96.6%
Simplified96.6%
if -1.46e113 < z < 1.44999999999999999e144Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
fma-def98.2%
associate-*l*98.3%
*-commutative98.3%
*-commutative98.3%
distribute-rgt-out98.9%
*-commutative98.9%
Simplified98.9%
Final simplification98.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* a t)) (* b (* a z))))) (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)) + (a * t)) + (b * (a * z));
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)) + (a * t)) + (b * (a * z));
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)) + (a * t)) + (b * (a * z)) 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(a * t)) + Float64(b * Float64(a * z))) 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)) + (a * t)) + (b * (a * z)); 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[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $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) + a \cdot t\right) + b \cdot \left(a \cdot z\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 97.2%
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*18.2%
Simplified18.2%
Taylor expanded in a around inf 72.7%
Final simplification96.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.55e+181) (not (<= a 0.025))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (+ (* z (* a b)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e+181) || !(a <= 0.025)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.55d+181)) .or. (.not. (a <= 0.025d0))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + ((z * (a * b)) + (a * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e+181) || !(a <= 0.025)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + ((z * (a * b)) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.55e+181) or not (a <= 0.025): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + ((z * (a * b)) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.55e+181) || !(a <= 0.025)) 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(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.55e+181) || ~((a <= 0.025))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + ((z * (a * b)) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.55e+181], N[Not[LessEqual[a, 0.025]], $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[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+181} \lor \neg \left(a \leq 0.025\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) + a \cdot t\right)\\
\end{array}
\end{array}
if a < -1.54999999999999995e181 or 0.025000000000000001 < a Initial program 85.6%
associate-+l+85.6%
+-commutative85.6%
fma-def85.6%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
distribute-rgt-out96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around 0 95.0%
if -1.54999999999999995e181 < a < 0.025000000000000001Initial program 97.4%
associate-+l+97.4%
*-commutative97.4%
associate-*l*98.7%
Simplified98.7%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -5.5e+97)
(* a t)
(if (<= a -2.35e-33)
t_1
(if (<= a 6.5e-174)
(* y z)
(if (<= a 7.5e-121)
x
(if (<= a 2.05e-66) (* y z) (if (<= a 9.2e+68) t_1 (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -5.5e+97) {
tmp = a * t;
} else if (a <= -2.35e-33) {
tmp = t_1;
} else if (a <= 6.5e-174) {
tmp = y * z;
} else if (a <= 7.5e-121) {
tmp = x;
} else if (a <= 2.05e-66) {
tmp = y * z;
} else if (a <= 9.2e+68) {
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 * (z * b)
if (a <= (-5.5d+97)) then
tmp = a * t
else if (a <= (-2.35d-33)) then
tmp = t_1
else if (a <= 6.5d-174) then
tmp = y * z
else if (a <= 7.5d-121) then
tmp = x
else if (a <= 2.05d-66) then
tmp = y * z
else if (a <= 9.2d+68) 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 * (z * b);
double tmp;
if (a <= -5.5e+97) {
tmp = a * t;
} else if (a <= -2.35e-33) {
tmp = t_1;
} else if (a <= 6.5e-174) {
tmp = y * z;
} else if (a <= 7.5e-121) {
tmp = x;
} else if (a <= 2.05e-66) {
tmp = y * z;
} else if (a <= 9.2e+68) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -5.5e+97: tmp = a * t elif a <= -2.35e-33: tmp = t_1 elif a <= 6.5e-174: tmp = y * z elif a <= 7.5e-121: tmp = x elif a <= 2.05e-66: tmp = y * z elif a <= 9.2e+68: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -5.5e+97) tmp = Float64(a * t); elseif (a <= -2.35e-33) tmp = t_1; elseif (a <= 6.5e-174) tmp = Float64(y * z); elseif (a <= 7.5e-121) tmp = x; elseif (a <= 2.05e-66) tmp = Float64(y * z); elseif (a <= 9.2e+68) 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 * (z * b); tmp = 0.0; if (a <= -5.5e+97) tmp = a * t; elseif (a <= -2.35e-33) tmp = t_1; elseif (a <= 6.5e-174) tmp = y * z; elseif (a <= 7.5e-121) tmp = x; elseif (a <= 2.05e-66) tmp = y * z; elseif (a <= 9.2e+68) 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[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.5e+97], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.35e-33], t$95$1, If[LessEqual[a, 6.5e-174], N[(y * z), $MachinePrecision], If[LessEqual[a, 7.5e-121], x, If[LessEqual[a, 2.05e-66], N[(y * z), $MachinePrecision], If[LessEqual[a, 9.2e+68], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+97}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -2.35 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-174}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-121}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.05 \cdot 10^{-66}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 9.2 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -5.50000000000000021e97 or 9.1999999999999999e68 < a Initial program 85.6%
associate-+l+85.6%
*-commutative85.6%
associate-*l*77.0%
Simplified77.0%
Taylor expanded in t around inf 55.7%
if -5.50000000000000021e97 < a < -2.3500000000000001e-33 or 2.04999999999999999e-66 < a < 9.1999999999999999e68Initial program 95.0%
associate-+l+95.0%
*-commutative95.0%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in a around inf 64.0%
Taylor expanded in t around 0 52.5%
if -2.3500000000000001e-33 < a < 6.50000000000000009e-174 or 7.50000000000000027e-121 < a < 2.04999999999999999e-66Initial program 97.7%
associate-+l+97.7%
*-commutative97.7%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
Simplified53.3%
if 6.50000000000000009e-174 < a < 7.50000000000000027e-121Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 57.9%
Final simplification54.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.9e-15)
(* b (* a z))
(if (<= z -7.1e-230)
x
(if (<= z 3.2e-22)
(* a t)
(if (or (<= z 7.5e+123) (not (<= z 4.7e+277)))
(* y z)
(* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-15) {
tmp = b * (a * z);
} else if (z <= -7.1e-230) {
tmp = x;
} else if (z <= 3.2e-22) {
tmp = a * t;
} else if ((z <= 7.5e+123) || !(z <= 4.7e+277)) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.9d-15)) then
tmp = b * (a * z)
else if (z <= (-7.1d-230)) then
tmp = x
else if (z <= 3.2d-22) then
tmp = a * t
else if ((z <= 7.5d+123) .or. (.not. (z <= 4.7d+277))) then
tmp = y * z
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-15) {
tmp = b * (a * z);
} else if (z <= -7.1e-230) {
tmp = x;
} else if (z <= 3.2e-22) {
tmp = a * t;
} else if ((z <= 7.5e+123) || !(z <= 4.7e+277)) {
tmp = y * z;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e-15: tmp = b * (a * z) elif z <= -7.1e-230: tmp = x elif z <= 3.2e-22: tmp = a * t elif (z <= 7.5e+123) or not (z <= 4.7e+277): tmp = y * z else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e-15) tmp = Float64(b * Float64(a * z)); elseif (z <= -7.1e-230) tmp = x; elseif (z <= 3.2e-22) tmp = Float64(a * t); elseif ((z <= 7.5e+123) || !(z <= 4.7e+277)) tmp = Float64(y * z); else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.9e-15) tmp = b * (a * z); elseif (z <= -7.1e-230) tmp = x; elseif (z <= 3.2e-22) tmp = a * t; elseif ((z <= 7.5e+123) || ~((z <= 4.7e+277))) tmp = y * z; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e-15], N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.1e-230], x, If[LessEqual[z, 3.2e-22], N[(a * t), $MachinePrecision], If[Or[LessEqual[z, 7.5e+123], N[Not[LessEqual[z, 4.7e+277]], $MachinePrecision]], N[(y * z), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-15}:\\
\;\;\;\;b \cdot \left(a \cdot z\right)\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-230}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-22}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+123} \lor \neg \left(z \leq 4.7 \cdot 10^{+277}\right):\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.9000000000000001e-15Initial program 88.1%
associate-+l+88.1%
*-commutative88.1%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in z around inf 80.4%
Taylor expanded in y around 0 37.9%
associate-*r*44.1%
*-commutative44.1%
associate-*r*48.0%
Simplified48.0%
if -1.9000000000000001e-15 < z < -7.10000000000000018e-230Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around inf 51.2%
if -7.10000000000000018e-230 < z < 3.19999999999999987e-22Initial program 98.1%
associate-+l+98.1%
*-commutative98.1%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in t around inf 52.4%
if 3.19999999999999987e-22 < z < 7.4999999999999999e123 or 4.69999999999999988e277 < z Initial program 95.0%
associate-+l+95.0%
*-commutative95.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 48.1%
*-commutative48.1%
Simplified48.1%
if 7.4999999999999999e123 < z < 4.69999999999999988e277Initial program 83.4%
associate-+l+83.4%
*-commutative83.4%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around inf 71.4%
Taylor expanded in t around 0 66.1%
Final simplification52.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e+104) (not (<= z 4.8e-22))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+104) || !(z <= 4.8e-22)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8.5d+104)) .or. (.not. (z <= 4.8d-22))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e+104) || !(z <= 4.8e-22)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e+104) or not (z <= 4.8e-22): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e+104) || !(z <= 4.8e-22)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.5e+104) || ~((z <= 4.8e-22))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.5e+104], N[Not[LessEqual[z, 4.8e-22]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+104} \lor \neg \left(z \leq 4.8 \cdot 10^{-22}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -8.4999999999999999e104 or 4.80000000000000005e-22 < z Initial program 86.5%
associate-+l+86.5%
*-commutative86.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in z around inf 87.0%
if -8.4999999999999999e104 < z < 4.80000000000000005e-22Initial program 99.1%
associate-+l+99.1%
+-commutative99.1%
fma-def99.1%
associate-*l*99.2%
*-commutative99.2%
*-commutative99.2%
distribute-rgt-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 88.1%
Final simplification87.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.2e+91) (not (<= a 0.000155))) (+ x (* a (+ t (* z b)))) (+ x (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.2e+91) || !(a <= 0.000155)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-6.2d+91)) .or. (.not. (a <= 0.000155d0))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (z * (y + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.2e+91) || !(a <= 0.000155)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (z * (y + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.2e+91) or not (a <= 0.000155): tmp = x + (a * (t + (z * b))) else: tmp = x + (z * (y + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.2e+91) || !(a <= 0.000155)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.2e+91) || ~((a <= 0.000155))) tmp = x + (a * (t + (z * b))); else tmp = x + (z * (y + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.2e+91], N[Not[LessEqual[a, 0.000155]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+91} \lor \neg \left(a \leq 0.000155\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if a < -6.19999999999999995e91 or 1.55e-4 < a Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
fma-def86.1%
associate-*l*93.3%
*-commutative93.3%
*-commutative93.3%
distribute-rgt-out97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in y around 0 95.5%
if -6.19999999999999995e91 < a < 1.55e-4Initial program 97.9%
associate-+l+97.9%
*-commutative97.9%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in t around 0 77.7%
+-commutative77.7%
+-commutative77.7%
associate-*r*87.7%
distribute-rgt-in89.0%
Simplified89.0%
Final simplification91.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -9.2e+97) (* a t) (if (<= a -7e+55) (* a (* z b)) (if (<= a 5.8e+90) (+ x (* y z)) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.2e+97) {
tmp = a * t;
} else if (a <= -7e+55) {
tmp = a * (z * b);
} else if (a <= 5.8e+90) {
tmp = x + (y * z);
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-9.2d+97)) then
tmp = a * t
else if (a <= (-7d+55)) then
tmp = a * (z * b)
else if (a <= 5.8d+90) then
tmp = x + (y * z)
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.2e+97) {
tmp = a * t;
} else if (a <= -7e+55) {
tmp = a * (z * b);
} else if (a <= 5.8e+90) {
tmp = x + (y * z);
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9.2e+97: tmp = a * t elif a <= -7e+55: tmp = a * (z * b) elif a <= 5.8e+90: tmp = x + (y * z) else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9.2e+97) tmp = Float64(a * t); elseif (a <= -7e+55) tmp = Float64(a * Float64(z * b)); elseif (a <= 5.8e+90) tmp = Float64(x + Float64(y * z)); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9.2e+97) tmp = a * t; elseif (a <= -7e+55) tmp = a * (z * b); elseif (a <= 5.8e+90) tmp = x + (y * z); else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9.2e+97], N[(a * t), $MachinePrecision], If[LessEqual[a, -7e+55], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.8e+90], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+97}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -7 \cdot 10^{+55}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+90}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -9.20000000000000022e97 or 5.8000000000000003e90 < a Initial program 85.0%
associate-+l+85.0%
*-commutative85.0%
associate-*l*75.9%
Simplified75.9%
Taylor expanded in t around inf 57.0%
if -9.20000000000000022e97 < a < -7.00000000000000021e55Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 100.0%
Taylor expanded in t around 0 100.0%
if -7.00000000000000021e55 < a < 5.8000000000000003e90Initial program 96.9%
associate-+l+96.9%
*-commutative96.9%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in a around 0 64.1%
Final simplification62.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= a -2.3e+92)
t_1
(if (<= a -5.4e+54)
(* a (* z b))
(if (<= a 2.6e+39) (+ 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);
double tmp;
if (a <= -2.3e+92) {
tmp = t_1;
} else if (a <= -5.4e+54) {
tmp = a * (z * b);
} else if (a <= 2.6e+39) {
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)
if (a <= (-2.3d+92)) then
tmp = t_1
else if (a <= (-5.4d+54)) then
tmp = a * (z * b)
else if (a <= 2.6d+39) 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);
double tmp;
if (a <= -2.3e+92) {
tmp = t_1;
} else if (a <= -5.4e+54) {
tmp = a * (z * b);
} else if (a <= 2.6e+39) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if a <= -2.3e+92: tmp = t_1 elif a <= -5.4e+54: tmp = a * (z * b) elif a <= 2.6e+39: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -2.3e+92) tmp = t_1; elseif (a <= -5.4e+54) tmp = Float64(a * Float64(z * b)); elseif (a <= 2.6e+39) 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); tmp = 0.0; if (a <= -2.3e+92) tmp = t_1; elseif (a <= -5.4e+54) tmp = a * (z * b); elseif (a <= 2.6e+39) 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 * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.3e+92], t$95$1, If[LessEqual[a, -5.4e+54], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e+39], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -5.4 \cdot 10^{+54}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+39}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.29999999999999998e92 or 2.6e39 < a Initial program 85.1%
associate-+l+85.1%
*-commutative85.1%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in z around 0 61.0%
+-commutative61.0%
Simplified61.0%
if -2.29999999999999998e92 < a < -5.40000000000000022e54Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 100.0%
Taylor expanded in t around 0 100.0%
if -5.40000000000000022e54 < a < 2.6e39Initial program 97.9%
associate-+l+97.9%
*-commutative97.9%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in a around 0 65.5%
Final simplification64.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.35e-38) (not (<= a 1.65e-29))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.35e-38) || !(a <= 1.65e-29)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.35d-38)) .or. (.not. (a <= 1.65d-29))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.35e-38) || !(a <= 1.65e-29)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.35e-38) or not (a <= 1.65e-29): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.35e-38) || !(a <= 1.65e-29)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.35e-38) || ~((a <= 1.65e-29))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.35e-38], N[Not[LessEqual[a, 1.65e-29]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-38} \lor \neg \left(a \leq 1.65 \cdot 10^{-29}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.35000000000000003e-38 or 1.65000000000000014e-29 < a Initial program 88.4%
associate-+l+88.4%
*-commutative88.4%
associate-*l*84.1%
Simplified84.1%
Taylor expanded in a around inf 82.3%
if -1.35000000000000003e-38 < a < 1.65000000000000014e-29Initial program 98.2%
associate-+l+98.2%
*-commutative98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around 0 70.6%
Final simplification76.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.4e-19) (not (<= z 5.8e-35))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.4e-19) || !(z <= 5.8e-35)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6.4d-19)) .or. (.not. (z <= 5.8d-35))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.4e-19) || !(z <= 5.8e-35)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.4e-19) or not (z <= 5.8e-35): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.4e-19) || !(z <= 5.8e-35)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.4e-19) || ~((z <= 5.8e-35))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.4e-19], N[Not[LessEqual[z, 5.8e-35]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{-19} \lor \neg \left(z \leq 5.8 \cdot 10^{-35}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -6.39999999999999965e-19 or 5.8000000000000004e-35 < z Initial program 89.3%
associate-+l+89.3%
*-commutative89.3%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in z around inf 81.0%
if -6.39999999999999965e-19 < z < 5.8000000000000004e-35Initial program 98.8%
associate-+l+98.8%
*-commutative98.8%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in z around 0 77.4%
+-commutative77.4%
Simplified77.4%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -6e-17) (* y z) (if (<= z -5.8e-230) x (if (<= z 3.7e-22) (* a t) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6e-17) {
tmp = y * z;
} else if (z <= -5.8e-230) {
tmp = x;
} else if (z <= 3.7e-22) {
tmp = a * t;
} 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 (z <= (-6d-17)) then
tmp = y * z
else if (z <= (-5.8d-230)) then
tmp = x
else if (z <= 3.7d-22) then
tmp = a * t
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 (z <= -6e-17) {
tmp = y * z;
} else if (z <= -5.8e-230) {
tmp = x;
} else if (z <= 3.7e-22) {
tmp = a * t;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -6e-17: tmp = y * z elif z <= -5.8e-230: tmp = x elif z <= 3.7e-22: tmp = a * t else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6e-17) tmp = Float64(y * z); elseif (z <= -5.8e-230) tmp = x; elseif (z <= 3.7e-22) tmp = Float64(a * t); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -6e-17) tmp = y * z; elseif (z <= -5.8e-230) tmp = x; elseif (z <= 3.7e-22) tmp = a * t; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6e-17], N[(y * z), $MachinePrecision], If[LessEqual[z, -5.8e-230], x, If[LessEqual[z, 3.7e-22], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-17}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-230}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-22}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -6.00000000000000012e-17 or 3.7e-22 < z Initial program 89.0%
associate-+l+89.0%
*-commutative89.0%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
Simplified45.9%
if -6.00000000000000012e-17 < z < -5.80000000000000011e-230Initial program 100.0%
associate-+l+100.0%
*-commutative100.0%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in x around inf 52.3%
if -5.80000000000000011e-230 < z < 3.7e-22Initial program 98.1%
associate-+l+98.1%
*-commutative98.1%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in t around inf 52.4%
Final simplification48.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8e+38) (not (<= t 6.8e+81))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8e+38) || !(t <= 6.8e+81)) {
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 ((t <= (-8d+38)) .or. (.not. (t <= 6.8d+81))) 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 ((t <= -8e+38) || !(t <= 6.8e+81)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8e+38) or not (t <= 6.8e+81): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8e+38) || !(t <= 6.8e+81)) 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 ((t <= -8e+38) || ~((t <= 6.8e+81))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8e+38], N[Not[LessEqual[t, 6.8e+81]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+38} \lor \neg \left(t \leq 6.8 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -7.99999999999999982e38 or 6.80000000000000005e81 < t Initial program 90.8%
associate-+l+90.8%
*-commutative90.8%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in t around inf 53.0%
if -7.99999999999999982e38 < t < 6.80000000000000005e81Initial program 94.7%
associate-+l+94.7%
*-commutative94.7%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in x around inf 26.5%
Final simplification37.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.0%
associate-+l+93.0%
*-commutative93.0%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around inf 18.9%
Final simplification18.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 2023309
(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)))