
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0)) INFINITY) (+ (fma x y (/ z (/ 16.0 t))) (- c (/ a (/ 4.0 b)))) (+ c (* x y))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0)) <= ((double) INFINITY)) {
tmp = fma(x, y, (z / (16.0 / t))) + (c - (a / (4.0 / b)));
} else {
tmp = c + (x * y);
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) <= Inf) tmp = Float64(fma(x, y, Float64(z / Float64(16.0 / t))) + Float64(c - Float64(a / Float64(4.0 / b)))); else tmp = Float64(c + Float64(x * y)); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
neg-mul-199.7%
metadata-eval99.7%
metadata-eval99.7%
cancel-sign-sub-inv99.7%
fma-def99.7%
associate-/l*99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-/l*99.9%
Simplified99.9%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around inf 57.7%
Final simplification98.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (fma t (/ z 16.0) (fma x y (- c (* b (/ a 4.0))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(t, (z / 16.0), fma(x, y, (c - (b * (a / 4.0)))));
}
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) return fma(t, Float64(z / 16.0), fma(x, y, Float64(c - Float64(b * Float64(a / 4.0))))) end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(t * N[(z / 16.0), $MachinePrecision] + N[(x * y + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
+-commutative96.9%
associate--l+96.9%
associate-*l/96.9%
*-commutative96.9%
fma-def97.7%
fma-neg98.1%
neg-sub098.1%
associate-+l-98.1%
neg-sub098.1%
+-commutative98.1%
unsub-neg98.1%
*-commutative98.1%
associate-*r/98.4%
Simplified98.4%
Final simplification98.4%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* x y)))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (x * y) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(x * y)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
tmp = 0.0;
if (t_1 <= Inf)
tmp = c + t_1;
else
tmp = c + (x * y);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around inf 57.7%
Final simplification98.5%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (* 0.0625 (* t z))))
(if (<= b -1.45e-5)
t_1
(if (<= b 1.26e-225)
(+ c (* x y))
(if (<= b 2.6e+64)
(+ c t_2)
(if (or (<= b 1.02e+101) (not (<= b 2.05e+113)))
t_1
(+ (* x y) t_2)))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = 0.0625 * (t * z);
double tmp;
if (b <= -1.45e-5) {
tmp = t_1;
} else if (b <= 1.26e-225) {
tmp = c + (x * y);
} else if (b <= 2.6e+64) {
tmp = c + t_2;
} else if ((b <= 1.02e+101) || !(b <= 2.05e+113)) {
tmp = t_1;
} else {
tmp = (x * y) + t_2;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = 0.0625d0 * (t * z)
if (b <= (-1.45d-5)) then
tmp = t_1
else if (b <= 1.26d-225) then
tmp = c + (x * y)
else if (b <= 2.6d+64) then
tmp = c + t_2
else if ((b <= 1.02d+101) .or. (.not. (b <= 2.05d+113))) then
tmp = t_1
else
tmp = (x * y) + t_2
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = 0.0625 * (t * z);
double tmp;
if (b <= -1.45e-5) {
tmp = t_1;
} else if (b <= 1.26e-225) {
tmp = c + (x * y);
} else if (b <= 2.6e+64) {
tmp = c + t_2;
} else if ((b <= 1.02e+101) || !(b <= 2.05e+113)) {
tmp = t_1;
} else {
tmp = (x * y) + t_2;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = 0.0625 * (t * z) tmp = 0 if b <= -1.45e-5: tmp = t_1 elif b <= 1.26e-225: tmp = c + (x * y) elif b <= 2.6e+64: tmp = c + t_2 elif (b <= 1.02e+101) or not (b <= 2.05e+113): tmp = t_1 else: tmp = (x * y) + t_2 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (b <= -1.45e-5) tmp = t_1; elseif (b <= 1.26e-225) tmp = Float64(c + Float64(x * y)); elseif (b <= 2.6e+64) tmp = Float64(c + t_2); elseif ((b <= 1.02e+101) || !(b <= 2.05e+113)) tmp = t_1; else tmp = Float64(Float64(x * y) + t_2); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = c + (a * (b * -0.25));
t_2 = 0.0625 * (t * z);
tmp = 0.0;
if (b <= -1.45e-5)
tmp = t_1;
elseif (b <= 1.26e-225)
tmp = c + (x * y);
elseif (b <= 2.6e+64)
tmp = c + t_2;
elseif ((b <= 1.02e+101) || ~((b <= 2.05e+113)))
tmp = t_1;
else
tmp = (x * y) + t_2;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.45e-5], t$95$1, If[LessEqual[b, 1.26e-225], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e+64], N[(c + t$95$2), $MachinePrecision], If[Or[LessEqual[b, 1.02e+101], N[Not[LessEqual[b, 2.05e+113]], $MachinePrecision]], t$95$1, N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.26 \cdot 10^{-225}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+64}:\\
\;\;\;\;c + t_2\\
\mathbf{elif}\;b \leq 1.02 \cdot 10^{+101} \lor \neg \left(b \leq 2.05 \cdot 10^{+113}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + t_2\\
\end{array}
\end{array}
if b < -1.45e-5 or 2.59999999999999997e64 < b < 1.02000000000000002e101 or 2.04999999999999996e113 < b Initial program 93.6%
Taylor expanded in a around inf 64.6%
*-commutative64.6%
associate-*l*65.3%
Simplified65.3%
if -1.45e-5 < b < 1.2599999999999999e-225Initial program 100.0%
Taylor expanded in x around inf 64.9%
if 1.2599999999999999e-225 < b < 2.59999999999999997e64Initial program 100.0%
Taylor expanded in z around inf 65.0%
if 1.02000000000000002e101 < b < 2.04999999999999996e113Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in c around 0 100.0%
Final simplification65.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))) (t_2 (* 0.0625 (* t z))))
(if (<= t -2.55e-54)
t_2
(if (<= t 2e-307)
c
(if (<= t 4.5e-263)
t_1
(if (<= t 7e-214)
(* x y)
(if (<= t 1.9e-20) t_1 (if (<= t 5.8e+85) c t_2))))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double t_2 = 0.0625 * (t * z);
double tmp;
if (t <= -2.55e-54) {
tmp = t_2;
} else if (t <= 2e-307) {
tmp = c;
} else if (t <= 4.5e-263) {
tmp = t_1;
} else if (t <= 7e-214) {
tmp = x * y;
} else if (t <= 1.9e-20) {
tmp = t_1;
} else if (t <= 5.8e+85) {
tmp = c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a * (-0.25d0))
t_2 = 0.0625d0 * (t * z)
if (t <= (-2.55d-54)) then
tmp = t_2
else if (t <= 2d-307) then
tmp = c
else if (t <= 4.5d-263) then
tmp = t_1
else if (t <= 7d-214) then
tmp = x * y
else if (t <= 1.9d-20) then
tmp = t_1
else if (t <= 5.8d+85) then
tmp = c
else
tmp = t_2
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double t_2 = 0.0625 * (t * z);
double tmp;
if (t <= -2.55e-54) {
tmp = t_2;
} else if (t <= 2e-307) {
tmp = c;
} else if (t <= 4.5e-263) {
tmp = t_1;
} else if (t <= 7e-214) {
tmp = x * y;
} else if (t <= 1.9e-20) {
tmp = t_1;
} else if (t <= 5.8e+85) {
tmp = c;
} else {
tmp = t_2;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) t_2 = 0.0625 * (t * z) tmp = 0 if t <= -2.55e-54: tmp = t_2 elif t <= 2e-307: tmp = c elif t <= 4.5e-263: tmp = t_1 elif t <= 7e-214: tmp = x * y elif t <= 1.9e-20: tmp = t_1 elif t <= 5.8e+85: tmp = c else: tmp = t_2 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) t_2 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (t <= -2.55e-54) tmp = t_2; elseif (t <= 2e-307) tmp = c; elseif (t <= 4.5e-263) tmp = t_1; elseif (t <= 7e-214) tmp = Float64(x * y); elseif (t <= 1.9e-20) tmp = t_1; elseif (t <= 5.8e+85) tmp = c; else tmp = t_2; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = b * (a * -0.25);
t_2 = 0.0625 * (t * z);
tmp = 0.0;
if (t <= -2.55e-54)
tmp = t_2;
elseif (t <= 2e-307)
tmp = c;
elseif (t <= 4.5e-263)
tmp = t_1;
elseif (t <= 7e-214)
tmp = x * y;
elseif (t <= 1.9e-20)
tmp = t_1;
elseif (t <= 5.8e+85)
tmp = c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.55e-54], t$95$2, If[LessEqual[t, 2e-307], c, If[LessEqual[t, 4.5e-263], t$95$1, If[LessEqual[t, 7e-214], N[(x * y), $MachinePrecision], If[LessEqual[t, 1.9e-20], t$95$1, If[LessEqual[t, 5.8e+85], c, t$95$2]]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;t \leq -2.55 \cdot 10^{-54}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-307}:\\
\;\;\;\;c\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-263}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-214}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+85}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.55000000000000005e-54 or 5.79999999999999995e85 < t Initial program 97.5%
Taylor expanded in x around 0 81.5%
+-commutative81.5%
*-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
*-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
associate--l+81.5%
associate-*r*81.5%
*-commutative81.5%
*-commutative81.5%
sub-neg81.5%
+-commutative81.5%
distribute-rgt-neg-in81.5%
fma-def81.5%
distribute-rgt-neg-in81.5%
metadata-eval81.5%
Simplified81.5%
Taylor expanded in t around inf 48.6%
if -2.55000000000000005e-54 < t < 1.99999999999999982e-307 or 1.8999999999999999e-20 < t < 5.79999999999999995e85Initial program 99.0%
Taylor expanded in c around inf 35.6%
if 1.99999999999999982e-307 < t < 4.4999999999999997e-263 or 7e-214 < t < 1.8999999999999999e-20Initial program 97.9%
Taylor expanded in x around 0 81.4%
+-commutative81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r*81.4%
associate--l+81.4%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
sub-neg81.4%
+-commutative81.4%
distribute-rgt-neg-in81.4%
fma-def81.4%
distribute-rgt-neg-in81.4%
metadata-eval81.4%
Simplified81.4%
Taylor expanded in b around inf 51.1%
*-commutative51.1%
*-commutative51.1%
associate-*r*51.1%
*-commutative51.1%
Simplified51.1%
if 4.4999999999999997e-263 < t < 7e-214Initial program 70.0%
Taylor expanded in x around inf 71.0%
Taylor expanded in y around inf 61.4%
Final simplification45.5%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= a -3.5e+221) (not (<= a 1.6e+19))) (+ c (* a (* b -0.25))) (+ c (+ (* x y) (* 0.0625 (* t z))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -3.5e+221) || !(a <= 1.6e+19)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (t * z)));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((a <= (-3.5d+221)) .or. (.not. (a <= 1.6d+19))) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = c + ((x * y) + (0.0625d0 * (t * z)))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -3.5e+221) || !(a <= 1.6e+19)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (t * z)));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -3.5e+221) or not (a <= 1.6e+19): tmp = c + (a * (b * -0.25)) else: tmp = c + ((x * y) + (0.0625 * (t * z))) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -3.5e+221) || !(a <= 1.6e+19)) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(t * z)))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -3.5e+221) || ~((a <= 1.6e+19)))
tmp = c + (a * (b * -0.25));
else
tmp = c + ((x * y) + (0.0625 * (t * z)));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -3.5e+221], N[Not[LessEqual[a, 1.6e+19]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+221} \lor \neg \left(a \leq 1.6 \cdot 10^{+19}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if a < -3.5000000000000002e221 or 1.6e19 < a Initial program 93.5%
Taylor expanded in a around inf 66.0%
*-commutative66.0%
associate-*l*67.1%
Simplified67.1%
if -3.5000000000000002e221 < a < 1.6e19Initial program 98.3%
Taylor expanded in a around 0 86.4%
Final simplification80.8%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= a -7.3e+252)
(and (not (<= a -4.1e+249))
(or (<= a -3.5e+221) (not (<= a 1.5e+19)))))
(* b (* a -0.25))
(+ c (* x y))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -7.3e+252) || (!(a <= -4.1e+249) && ((a <= -3.5e+221) || !(a <= 1.5e+19)))) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((a <= (-7.3d+252)) .or. (.not. (a <= (-4.1d+249))) .and. (a <= (-3.5d+221)) .or. (.not. (a <= 1.5d+19))) then
tmp = b * (a * (-0.25d0))
else
tmp = c + (x * y)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -7.3e+252) || (!(a <= -4.1e+249) && ((a <= -3.5e+221) || !(a <= 1.5e+19)))) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -7.3e+252) or (not (a <= -4.1e+249) and ((a <= -3.5e+221) or not (a <= 1.5e+19))): tmp = b * (a * -0.25) else: tmp = c + (x * y) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -7.3e+252) || (!(a <= -4.1e+249) && ((a <= -3.5e+221) || !(a <= 1.5e+19)))) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(c + Float64(x * y)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -7.3e+252) || (~((a <= -4.1e+249)) && ((a <= -3.5e+221) || ~((a <= 1.5e+19)))))
tmp = b * (a * -0.25);
else
tmp = c + (x * y);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -7.3e+252], And[N[Not[LessEqual[a, -4.1e+249]], $MachinePrecision], Or[LessEqual[a, -3.5e+221], N[Not[LessEqual[a, 1.5e+19]], $MachinePrecision]]]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.3 \cdot 10^{+252} \lor \neg \left(a \leq -4.1 \cdot 10^{+249}\right) \land \left(a \leq -3.5 \cdot 10^{+221} \lor \neg \left(a \leq 1.5 \cdot 10^{+19}\right)\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -7.2999999999999997e252 or -4.0999999999999997e249 < a < -3.5000000000000002e221 or 1.5e19 < a Initial program 93.4%
Taylor expanded in x around 0 80.1%
+-commutative80.1%
*-commutative80.1%
*-commutative80.1%
associate-*r*80.1%
*-commutative80.1%
*-commutative80.1%
associate-*r*81.2%
associate--l+81.2%
associate-*r*81.2%
*-commutative81.2%
*-commutative81.2%
sub-neg81.2%
+-commutative81.2%
distribute-rgt-neg-in81.2%
fma-def81.3%
distribute-rgt-neg-in81.3%
metadata-eval81.3%
Simplified81.3%
Taylor expanded in b around inf 55.9%
*-commutative55.9%
*-commutative55.9%
associate-*r*57.0%
*-commutative57.0%
Simplified57.0%
if -7.2999999999999997e252 < a < -4.0999999999999997e249 or -3.5000000000000002e221 < a < 1.5e19Initial program 98.4%
Taylor expanded in x around inf 57.6%
Final simplification57.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))))
(if (<= b -1.14e-7)
t_1
(if (<= b 1.36e-223)
(+ c (* x y))
(if (<= b 2.8e+63) (+ c (* 0.0625 (* t z))) t_1)))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double tmp;
if (b <= -1.14e-7) {
tmp = t_1;
} else if (b <= 1.36e-223) {
tmp = c + (x * y);
} else if (b <= 2.8e+63) {
tmp = c + (0.0625 * (t * z));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
if (b <= (-1.14d-7)) then
tmp = t_1
else if (b <= 1.36d-223) then
tmp = c + (x * y)
else if (b <= 2.8d+63) then
tmp = c + (0.0625d0 * (t * z))
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double tmp;
if (b <= -1.14e-7) {
tmp = t_1;
} else if (b <= 1.36e-223) {
tmp = c + (x * y);
} else if (b <= 2.8e+63) {
tmp = c + (0.0625 * (t * z));
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) tmp = 0 if b <= -1.14e-7: tmp = t_1 elif b <= 1.36e-223: tmp = c + (x * y) elif b <= 2.8e+63: tmp = c + (0.0625 * (t * z)) else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (b <= -1.14e-7) tmp = t_1; elseif (b <= 1.36e-223) tmp = Float64(c + Float64(x * y)); elseif (b <= 2.8e+63) tmp = Float64(c + Float64(0.0625 * Float64(t * z))); else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = c + (a * (b * -0.25));
tmp = 0.0;
if (b <= -1.14e-7)
tmp = t_1;
elseif (b <= 1.36e-223)
tmp = c + (x * y);
elseif (b <= 2.8e+63)
tmp = c + (0.0625 * (t * z));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.14e-7], t$95$1, If[LessEqual[b, 1.36e-223], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.8e+63], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -1.14 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.36 \cdot 10^{-223}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+63}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -1.14000000000000002e-7 or 2.79999999999999987e63 < b Initial program 93.7%
Taylor expanded in a around inf 63.6%
*-commutative63.6%
associate-*l*64.3%
Simplified64.3%
if -1.14000000000000002e-7 < b < 1.35999999999999997e-223Initial program 100.0%
Taylor expanded in x around inf 64.9%
if 1.35999999999999997e-223 < b < 2.79999999999999987e63Initial program 100.0%
Taylor expanded in z around inf 65.0%
Final simplification64.6%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= t -9e-48)
t_1
(if (<= t 2.3e-44) (* x y) (if (<= t 2.9e+86) c t_1)))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if (t <= -9e-48) {
tmp = t_1;
} else if (t <= 2.3e-44) {
tmp = x * y;
} else if (t <= 2.9e+86) {
tmp = c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
if (t <= (-9d-48)) then
tmp = t_1
else if (t <= 2.3d-44) then
tmp = x * y
else if (t <= 2.9d+86) then
tmp = c
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if (t <= -9e-48) {
tmp = t_1;
} else if (t <= 2.3e-44) {
tmp = x * y;
} else if (t <= 2.9e+86) {
tmp = c;
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if t <= -9e-48: tmp = t_1 elif t <= 2.3e-44: tmp = x * y elif t <= 2.9e+86: tmp = c else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (t <= -9e-48) tmp = t_1; elseif (t <= 2.3e-44) tmp = Float64(x * y); elseif (t <= 2.9e+86) tmp = c; else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 0.0625 * (t * z);
tmp = 0.0;
if (t <= -9e-48)
tmp = t_1;
elseif (t <= 2.3e-44)
tmp = x * y;
elseif (t <= 2.9e+86)
tmp = c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9e-48], t$95$1, If[LessEqual[t, 2.3e-44], N[(x * y), $MachinePrecision], If[LessEqual[t, 2.9e+86], c, t$95$1]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;t \leq -9 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-44}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+86}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.99999999999999977e-48 or 2.8999999999999999e86 < t Initial program 97.4%
Taylor expanded in x around 0 82.2%
+-commutative82.2%
*-commutative82.2%
*-commutative82.2%
associate-*r*82.2%
*-commutative82.2%
*-commutative82.2%
associate-*r*82.2%
associate--l+82.2%
associate-*r*82.2%
*-commutative82.2%
*-commutative82.2%
sub-neg82.2%
+-commutative82.2%
distribute-rgt-neg-in82.2%
fma-def82.2%
distribute-rgt-neg-in82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in t around inf 49.0%
if -8.99999999999999977e-48 < t < 2.29999999999999998e-44Initial program 97.3%
Taylor expanded in x around inf 61.1%
Taylor expanded in y around inf 33.0%
if 2.29999999999999998e-44 < t < 2.8999999999999999e86Initial program 93.3%
Taylor expanded in c around inf 31.5%
Final simplification40.1%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= y -1.42e+26) (not (<= y 4e+52))) (+ c (* x y)) (+ c (* 0.0625 (* t z)))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y <= -1.42e+26) || !(y <= 4e+52)) {
tmp = c + (x * y);
} else {
tmp = c + (0.0625 * (t * z));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((y <= (-1.42d+26)) .or. (.not. (y <= 4d+52))) then
tmp = c + (x * y)
else
tmp = c + (0.0625d0 * (t * z))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y <= -1.42e+26) || !(y <= 4e+52)) {
tmp = c + (x * y);
} else {
tmp = c + (0.0625 * (t * z));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if (y <= -1.42e+26) or not (y <= 4e+52): tmp = c + (x * y) else: tmp = c + (0.0625 * (t * z)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((y <= -1.42e+26) || !(y <= 4e+52)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(0.0625 * Float64(t * z))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((y <= -1.42e+26) || ~((y <= 4e+52)))
tmp = c + (x * y);
else
tmp = c + (0.0625 * (t * z));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[y, -1.42e+26], N[Not[LessEqual[y, 4e+52]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+26} \lor \neg \left(y \leq 4 \cdot 10^{+52}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\end{array}
\end{array}
if y < -1.42e26 or 4e52 < y Initial program 95.1%
Taylor expanded in x around inf 65.7%
if -1.42e26 < y < 4e52Initial program 98.5%
Taylor expanded in z around inf 61.9%
Final simplification63.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= c -1.02e+127) c (if (<= c 6.6e-29) (* x y) c)))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -1.02e+127) {
tmp = c;
} else if (c <= 6.6e-29) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (c <= (-1.02d+127)) then
tmp = c
else if (c <= 6.6d-29) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -1.02e+127) {
tmp = c;
} else if (c <= 6.6e-29) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if c <= -1.02e+127: tmp = c elif c <= 6.6e-29: tmp = x * y else: tmp = c return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -1.02e+127) tmp = c; elseif (c <= 6.6e-29) tmp = Float64(x * y); else tmp = c; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (c <= -1.02e+127)
tmp = c;
elseif (c <= 6.6e-29)
tmp = x * y;
else
tmp = c;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -1.02e+127], c, If[LessEqual[c, 6.6e-29], N[(x * y), $MachinePrecision], c]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.02 \cdot 10^{+127}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 6.6 \cdot 10^{-29}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -1.02e127 or 6.60000000000000055e-29 < c Initial program 95.5%
Taylor expanded in c around inf 48.7%
if -1.02e127 < c < 6.60000000000000055e-29Initial program 98.0%
Taylor expanded in x around inf 40.6%
Taylor expanded in y around inf 35.2%
Final simplification41.1%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 c)
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = c
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): return c
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) return c end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = c;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in c around inf 25.8%
Final simplification25.8%
herbie shell --seed 2023174
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))