
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * 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) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * 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) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ y (fma z (- 1.0 (log t)) (fma b (+ a -0.5) x))))
double code(double x, double y, double z, double t, double a, double b) {
return y + fma(z, (1.0 - log(t)), fma(b, (a + -0.5), x));
}
function code(x, y, z, t, a, b) return Float64(y + fma(z, Float64(1.0 - log(t)), fma(b, Float64(a + -0.5), x))) end
code[x_, y_, z_, t_, a_, b_] := N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(b, a + -0.5, x\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* b (- a 0.5)) (- (+ z (+ y x)) (* z (log t))))))
(if (<= t_1 -5e+306)
(* b a)
(if (<= t_1 1e+225) (+ y (fma b -0.5 x)) (+ y (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a - 0.5)) + ((z + (y + x)) - (z * log(t)));
double tmp;
if (t_1 <= -5e+306) {
tmp = b * a;
} else if (t_1 <= 1e+225) {
tmp = y + fma(b, -0.5, x);
} else {
tmp = y + (b * a);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a - 0.5)) + Float64(Float64(z + Float64(y + x)) - Float64(z * log(t)))) tmp = 0.0 if (t_1 <= -5e+306) tmp = Float64(b * a); elseif (t_1 <= 1e+225) tmp = Float64(y + fma(b, -0.5, x)); else tmp = Float64(y + Float64(b * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+306], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 1e+225], N[(y + N[(b * -0.5 + x), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right) + \left(\left(z + \left(y + x\right)\right) - z \cdot \log t\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+306}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq 10^{+225}:\\
\;\;\;\;y + \mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -4.99999999999999993e306Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64100.0
Simplified100.0%
if -4.99999999999999993e306 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 9.99999999999999928e224Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified75.4%
Taylor expanded in x around inf
lower-/.f6461.2
Simplified61.2%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6464.2
Simplified64.2%
if 9.99999999999999928e224 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6455.8
Simplified55.8%
Final simplification65.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (fma b (+ a -0.5) x)))
(if (<= t_1 -2e+237)
t_2
(if (<= t_1 4e+68)
(+ x (fma b -0.5 (fma z (- 1.0 (log t)) y)))
(+ y t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = fma(b, (a + -0.5), x);
double tmp;
if (t_1 <= -2e+237) {
tmp = t_2;
} else if (t_1 <= 4e+68) {
tmp = x + fma(b, -0.5, fma(z, (1.0 - log(t)), y));
} else {
tmp = y + t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = fma(b, Float64(a + -0.5), x) tmp = 0.0 if (t_1 <= -2e+237) tmp = t_2; elseif (t_1 <= 4e+68) tmp = Float64(x + fma(b, -0.5, fma(z, Float64(1.0 - log(t)), y))); else tmp = Float64(y + t_2); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+237], t$95$2, If[LessEqual[t$95$1, 4e+68], N[(x + N[(b * -0.5 + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+237}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+68}:\\
\;\;\;\;x + \mathsf{fma}\left(b, -0.5, \mathsf{fma}\left(z, 1 - \log t, y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y + t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.99999999999999988e237Initial program 100.0%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64100.0
Simplified100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64100.0
Simplified100.0%
if -1.99999999999999988e237 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.99999999999999981e68Initial program 99.8%
Taylor expanded in a around 0
associate--l+N/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate--l+N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
cancel-sign-sub-invN/A
associate-+l+N/A
cancel-sign-sub-invN/A
Simplified96.4%
if 3.99999999999999981e68 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6488.3
Simplified88.3%
Final simplification94.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (+ y (fma b (+ a -0.5) x))))
(if (<= t_1 -2e+108)
t_2
(if (<= t_1 4e+68) (fma z (- 1.0 (log t)) (+ y x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = y + fma(b, (a + -0.5), x);
double tmp;
if (t_1 <= -2e+108) {
tmp = t_2;
} else if (t_1 <= 4e+68) {
tmp = fma(z, (1.0 - log(t)), (y + x));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(y + fma(b, Float64(a + -0.5), x)) tmp = 0.0 if (t_1 <= -2e+108) tmp = t_2; elseif (t_1 <= 4e+68) tmp = fma(z, Float64(1.0 - log(t)), Float64(y + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+108], t$95$2, If[LessEqual[t$95$1, 4e+68], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+108}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+68}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - \log t, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.0000000000000001e108 or 3.99999999999999981e68 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6490.0
Simplified90.0%
if -2.0000000000000001e108 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 3.99999999999999981e68Initial program 99.8%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6495.2
Simplified95.2%
Final simplification92.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ z (+ y x)) (* z (log t))) -5e-187) (fma b (+ a -0.5) x) (fma b (+ a -0.5) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z + (y + x)) - (z * log(t))) <= -5e-187) {
tmp = fma(b, (a + -0.5), x);
} else {
tmp = fma(b, (a + -0.5), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(z + Float64(y + x)) - Float64(z * log(t))) <= -5e-187) tmp = fma(b, Float64(a + -0.5), x); else tmp = fma(b, Float64(a + -0.5), y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-187], N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(z + \left(y + x\right)\right) - z \cdot \log t \leq -5 \cdot 10^{-187}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -4.9999999999999996e-187Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6480.1
Simplified80.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6452.0
Simplified52.0%
if -4.9999999999999996e-187 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.8%
Taylor expanded in x around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+r+N/A
*-rgt-identityN/A
distribute-lft-inN/A
+-commutativeN/A
log-recN/A
sub-negN/A
sub-negN/A
mul-1-negN/A
Simplified73.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6453.8
Simplified53.8%
Final simplification52.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= (+ y x) -5e-187)
(fma b (+ a -0.5) (fma z t_1 x))
(fma z t_1 (fma b (+ a -0.5) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 - log(t);
double tmp;
if ((y + x) <= -5e-187) {
tmp = fma(b, (a + -0.5), fma(z, t_1, x));
} else {
tmp = fma(z, t_1, fma(b, (a + -0.5), y));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (Float64(y + x) <= -5e-187) tmp = fma(b, Float64(a + -0.5), fma(z, t_1, x)); else tmp = fma(z, t_1, fma(b, Float64(a + -0.5), y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y + x), $MachinePrecision], -5e-187], N[(b * N[(a + -0.5), $MachinePrecision] + N[(z * t$95$1 + x), $MachinePrecision]), $MachinePrecision], N[(z * t$95$1 + N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;y + x \leq -5 \cdot 10^{-187}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, \mathsf{fma}\left(z, t\_1, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, \mathsf{fma}\left(b, a + -0.5, y\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999996e-187Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6478.0
Simplified78.0%
if -4.9999999999999996e-187 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
associate-+r+N/A
*-rgt-identityN/A
distribute-lft-inN/A
+-commutativeN/A
log-recN/A
sub-negN/A
sub-negN/A
mul-1-negN/A
Simplified75.6%
Final simplification76.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= (+ y x) 2e+98)
(fma b (+ a -0.5) (fma z t_1 x))
(+ x (fma b -0.5 (fma z t_1 y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 - log(t);
double tmp;
if ((y + x) <= 2e+98) {
tmp = fma(b, (a + -0.5), fma(z, t_1, x));
} else {
tmp = x + fma(b, -0.5, fma(z, t_1, y));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (Float64(y + x) <= 2e+98) tmp = fma(b, Float64(a + -0.5), fma(z, t_1, x)); else tmp = Float64(x + fma(b, -0.5, fma(z, t_1, y))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y + x), $MachinePrecision], 2e+98], N[(b * N[(a + -0.5), $MachinePrecision] + N[(z * t$95$1 + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * -0.5 + N[(z * t$95$1 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;y + x \leq 2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, \mathsf{fma}\left(z, t\_1, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(b, -0.5, \mathsf{fma}\left(z, t\_1, y\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 2e98Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6482.9
Simplified82.9%
if 2e98 < (+.f64 x y) Initial program 99.9%
Taylor expanded in a around 0
associate--l+N/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate--l+N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
cancel-sign-sub-invN/A
associate-+l+N/A
cancel-sign-sub-invN/A
Simplified87.5%
Final simplification84.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- 1.0 (log t)) x)))
(if (<= z -1.5e+186)
t_1
(if (<= z 4.7e+204) (+ y (fma b (+ a -0.5) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (1.0 - log(t)), x);
double tmp;
if (z <= -1.5e+186) {
tmp = t_1;
} else if (z <= 4.7e+204) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(1.0 - log(t)), x) tmp = 0.0 if (z <= -1.5e+186) tmp = t_1; elseif (z <= 4.7e+204) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.5e+186], t$95$1, If[LessEqual[z, 4.7e+204], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, 1 - \log t, x\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+204}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.49999999999999991e186 or 4.7000000000000002e204 < z Initial program 99.7%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.8%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6486.8
Simplified86.8%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6469.3
Simplified69.3%
if -1.49999999999999991e186 < z < 4.7000000000000002e204Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6486.3
Simplified86.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (log t)) z z)))
(if (<= z -4.2e+189)
t_1
(if (<= z 4.8e+254) (+ y (fma b (+ a -0.5) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(-log(t), z, z);
double tmp;
if (z <= -4.2e+189) {
tmp = t_1;
} else if (z <= 4.8e+254) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-log(t)), z, z) tmp = 0.0 if (z <= -4.2e+189) tmp = t_1; elseif (z <= 4.8e+254) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-N[Log[t], $MachinePrecision]) * z + z), $MachinePrecision]}, If[LessEqual[z, -4.2e+189], t$95$1, If[LessEqual[z, 4.8e+254], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-\log t, z, z\right)\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+254}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.19999999999999985e189 or 4.7999999999999997e254 < z Initial program 99.7%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
distribute-lft-inN/A
*-rgt-identityN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6473.1
Simplified73.1%
lift-log.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6473.3
Applied egg-rr73.3%
if -4.19999999999999985e189 < z < 4.7999999999999997e254Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6484.2
Simplified84.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- z (* z (log t)))))
(if (<= z -4.2e+189)
t_1
(if (<= z 4.8e+254) (+ y (fma b (+ a -0.5) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z - (z * log(t));
double tmp;
if (z <= -4.2e+189) {
tmp = t_1;
} else if (z <= 4.8e+254) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z - Float64(z * log(t))) tmp = 0.0 if (z <= -4.2e+189) tmp = t_1; elseif (z <= 4.8e+254) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+189], t$95$1, If[LessEqual[z, 4.8e+254], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z - z \cdot \log t\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+254}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.19999999999999985e189 or 4.7999999999999997e254 < z Initial program 99.7%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
distribute-lft-inN/A
*-rgt-identityN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6473.1
Simplified73.1%
if -4.19999999999999985e189 < z < 4.7999999999999997e254Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6484.2
Simplified84.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+306)
(* b a)
(if (<= t_1 -5e+214) (* b -0.5) (if (<= t_1 5e+211) (+ y x) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -5e+306) {
tmp = b * a;
} else if (t_1 <= -5e+214) {
tmp = b * -0.5;
} else if (t_1 <= 5e+211) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (t_1 <= (-5d+306)) then
tmp = b * a
else if (t_1 <= (-5d+214)) then
tmp = b * (-0.5d0)
else if (t_1 <= 5d+211) then
tmp = y + x
else
tmp = b * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -5e+306) {
tmp = b * a;
} else if (t_1 <= -5e+214) {
tmp = b * -0.5;
} else if (t_1 <= 5e+211) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -5e+306: tmp = b * a elif t_1 <= -5e+214: tmp = b * -0.5 elif t_1 <= 5e+211: tmp = y + x else: tmp = b * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -5e+306) tmp = Float64(b * a); elseif (t_1 <= -5e+214) tmp = Float64(b * -0.5); elseif (t_1 <= 5e+211) tmp = Float64(y + x); else tmp = Float64(b * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -5e+306) tmp = b * a; elseif (t_1 <= -5e+214) tmp = b * -0.5; elseif (t_1 <= 5e+211) tmp = y + x; else tmp = b * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+306], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -5e+214], N[(b * -0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e+211], N[(y + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+306}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+214}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+211}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.99999999999999993e306 or 4.9999999999999995e211 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6479.2
Simplified79.2%
if -4.99999999999999993e306 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.99999999999999953e214Initial program 99.9%
Taylor expanded in b around inf
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6483.1
Simplified83.1%
Taylor expanded in a around 0
Simplified71.2%
if -4.99999999999999953e214 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.9999999999999995e211Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified75.5%
Taylor expanded in x around inf
lower-/.f6456.8
Simplified56.8%
Taylor expanded in b around 0
lower-+.f6457.5
Simplified57.5%
Final simplification63.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5))) (t_2 (* b (+ a -0.5)))) (if (<= t_1 -5e+214) t_2 (if (<= t_1 2e+165) (+ y x) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = b * (a + -0.5);
double tmp;
if (t_1 <= -5e+214) {
tmp = t_2;
} else if (t_1 <= 2e+165) {
tmp = y + x;
} 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 = b * (a - 0.5d0)
t_2 = b * (a + (-0.5d0))
if (t_1 <= (-5d+214)) then
tmp = t_2
else if (t_1 <= 2d+165) then
tmp = y + x
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 = b * (a - 0.5);
double t_2 = b * (a + -0.5);
double tmp;
if (t_1 <= -5e+214) {
tmp = t_2;
} else if (t_1 <= 2e+165) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = b * (a + -0.5) tmp = 0 if t_1 <= -5e+214: tmp = t_2 elif t_1 <= 2e+165: tmp = y + x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(b * Float64(a + -0.5)) tmp = 0.0 if (t_1 <= -5e+214) tmp = t_2; elseif (t_1 <= 2e+165) tmp = Float64(y + x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = b * (a + -0.5); tmp = 0.0; if (t_1 <= -5e+214) tmp = t_2; elseif (t_1 <= 2e+165) tmp = y + x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+214], t$95$2, If[LessEqual[t$95$1, 2e+165], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+214}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+165}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.99999999999999953e214 or 1.9999999999999998e165 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in b around inf
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6482.6
Simplified82.6%
if -4.99999999999999953e214 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e165Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified76.0%
Taylor expanded in x around inf
lower-/.f6455.4
Simplified55.4%
Taylor expanded in b around 0
lower-+.f6458.4
Simplified58.4%
Final simplification66.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ y x) 5e-136) (fma b (+ a -0.5) x) (+ y (* b a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= 5e-136) {
tmp = fma(b, (a + -0.5), x);
} else {
tmp = y + (b * a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y + x) <= 5e-136) tmp = fma(b, Float64(a + -0.5), x); else tmp = Float64(y + Float64(b * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], 5e-136], N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot a\\
\end{array}
\end{array}
if (+.f64 x y) < 5.0000000000000002e-136Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6481.0
Simplified81.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6453.9
Simplified53.9%
if 5.0000000000000002e-136 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
lower-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6444.6
Simplified44.6%
Final simplification49.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5e+170) (* b -0.5) (if (<= b 2e+213) (+ y x) (* b -0.5))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5e+170) {
tmp = b * -0.5;
} else if (b <= 2e+213) {
tmp = y + x;
} else {
tmp = b * -0.5;
}
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 (b <= (-5d+170)) then
tmp = b * (-0.5d0)
else if (b <= 2d+213) then
tmp = y + x
else
tmp = b * (-0.5d0)
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 (b <= -5e+170) {
tmp = b * -0.5;
} else if (b <= 2e+213) {
tmp = y + x;
} else {
tmp = b * -0.5;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5e+170: tmp = b * -0.5 elif b <= 2e+213: tmp = y + x else: tmp = b * -0.5 return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5e+170) tmp = Float64(b * -0.5); elseif (b <= 2e+213) tmp = Float64(y + x); else tmp = Float64(b * -0.5); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5e+170) tmp = b * -0.5; elseif (b <= 2e+213) tmp = y + x; else tmp = b * -0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5e+170], N[(b * -0.5), $MachinePrecision], If[LessEqual[b, 2e+213], N[(y + x), $MachinePrecision], N[(b * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+170}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+213}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot -0.5\\
\end{array}
\end{array}
if b < -4.99999999999999977e170 or 1.99999999999999997e213 < b Initial program 99.9%
Taylor expanded in b around inf
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6486.3
Simplified86.3%
Taylor expanded in a around 0
Simplified44.2%
if -4.99999999999999977e170 < b < 1.99999999999999997e213Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified76.9%
Taylor expanded in x around inf
lower-/.f6461.0
Simplified61.0%
Taylor expanded in b around 0
lower-+.f6450.8
Simplified50.8%
Final simplification49.7%
(FPCore (x y z t a b) :precision binary64 (+ y (fma b (+ a -0.5) x)))
double code(double x, double y, double z, double t, double a, double b) {
return y + fma(b, (a + -0.5), x);
}
function code(x, y, z, t, a, b) return Float64(y + fma(b, Float64(a + -0.5), x)) end
code[x_, y_, z_, t_, a_, b_] := N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \mathsf{fma}\left(b, a + -0.5, x\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6474.9
Simplified74.9%
(FPCore (x y z t a b) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a, double b) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y + x;
}
def code(x, y, z, t, a, b): return y + x
function code(x, y, z, t, a, b) return Float64(y + x) end
function tmp = code(x, y, z, t, a, b) tmp = y + x; end
code[x_, y_, z_, t_, a_, b_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
associate--l+N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Simplified77.2%
Taylor expanded in x around inf
lower-/.f6465.7
Simplified65.7%
Taylor expanded in b around 0
lower-+.f6443.3
Simplified43.3%
Final simplification43.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * 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) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024212
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))