
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2e-104)
(fma y z (+ (* a (+ t (* z b))) x))
(if (<= a 4e+96)
(fma z (fma a b y) (fma t a x))
(fma y z (fma a (fma z b t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2e-104) {
tmp = fma(y, z, ((a * (t + (z * b))) + x));
} else if (a <= 4e+96) {
tmp = fma(z, fma(a, b, y), fma(t, a, x));
} else {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2e-104) tmp = fma(y, z, Float64(Float64(a * Float64(t + Float64(z * b))) + x)); elseif (a <= 4e+96) tmp = fma(z, fma(a, b, y), fma(t, a, x)); else tmp = fma(y, z, fma(a, fma(z, b, t), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2e-104], N[(y * z + N[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+96], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision], N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-104}:\\
\;\;\;\;\mathsf{fma}\left(y, z, a \cdot \left(t + z \cdot b\right) + x\right)\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\end{array}
\end{array}
if a < -1.99999999999999985e-104Initial program 88.1%
associate-+l+88.1%
+-commutative88.1%
associate-+l+88.1%
fma-def89.4%
+-commutative89.4%
*-commutative89.4%
associate-*l*95.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
if -1.99999999999999985e-104 < a < 4.0000000000000002e96Initial program 97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l+97.1%
associate-+r+97.1%
*-commutative97.1%
associate-*l*97.8%
*-commutative97.8%
distribute-lft-out99.9%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
if 4.0000000000000002e96 < a Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
associate-+l+85.0%
fma-def85.0%
+-commutative85.0%
*-commutative85.0%
associate-*l*92.1%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* y z))) (* b (* a z))))) (if (<= t_1 2e+275) t_1 (fma y z (fma a (fma z b t) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (y * z))) + (b * (a * z));
double tmp;
if (t_1 <= 2e+275) {
tmp = t_1;
} else {
tmp = fma(y, z, fma(a, fma(z, b, t), x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z))) tmp = 0.0 if (t_1 <= 2e+275) tmp = t_1; else tmp = fma(y, z, fma(a, fma(z, b, t), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+275], t$95$1, N[(y * z + N[(a * N[(z * b + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, \mathsf{fma}\left(a, \mathsf{fma}\left(z, b, t\right), x\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 1.99999999999999992e275Initial program 98.9%
if 1.99999999999999992e275 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 69.3%
associate-+l+69.3%
+-commutative69.3%
associate-+l+69.3%
fma-def73.0%
+-commutative73.0%
*-commutative73.0%
associate-*l*85.3%
distribute-lft-out96.3%
fma-def96.3%
+-commutative96.3%
fma-def96.3%
Simplified96.3%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* y z))) (* b (* a z))))) (if (<= t_1 1e+286) t_1 (fma y z (+ (* a (+ t (* z b))) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * t) + (x + (y * z))) + (b * (a * z));
double tmp;
if (t_1 <= 1e+286) {
tmp = t_1;
} else {
tmp = fma(y, z, ((a * (t + (z * b))) + x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z))) tmp = 0.0 if (t_1 <= 1e+286) tmp = t_1; else tmp = fma(y, z, Float64(Float64(a * Float64(t + Float64(z * b))) + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+286], t$95$1, N[(y * z + N[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t_1 \leq 10^{+286}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, z, a \cdot \left(t + z \cdot b\right) + x\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 1.00000000000000003e286Initial program 98.9%
if 1.00000000000000003e286 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 68.8%
associate-+l+68.8%
+-commutative68.8%
associate-+l+68.8%
fma-def72.5%
+-commutative72.5%
*-commutative72.5%
associate-*l*85.2%
distribute-lft-out96.3%
fma-def96.3%
+-commutative96.3%
fma-def96.3%
Simplified96.3%
Taylor expanded in a around 0 96.3%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* a t) (+ x (* y z))) (* b (* a z))))) (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 = ((a * t) + (x + (y * z))) + (b * (a * z));
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 = ((a * t) + (x + (y * z))) + (b * (a * z));
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 = ((a * t) + (x + (y * z))) + (b * (a * z)) 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(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(a * z))) 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 = ((a * t) + (x + (y * z))) + (b * (a * z)); 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[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(a \cdot z\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.3%
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-out46.7%
fma-def60.0%
fma-def60.0%
+-commutative60.0%
fma-def60.0%
Simplified60.0%
Taylor expanded in z around inf 80.0%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= x -5200000000.0)
x
(if (<= x -7.5e-180)
(* y z)
(if (<= x -2.6e-223)
(* a t)
(if (<= x 1.4e-207)
t_1
(if (<= x 6e-158)
(* y z)
(if (<= x 1.05e-120) t_1 (if (<= x 1.15e+45) (* y z) x)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (x <= -5200000000.0) {
tmp = x;
} else if (x <= -7.5e-180) {
tmp = y * z;
} else if (x <= -2.6e-223) {
tmp = a * t;
} else if (x <= 1.4e-207) {
tmp = t_1;
} else if (x <= 6e-158) {
tmp = y * z;
} else if (x <= 1.05e-120) {
tmp = t_1;
} else if (x <= 1.15e+45) {
tmp = y * z;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (x <= (-5200000000.0d0)) then
tmp = x
else if (x <= (-7.5d-180)) then
tmp = y * z
else if (x <= (-2.6d-223)) then
tmp = a * t
else if (x <= 1.4d-207) then
tmp = t_1
else if (x <= 6d-158) then
tmp = y * z
else if (x <= 1.05d-120) then
tmp = t_1
else if (x <= 1.15d+45) then
tmp = y * z
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 t_1 = a * (z * b);
double tmp;
if (x <= -5200000000.0) {
tmp = x;
} else if (x <= -7.5e-180) {
tmp = y * z;
} else if (x <= -2.6e-223) {
tmp = a * t;
} else if (x <= 1.4e-207) {
tmp = t_1;
} else if (x <= 6e-158) {
tmp = y * z;
} else if (x <= 1.05e-120) {
tmp = t_1;
} else if (x <= 1.15e+45) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if x <= -5200000000.0: tmp = x elif x <= -7.5e-180: tmp = y * z elif x <= -2.6e-223: tmp = a * t elif x <= 1.4e-207: tmp = t_1 elif x <= 6e-158: tmp = y * z elif x <= 1.05e-120: tmp = t_1 elif x <= 1.15e+45: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (x <= -5200000000.0) tmp = x; elseif (x <= -7.5e-180) tmp = Float64(y * z); elseif (x <= -2.6e-223) tmp = Float64(a * t); elseif (x <= 1.4e-207) tmp = t_1; elseif (x <= 6e-158) tmp = Float64(y * z); elseif (x <= 1.05e-120) tmp = t_1; elseif (x <= 1.15e+45) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (x <= -5200000000.0) tmp = x; elseif (x <= -7.5e-180) tmp = y * z; elseif (x <= -2.6e-223) tmp = a * t; elseif (x <= 1.4e-207) tmp = t_1; elseif (x <= 6e-158) tmp = y * z; elseif (x <= 1.05e-120) tmp = t_1; elseif (x <= 1.15e+45) tmp = y * z; else tmp = x; 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[x, -5200000000.0], x, If[LessEqual[x, -7.5e-180], N[(y * z), $MachinePrecision], If[LessEqual[x, -2.6e-223], N[(a * t), $MachinePrecision], If[LessEqual[x, 1.4e-207], t$95$1, If[LessEqual[x, 6e-158], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.05e-120], t$95$1, If[LessEqual[x, 1.15e+45], N[(y * z), $MachinePrecision], x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -5200000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-180}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-223}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-158}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+45}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.2e9 or 1.15000000000000006e45 < x Initial program 96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l+96.6%
associate-+r+96.6%
*-commutative96.6%
associate-*l*96.5%
*-commutative96.5%
distribute-lft-out96.5%
fma-def96.5%
fma-def96.5%
+-commutative96.5%
fma-def96.5%
Simplified96.5%
Taylor expanded in x around inf 55.3%
if -5.2e9 < x < -7.50000000000000015e-180 or 1.39999999999999996e-207 < x < 6e-158 or 1.05e-120 < x < 1.15000000000000006e45Initial program 90.4%
+-commutative90.4%
+-commutative90.4%
associate-+l+90.4%
associate-+r+90.4%
*-commutative90.4%
associate-*l*90.5%
*-commutative90.5%
distribute-lft-out93.2%
fma-def96.0%
fma-def96.0%
+-commutative96.0%
fma-def96.0%
Simplified96.0%
Taylor expanded in y around inf 50.1%
*-commutative50.1%
Simplified50.1%
if -7.50000000000000015e-180 < x < -2.6e-223Initial program 91.4%
+-commutative91.4%
+-commutative91.4%
associate-+l+91.4%
associate-+r+91.4%
*-commutative91.4%
associate-*l*91.4%
*-commutative91.4%
distribute-lft-out99.7%
fma-def99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in t around inf 62.6%
if -2.6e-223 < x < 1.39999999999999996e-207 or 6e-158 < x < 1.05e-120Initial program 87.9%
+-commutative87.9%
+-commutative87.9%
associate-+l+87.9%
associate-+r+87.9%
*-commutative87.9%
associate-*l*91.4%
*-commutative91.4%
distribute-lft-out93.1%
fma-def93.2%
fma-def93.2%
+-commutative93.2%
fma-def93.2%
Simplified93.2%
Taylor expanded in b around inf 51.9%
*-commutative51.9%
Simplified51.9%
Final simplification53.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -130000.0)
x
(if (<= x -2.85e-179)
(* y z)
(if (<= x -2.15e-223)
(* a t)
(if (<= x 5.5e-204)
(* a (* z b))
(if (<= x 2.6e-158)
(* y z)
(if (<= x 3.8e-118)
(* z (* a b))
(if (<= x 4.7e+48) (* y z) x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -130000.0) {
tmp = x;
} else if (x <= -2.85e-179) {
tmp = y * z;
} else if (x <= -2.15e-223) {
tmp = a * t;
} else if (x <= 5.5e-204) {
tmp = a * (z * b);
} else if (x <= 2.6e-158) {
tmp = y * z;
} else if (x <= 3.8e-118) {
tmp = z * (a * b);
} else if (x <= 4.7e+48) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-130000.0d0)) then
tmp = x
else if (x <= (-2.85d-179)) then
tmp = y * z
else if (x <= (-2.15d-223)) then
tmp = a * t
else if (x <= 5.5d-204) then
tmp = a * (z * b)
else if (x <= 2.6d-158) then
tmp = y * z
else if (x <= 3.8d-118) then
tmp = z * (a * b)
else if (x <= 4.7d+48) then
tmp = y * z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -130000.0) {
tmp = x;
} else if (x <= -2.85e-179) {
tmp = y * z;
} else if (x <= -2.15e-223) {
tmp = a * t;
} else if (x <= 5.5e-204) {
tmp = a * (z * b);
} else if (x <= 2.6e-158) {
tmp = y * z;
} else if (x <= 3.8e-118) {
tmp = z * (a * b);
} else if (x <= 4.7e+48) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -130000.0: tmp = x elif x <= -2.85e-179: tmp = y * z elif x <= -2.15e-223: tmp = a * t elif x <= 5.5e-204: tmp = a * (z * b) elif x <= 2.6e-158: tmp = y * z elif x <= 3.8e-118: tmp = z * (a * b) elif x <= 4.7e+48: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -130000.0) tmp = x; elseif (x <= -2.85e-179) tmp = Float64(y * z); elseif (x <= -2.15e-223) tmp = Float64(a * t); elseif (x <= 5.5e-204) tmp = Float64(a * Float64(z * b)); elseif (x <= 2.6e-158) tmp = Float64(y * z); elseif (x <= 3.8e-118) tmp = Float64(z * Float64(a * b)); elseif (x <= 4.7e+48) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -130000.0) tmp = x; elseif (x <= -2.85e-179) tmp = y * z; elseif (x <= -2.15e-223) tmp = a * t; elseif (x <= 5.5e-204) tmp = a * (z * b); elseif (x <= 2.6e-158) tmp = y * z; elseif (x <= 3.8e-118) tmp = z * (a * b); elseif (x <= 4.7e+48) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -130000.0], x, If[LessEqual[x, -2.85e-179], N[(y * z), $MachinePrecision], If[LessEqual[x, -2.15e-223], N[(a * t), $MachinePrecision], If[LessEqual[x, 5.5e-204], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-158], N[(y * z), $MachinePrecision], If[LessEqual[x, 3.8e-118], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.7e+48], N[(y * z), $MachinePrecision], x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -130000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.85 \cdot 10^{-179}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-223}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-204}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-158}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-118}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{+48}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.3e5 or 4.70000000000000012e48 < x Initial program 96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l+96.6%
associate-+r+96.6%
*-commutative96.6%
associate-*l*96.5%
*-commutative96.5%
distribute-lft-out96.5%
fma-def96.5%
fma-def96.5%
+-commutative96.5%
fma-def96.5%
Simplified96.5%
Taylor expanded in x around inf 55.3%
if -1.3e5 < x < -2.85e-179 or 5.4999999999999999e-204 < x < 2.6e-158 or 3.8000000000000001e-118 < x < 4.70000000000000012e48Initial program 90.4%
+-commutative90.4%
+-commutative90.4%
associate-+l+90.4%
associate-+r+90.4%
*-commutative90.4%
associate-*l*90.5%
*-commutative90.5%
distribute-lft-out93.2%
fma-def96.0%
fma-def96.0%
+-commutative96.0%
fma-def96.0%
Simplified96.0%
Taylor expanded in y around inf 50.1%
*-commutative50.1%
Simplified50.1%
if -2.85e-179 < x < -2.15e-223Initial program 91.4%
+-commutative91.4%
+-commutative91.4%
associate-+l+91.4%
associate-+r+91.4%
*-commutative91.4%
associate-*l*91.4%
*-commutative91.4%
distribute-lft-out99.7%
fma-def99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in t around inf 62.6%
if -2.15e-223 < x < 5.4999999999999999e-204Initial program 89.1%
+-commutative89.1%
+-commutative89.1%
associate-+l+89.1%
associate-+r+89.1%
*-commutative89.1%
associate-*l*91.4%
*-commutative91.4%
distribute-lft-out93.6%
fma-def93.6%
fma-def93.6%
+-commutative93.6%
fma-def93.6%
Simplified93.6%
Taylor expanded in b around inf 51.5%
*-commutative51.5%
Simplified51.5%
if 2.6e-158 < x < 3.8000000000000001e-118Initial program 83.4%
+-commutative83.4%
+-commutative83.4%
associate-+l+83.4%
associate-+r+83.4%
*-commutative83.4%
associate-*l*91.3%
*-commutative91.3%
distribute-lft-out91.3%
fma-def91.4%
fma-def91.4%
+-commutative91.4%
fma-def91.4%
Simplified91.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
associate-*r*61.1%
*-commutative61.1%
associate-*r*69.0%
Simplified69.0%
Final simplification54.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* a (+ t (* z b))) x)))
(if (<= a -1.12e-10)
t_1
(if (<= a 3.4e-151)
(+ (+ x (* a t)) (* y z))
(if (<= a 9e-79)
(* z (+ y (* a b)))
(if (<= a 1.7e-33) (+ 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))) + x;
double tmp;
if (a <= -1.12e-10) {
tmp = t_1;
} else if (a <= 3.4e-151) {
tmp = (x + (a * t)) + (y * z);
} else if (a <= 9e-79) {
tmp = z * (y + (a * b));
} else if (a <= 1.7e-33) {
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))) + x
if (a <= (-1.12d-10)) then
tmp = t_1
else if (a <= 3.4d-151) then
tmp = (x + (a * t)) + (y * z)
else if (a <= 9d-79) then
tmp = z * (y + (a * b))
else if (a <= 1.7d-33) 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))) + x;
double tmp;
if (a <= -1.12e-10) {
tmp = t_1;
} else if (a <= 3.4e-151) {
tmp = (x + (a * t)) + (y * z);
} else if (a <= 9e-79) {
tmp = z * (y + (a * b));
} else if (a <= 1.7e-33) {
tmp = x + (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * (t + (z * b))) + x tmp = 0 if a <= -1.12e-10: tmp = t_1 elif a <= 3.4e-151: tmp = (x + (a * t)) + (y * z) elif a <= 9e-79: tmp = z * (y + (a * b)) elif a <= 1.7e-33: tmp = x + (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * Float64(t + Float64(z * b))) + x) tmp = 0.0 if (a <= -1.12e-10) tmp = t_1; elseif (a <= 3.4e-151) tmp = Float64(Float64(x + Float64(a * t)) + Float64(y * z)); elseif (a <= 9e-79) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 1.7e-33) 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))) + x; tmp = 0.0; if (a <= -1.12e-10) tmp = t_1; elseif (a <= 3.4e-151) tmp = (x + (a * t)) + (y * z); elseif (a <= 9e-79) tmp = z * (y + (a * b)); elseif (a <= 1.7e-33) 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[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.12e-10], t$95$1, If[LessEqual[a, 3.4e-151], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e-79], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.7e-33], 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) + x\\
\mathbf{if}\;a \leq -1.12 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-151}:\\
\;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-79}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-33}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.12e-10 or 1.7e-33 < a Initial program 85.5%
associate-+l+85.5%
+-commutative85.5%
*-commutative85.5%
associate-*l*90.9%
distribute-lft-out95.8%
fma-def96.6%
+-commutative96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in y around 0 91.2%
if -1.12e-10 < a < 3.4000000000000003e-151Initial program 99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
associate-+r+99.0%
*-commutative99.0%
associate-*l*99.0%
*-commutative99.0%
distribute-lft-out99.9%
fma-def99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around 0 89.4%
if 3.4000000000000003e-151 < a < 9.0000000000000006e-79Initial program 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
*-commutative99.8%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-out99.9%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around inf 92.6%
if 9.0000000000000006e-79 < a < 1.7e-33Initial program 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
associate-+r+100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Final simplification90.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -3600.0) (not (<= x 55000.0))) (+ (+ x (* a t)) (* y z)) (+ (* b (* a z)) (+ (* a t) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -3600.0) || !(x <= 55000.0)) {
tmp = (x + (a * t)) + (y * z);
} else {
tmp = (b * (a * z)) + ((a * t) + (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-3600.0d0)) .or. (.not. (x <= 55000.0d0))) then
tmp = (x + (a * t)) + (y * z)
else
tmp = (b * (a * z)) + ((a * t) + (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -3600.0) || !(x <= 55000.0)) {
tmp = (x + (a * t)) + (y * z);
} else {
tmp = (b * (a * z)) + ((a * t) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -3600.0) or not (x <= 55000.0): tmp = (x + (a * t)) + (y * z) else: tmp = (b * (a * z)) + ((a * t) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -3600.0) || !(x <= 55000.0)) tmp = Float64(Float64(x + Float64(a * t)) + Float64(y * z)); else tmp = Float64(Float64(b * Float64(a * z)) + Float64(Float64(a * t) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -3600.0) || ~((x <= 55000.0))) tmp = (x + (a * t)) + (y * z); else tmp = (b * (a * z)) + ((a * t) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -3600.0], N[Not[LessEqual[x, 55000.0]], $MachinePrecision]], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3600 \lor \neg \left(x \leq 55000\right):\\
\;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot z\right) + \left(a \cdot t + y \cdot z\right)\\
\end{array}
\end{array}
if x < -3600 or 55000 < x Initial 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 b around 0 90.0%
if -3600 < x < 55000Initial program 88.9%
Taylor expanded in x around 0 86.3%
Final simplification88.0%
(FPCore (x y z t a b) :precision binary64 (if (<= z 1.4e+54) (+ (+ (* a (* z b)) (* a t)) (+ x (* 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+54) {
tmp = ((a * (z * b)) + (a * t)) + (x + (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+54) then
tmp = ((a * (z * b)) + (a * t)) + (x + (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+54) {
tmp = ((a * (z * b)) + (a * t)) + (x + (y * z));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 1.4e+54: tmp = ((a * (z * b)) + (a * t)) + (x + (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+54) tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(a * t)) + Float64(x + 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+54) tmp = ((a * (z * b)) + (a * t)) + (x + (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+54], N[(N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $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^{+54}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + a \cdot t\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if z < 1.40000000000000008e54Initial program 96.5%
associate-+l+96.5%
associate-*l*95.5%
Simplified95.5%
if 1.40000000000000008e54 < z Initial program 77.5%
+-commutative77.5%
+-commutative77.5%
associate-+l+77.5%
associate-+r+77.5%
*-commutative77.5%
associate-*l*86.7%
*-commutative86.7%
distribute-lft-out92.4%
fma-def96.1%
fma-def96.2%
+-commutative96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in z around inf 83.6%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -240000.0)
x
(if (<= x -7.2e-180)
(* y z)
(if (<= x -5.9e-210)
(* a t)
(if (<= x 9.2e-251)
(* y z)
(if (<= x 2.7e-199) (* a t) (if (<= x 2e+42) (* y z) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -240000.0) {
tmp = x;
} else if (x <= -7.2e-180) {
tmp = y * z;
} else if (x <= -5.9e-210) {
tmp = a * t;
} else if (x <= 9.2e-251) {
tmp = y * z;
} else if (x <= 2.7e-199) {
tmp = a * t;
} else if (x <= 2e+42) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-240000.0d0)) then
tmp = x
else if (x <= (-7.2d-180)) then
tmp = y * z
else if (x <= (-5.9d-210)) then
tmp = a * t
else if (x <= 9.2d-251) then
tmp = y * z
else if (x <= 2.7d-199) then
tmp = a * t
else if (x <= 2d+42) then
tmp = y * z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -240000.0) {
tmp = x;
} else if (x <= -7.2e-180) {
tmp = y * z;
} else if (x <= -5.9e-210) {
tmp = a * t;
} else if (x <= 9.2e-251) {
tmp = y * z;
} else if (x <= 2.7e-199) {
tmp = a * t;
} else if (x <= 2e+42) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -240000.0: tmp = x elif x <= -7.2e-180: tmp = y * z elif x <= -5.9e-210: tmp = a * t elif x <= 9.2e-251: tmp = y * z elif x <= 2.7e-199: tmp = a * t elif x <= 2e+42: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -240000.0) tmp = x; elseif (x <= -7.2e-180) tmp = Float64(y * z); elseif (x <= -5.9e-210) tmp = Float64(a * t); elseif (x <= 9.2e-251) tmp = Float64(y * z); elseif (x <= 2.7e-199) tmp = Float64(a * t); elseif (x <= 2e+42) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -240000.0) tmp = x; elseif (x <= -7.2e-180) tmp = y * z; elseif (x <= -5.9e-210) tmp = a * t; elseif (x <= 9.2e-251) tmp = y * z; elseif (x <= 2.7e-199) tmp = a * t; elseif (x <= 2e+42) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -240000.0], x, If[LessEqual[x, -7.2e-180], N[(y * z), $MachinePrecision], If[LessEqual[x, -5.9e-210], N[(a * t), $MachinePrecision], If[LessEqual[x, 9.2e-251], N[(y * z), $MachinePrecision], If[LessEqual[x, 2.7e-199], N[(a * t), $MachinePrecision], If[LessEqual[x, 2e+42], N[(y * z), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -240000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-180}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -5.9 \cdot 10^{-210}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-251}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-199}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+42}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4e5 or 2.00000000000000009e42 < x Initial program 96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l+96.6%
associate-+r+96.6%
*-commutative96.6%
associate-*l*96.5%
*-commutative96.5%
distribute-lft-out96.5%
fma-def96.5%
fma-def96.5%
+-commutative96.5%
fma-def96.5%
Simplified96.5%
Taylor expanded in x around inf 55.3%
if -2.4e5 < x < -7.1999999999999998e-180 or -5.8999999999999999e-210 < x < 9.20000000000000068e-251 or 2.69999999999999989e-199 < x < 2.00000000000000009e42Initial program 88.9%
+-commutative88.9%
+-commutative88.9%
associate-+l+88.9%
associate-+r+88.9%
*-commutative88.9%
associate-*l*89.9%
*-commutative89.9%
distribute-lft-out93.2%
fma-def95.0%
fma-def95.0%
+-commutative95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in y around inf 44.9%
*-commutative44.9%
Simplified44.9%
if -7.1999999999999998e-180 < x < -5.8999999999999999e-210 or 9.20000000000000068e-251 < x < 2.69999999999999989e-199Initial program 92.0%
+-commutative92.0%
+-commutative92.0%
associate-+l+92.0%
associate-+r+92.0%
*-commutative92.0%
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 t around inf 61.1%
Final simplification51.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))) (t_2 (+ x (* y z))))
(if (<= y -7e+103)
t_2
(if (<= y -2.9e-6)
t_1
(if (<= y -1.52e-28)
t_2
(if (<= y -6e-48) (* a (* z b)) (if (<= y 2.9e+19) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = x + (y * z);
double tmp;
if (y <= -7e+103) {
tmp = t_2;
} else if (y <= -2.9e-6) {
tmp = t_1;
} else if (y <= -1.52e-28) {
tmp = t_2;
} else if (y <= -6e-48) {
tmp = a * (z * b);
} else if (y <= 2.9e+19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (a * t)
t_2 = x + (y * z)
if (y <= (-7d+103)) then
tmp = t_2
else if (y <= (-2.9d-6)) then
tmp = t_1
else if (y <= (-1.52d-28)) then
tmp = t_2
else if (y <= (-6d-48)) then
tmp = a * (z * b)
else if (y <= 2.9d+19) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = x + (y * z);
double tmp;
if (y <= -7e+103) {
tmp = t_2;
} else if (y <= -2.9e-6) {
tmp = t_1;
} else if (y <= -1.52e-28) {
tmp = t_2;
} else if (y <= -6e-48) {
tmp = a * (z * b);
} else if (y <= 2.9e+19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) t_2 = x + (y * z) tmp = 0 if y <= -7e+103: tmp = t_2 elif y <= -2.9e-6: tmp = t_1 elif y <= -1.52e-28: tmp = t_2 elif y <= -6e-48: tmp = a * (z * b) elif y <= 2.9e+19: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) t_2 = Float64(x + Float64(y * z)) tmp = 0.0 if (y <= -7e+103) tmp = t_2; elseif (y <= -2.9e-6) tmp = t_1; elseif (y <= -1.52e-28) tmp = t_2; elseif (y <= -6e-48) tmp = Float64(a * Float64(z * b)); elseif (y <= 2.9e+19) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); t_2 = x + (y * z); tmp = 0.0; if (y <= -7e+103) tmp = t_2; elseif (y <= -2.9e-6) tmp = t_1; elseif (y <= -1.52e-28) tmp = t_2; elseif (y <= -6e-48) tmp = a * (z * b); elseif (y <= 2.9e+19) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+103], t$95$2, If[LessEqual[y, -2.9e-6], t$95$1, If[LessEqual[y, -1.52e-28], t$95$2, If[LessEqual[y, -6e-48], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+19], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := x + y \cdot z\\
\mathbf{if}\;y \leq -7 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.52 \cdot 10^{-28}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-48}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -7e103 or -2.9000000000000002e-6 < y < -1.5199999999999999e-28 or 2.9e19 < y Initial program 90.4%
+-commutative90.4%
+-commutative90.4%
associate-+l+90.4%
associate-+r+90.4%
*-commutative90.4%
associate-*l*92.1%
*-commutative92.1%
distribute-lft-out95.6%
fma-def97.4%
fma-def97.4%
+-commutative97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in a around 0 78.0%
if -7e103 < y < -2.9000000000000002e-6 or -5.9999999999999998e-48 < y < 2.9e19Initial program 94.2%
+-commutative94.2%
+-commutative94.2%
associate-+l+94.2%
associate-+r+94.2%
*-commutative94.2%
associate-*l*94.1%
*-commutative94.1%
distribute-lft-out94.1%
fma-def94.2%
fma-def94.2%
+-commutative94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in z around 0 63.3%
if -1.5199999999999999e-28 < y < -5.9999999999999998e-48Initial program 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+100.0%
associate-+r+100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
distribute-lft-out100.0%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification70.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))) (t_2 (* a (+ t (* z b)))))
(if (<= a -1.5e-11)
t_2
(if (<= a 3.4e-151)
t_1
(if (<= a 2.2e-72) (* z (+ y (* a b))) (if (<= a 8.5e+66) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -1.5e-11) {
tmp = t_2;
} else if (a <= 3.4e-151) {
tmp = t_1;
} else if (a <= 2.2e-72) {
tmp = z * (y + (a * b));
} else if (a <= 8.5e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * z)
t_2 = a * (t + (z * b))
if (a <= (-1.5d-11)) then
tmp = t_2
else if (a <= 3.4d-151) then
tmp = t_1
else if (a <= 2.2d-72) then
tmp = z * (y + (a * b))
else if (a <= 8.5d+66) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -1.5e-11) {
tmp = t_2;
} else if (a <= 3.4e-151) {
tmp = t_1;
} else if (a <= 2.2e-72) {
tmp = z * (y + (a * b));
} else if (a <= 8.5e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) t_2 = a * (t + (z * b)) tmp = 0 if a <= -1.5e-11: tmp = t_2 elif a <= 3.4e-151: tmp = t_1 elif a <= 2.2e-72: tmp = z * (y + (a * b)) elif a <= 8.5e+66: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.5e-11) tmp = t_2; elseif (a <= 3.4e-151) tmp = t_1; elseif (a <= 2.2e-72) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (a <= 8.5e+66) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -1.5e-11) tmp = t_2; elseif (a <= 3.4e-151) tmp = t_1; elseif (a <= 2.2e-72) tmp = z * (y + (a * b)); elseif (a <= 8.5e+66) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.5e-11], t$95$2, If[LessEqual[a, 3.4e-151], t$95$1, If[LessEqual[a, 2.2e-72], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e+66], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.5 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-72}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -1.5e-11 or 8.5000000000000004e66 < a Initial program 85.3%
+-commutative85.3%
+-commutative85.3%
associate-+l+85.3%
associate-+r+85.3%
*-commutative85.3%
associate-*l*86.2%
*-commutative86.2%
distribute-lft-out87.2%
fma-def89.2%
fma-def89.2%
+-commutative89.2%
fma-def89.2%
Simplified89.2%
Taylor expanded in a around inf 80.8%
if -1.5e-11 < a < 3.4000000000000003e-151 or 2.20000000000000002e-72 < a < 8.5000000000000004e66Initial program 97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l+97.0%
associate-+r+97.0%
*-commutative97.0%
associate-*l*97.8%
*-commutative97.8%
distribute-lft-out99.9%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a around 0 77.1%
if 3.4000000000000003e-151 < a < 2.20000000000000002e-72Initial program 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
*-commutative99.8%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-out99.9%
fma-def100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around inf 92.6%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= y -5.2e+109)
(* y z)
(if (<= y -7.2e-16)
t_1
(if (<= y -4.2e-48) (* z (* a b)) (if (<= y 1.25e+126) t_1 (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (y <= -5.2e+109) {
tmp = y * z;
} else if (y <= -7.2e-16) {
tmp = t_1;
} else if (y <= -4.2e-48) {
tmp = z * (a * b);
} else if (y <= 1.25e+126) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (a * t)
if (y <= (-5.2d+109)) then
tmp = y * z
else if (y <= (-7.2d-16)) then
tmp = t_1
else if (y <= (-4.2d-48)) then
tmp = z * (a * b)
else if (y <= 1.25d+126) then
tmp = t_1
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 t_1 = x + (a * t);
double tmp;
if (y <= -5.2e+109) {
tmp = y * z;
} else if (y <= -7.2e-16) {
tmp = t_1;
} else if (y <= -4.2e-48) {
tmp = z * (a * b);
} else if (y <= 1.25e+126) {
tmp = t_1;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if y <= -5.2e+109: tmp = y * z elif y <= -7.2e-16: tmp = t_1 elif y <= -4.2e-48: tmp = z * (a * b) elif y <= 1.25e+126: tmp = t_1 else: tmp = y * z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (y <= -5.2e+109) tmp = Float64(y * z); elseif (y <= -7.2e-16) tmp = t_1; elseif (y <= -4.2e-48) tmp = Float64(z * Float64(a * b)); elseif (y <= 1.25e+126) tmp = t_1; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); tmp = 0.0; if (y <= -5.2e+109) tmp = y * z; elseif (y <= -7.2e-16) tmp = t_1; elseif (y <= -4.2e-48) tmp = z * (a * b); elseif (y <= 1.25e+126) tmp = t_1; else tmp = y * z; 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[y, -5.2e+109], N[(y * z), $MachinePrecision], If[LessEqual[y, -7.2e-16], t$95$1, If[LessEqual[y, -4.2e-48], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+126], t$95$1, N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+109}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-48}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -5.1999999999999997e109 or 1.24999999999999994e126 < y Initial program 92.9%
+-commutative92.9%
+-commutative92.9%
associate-+l+92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*l*92.9%
*-commutative92.9%
distribute-lft-out96.5%
fma-def98.8%
fma-def98.8%
+-commutative98.8%
fma-def98.8%
Simplified98.8%
Taylor expanded in y around inf 65.9%
*-commutative65.9%
Simplified65.9%
if -5.1999999999999997e109 < y < -7.19999999999999965e-16 or -4.19999999999999977e-48 < y < 1.24999999999999994e126Initial program 92.7%
+-commutative92.7%
+-commutative92.7%
associate-+l+92.7%
associate-+r+92.7%
*-commutative92.7%
associate-*l*93.9%
*-commutative93.9%
distribute-lft-out94.5%
fma-def94.5%
fma-def94.5%
+-commutative94.5%
fma-def94.5%
Simplified94.5%
Taylor expanded in z around 0 60.5%
if -7.19999999999999965e-16 < y < -4.19999999999999977e-48Initial program 87.5%
+-commutative87.5%
+-commutative87.5%
associate-+l+87.5%
associate-+r+87.5%
*-commutative87.5%
associate-*l*87.5%
*-commutative87.5%
distribute-lft-out87.5%
fma-def87.5%
fma-def87.5%
+-commutative87.5%
fma-def87.5%
Simplified87.5%
Taylor expanded in b around inf 75.3%
*-commutative75.3%
associate-*r*75.3%
*-commutative75.3%
associate-*r*75.3%
Simplified75.3%
Final simplification62.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.2e+100) (not (<= y 1.2e+71))) (+ x (* y z)) (+ (* a (+ t (* z b))) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.2e+100) || !(y <= 1.2e+71)) {
tmp = x + (y * z);
} else {
tmp = (a * (t + (z * b))) + 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 ((y <= (-4.2d+100)) .or. (.not. (y <= 1.2d+71))) then
tmp = x + (y * z)
else
tmp = (a * (t + (z * b))) + 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 ((y <= -4.2e+100) || !(y <= 1.2e+71)) {
tmp = x + (y * z);
} else {
tmp = (a * (t + (z * b))) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.2e+100) or not (y <= 1.2e+71): tmp = x + (y * z) else: tmp = (a * (t + (z * b))) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.2e+100) || !(y <= 1.2e+71)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(Float64(a * Float64(t + Float64(z * b))) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.2e+100) || ~((y <= 1.2e+71))) tmp = x + (y * z); else tmp = (a * (t + (z * b))) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.2e+100], N[Not[LessEqual[y, 1.2e+71]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+100} \lor \neg \left(y \leq 1.2 \cdot 10^{+71}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right) + x\\
\end{array}
\end{array}
if y < -4.1999999999999997e100 or 1.1999999999999999e71 < y Initial program 92.9%
+-commutative92.9%
+-commutative92.9%
associate-+l+92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*l*93.9%
*-commutative93.9%
distribute-lft-out97.0%
fma-def99.0%
fma-def99.0%
+-commutative99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in a around 0 82.8%
if -4.1999999999999997e100 < y < 1.1999999999999999e71Initial program 92.4%
associate-+l+92.4%
+-commutative92.4%
*-commutative92.4%
associate-*l*90.0%
distribute-lft-out93.8%
fma-def93.8%
+-commutative93.8%
fma-def93.8%
Simplified93.8%
Taylor expanded in y around 0 85.9%
Final simplification84.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4e-48) (not (<= z 6.6e-86))) (* 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 <= -4e-48) || !(z <= 6.6e-86)) {
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 <= (-4d-48)) .or. (.not. (z <= 6.6d-86))) 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 <= -4e-48) || !(z <= 6.6e-86)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4e-48) or not (z <= 6.6e-86): 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 <= -4e-48) || !(z <= 6.6e-86)) 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 <= -4e-48) || ~((z <= 6.6e-86))) 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, -4e-48], N[Not[LessEqual[z, 6.6e-86]], $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 -4 \cdot 10^{-48} \lor \neg \left(z \leq 6.6 \cdot 10^{-86}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -3.9999999999999999e-48 or 6.59999999999999974e-86 < z Initial program 87.9%
+-commutative87.9%
+-commutative87.9%
associate-+l+87.9%
associate-+r+87.9%
*-commutative87.9%
associate-*l*92.2%
*-commutative92.2%
distribute-lft-out94.8%
fma-def96.1%
fma-def96.1%
+-commutative96.1%
fma-def96.1%
Simplified96.1%
Taylor expanded in z around inf 75.0%
if -3.9999999999999999e-48 < z < 6.59999999999999974e-86Initial program 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+l+99.9%
associate-+r+99.9%
*-commutative99.9%
associate-*l*95.2%
*-commutative95.2%
distribute-lft-out95.2%
fma-def95.2%
fma-def95.2%
+-commutative95.2%
fma-def95.2%
Simplified95.2%
Taylor expanded in z around 0 77.3%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.05e+26) x (if (<= x 2e-58) (* a t) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.05e+26) {
tmp = x;
} else if (x <= 2e-58) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-3.05d+26)) then
tmp = x
else if (x <= 2d-58) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.05e+26) {
tmp = x;
} else if (x <= 2e-58) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.05e+26: tmp = x elif x <= 2e-58: tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.05e+26) tmp = x; elseif (x <= 2e-58) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.05e+26) tmp = x; elseif (x <= 2e-58) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.05e+26], x, If[LessEqual[x, 2e-58], N[(a * t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-58}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.0500000000000001e26 or 2.0000000000000001e-58 < x Initial program 96.1%
+-commutative96.1%
+-commutative96.1%
associate-+l+96.1%
associate-+r+96.1%
*-commutative96.1%
associate-*l*96.8%
*-commutative96.8%
distribute-lft-out96.8%
fma-def96.8%
fma-def96.9%
+-commutative96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in x around inf 51.0%
if -3.0500000000000001e26 < x < 2.0000000000000001e-58Initial program 89.3%
+-commutative89.3%
+-commutative89.3%
associate-+l+89.3%
associate-+r+89.3%
*-commutative89.3%
associate-*l*90.1%
*-commutative90.1%
distribute-lft-out93.1%
fma-def94.7%
fma-def94.7%
+-commutative94.7%
fma-def94.7%
Simplified94.7%
Taylor expanded in t around inf 29.2%
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 92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l+92.6%
associate-+r+92.6%
*-commutative92.6%
associate-*l*93.4%
*-commutative93.4%
distribute-lft-out94.9%
fma-def95.7%
fma-def95.7%
+-commutative95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in x around inf 26.8%
Final simplification26.8%
(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 2023214
(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)))