
(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 (+ (- z (* (log t) z)) (fma b (- a 0.5) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z - (log(t) * z)) + fma(b, (a - 0.5), (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z - Float64(log(t) * z)) + fma(b, Float64(a - 0.5), Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z - \log t \cdot z\right) + \mathsf{fma}\left(b, a - 0.5, x + y\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)) (t_2 (+ (fma (- a 0.5) b y) x)))
(if (<= t_1 -100000000.0)
t_2
(if (<= t_1 1e+174) (+ (fma (- 1.0 (log t)) z x) y) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = fma((a - 0.5), b, y) + x;
double tmp;
if (t_1 <= -100000000.0) {
tmp = t_2;
} else if (t_1 <= 1e+174) {
tmp = fma((1.0 - log(t)), z, x) + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(fma(Float64(a - 0.5), b, y) + x) tmp = 0.0 if (t_1 <= -100000000.0) tmp = t_2; elseif (t_1 <= 1e+174) tmp = Float64(fma(Float64(1.0 - log(t)), z, x) + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -100000000.0], t$95$2, If[LessEqual[t$95$1, 1e+174], N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision] + y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{if}\;t\_1 \leq -100000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+174}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, x\right) + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e8 or 1.00000000000000007e174 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6489.9
Applied rewrites89.9%
if -1e8 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000007e174Initial program 99.8%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites96.7%
Applied rewrites96.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)) (t_2 (+ (fma (- a 0.5) b y) x)))
(if (<= t_1 -100000000.0)
t_2
(if (<= t_1 1e+174) (fma (- 1.0 (log t)) z (+ x y)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = fma((a - 0.5), b, y) + x;
double tmp;
if (t_1 <= -100000000.0) {
tmp = t_2;
} else if (t_1 <= 1e+174) {
tmp = fma((1.0 - log(t)), z, (x + y));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(fma(Float64(a - 0.5), b, y) + x) tmp = 0.0 if (t_1 <= -100000000.0) tmp = t_2; elseif (t_1 <= 1e+174) tmp = fma(Float64(1.0 - log(t)), z, Float64(x + y)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -100000000.0], t$95$2, If[LessEqual[t$95$1, 1e+174], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{if}\;t\_1 \leq -100000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+174}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e8 or 1.00000000000000007e174 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6489.9
Applied rewrites89.9%
if -1e8 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000007e174Initial 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
*-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-+.f6496.7
Applied rewrites96.7%
Final simplification92.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -2e+150) (+ (* a b) (- (+ z (+ x y)) (* (log t) z))) (fma (- 1.0 (log t)) z (fma (- a 0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -2e+150) {
tmp = (a * b) + ((z + (x + y)) - (log(t) * z));
} else {
tmp = fma((1.0 - log(t)), z, fma((a - 0.5), b, y));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -2e+150) tmp = Float64(Float64(a * b) + Float64(Float64(z + Float64(x + y)) - Float64(log(t) * z))); else tmp = fma(Float64(1.0 - log(t)), z, fma(Float64(a - 0.5), b, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e+150], N[(N[(a * b), $MachinePrecision] + N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{+150}:\\
\;\;\;\;a \cdot b + \left(\left(z + \left(x + y\right)\right) - \log t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.99999999999999996e150Initial program 99.9%
Taylor expanded in a around inf
lower-*.f6497.7
Applied rewrites97.7%
if -1.99999999999999996e150 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites85.5%
Final simplification89.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (- a 0.5) b y)) (t_2 (fma (- 1.0 (log t)) z t_1))) (if (<= z -1.7e+107) t_2 (if (<= z 2.25e+119) (+ t_1 x) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((a - 0.5), b, y);
double t_2 = fma((1.0 - log(t)), z, t_1);
double tmp;
if (z <= -1.7e+107) {
tmp = t_2;
} else if (z <= 2.25e+119) {
tmp = t_1 + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(a - 0.5), b, y) t_2 = fma(Float64(1.0 - log(t)), z, t_1) tmp = 0.0 if (z <= -1.7e+107) tmp = t_2; elseif (z <= 2.25e+119) tmp = Float64(t_1 + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + t$95$1), $MachinePrecision]}, If[LessEqual[z, -1.7e+107], t$95$2, If[LessEqual[z, 2.25e+119], N[(t$95$1 + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a - 0.5, b, y\right)\\
t_2 := \mathsf{fma}\left(1 - \log t, z, t\_1\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+107}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+119}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.6999999999999998e107 or 2.2500000000000001e119 < z Initial program 99.7%
Taylor expanded in x around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites93.3%
if -1.6999999999999998e107 < z < 2.2500000000000001e119Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6498.4
Applied rewrites98.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ z (+ x y)) (* (log t) z)) -1.5e-8) (fma (- a 0.5) b x) (fma (- a 0.5) b y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z + (x + y)) - (log(t) * z)) <= -1.5e-8) {
tmp = fma((a - 0.5), b, x);
} else {
tmp = fma((a - 0.5), b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(z + Float64(x + y)) - Float64(log(t) * z)) <= -1.5e-8) tmp = fma(Float64(a - 0.5), b, x); else tmp = fma(Float64(a - 0.5), b, y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], -1.5e-8], N[(N[(a - 0.5), $MachinePrecision] * b + x), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(z + \left(x + y\right)\right) - \log t \cdot z \leq -1.5 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -1.49999999999999987e-8Initial program 99.9%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.7%
Taylor expanded in z around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6474.3
Applied rewrites74.3%
Taylor expanded in y around 0
Applied rewrites57.1%
if -1.49999999999999987e-8 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.9%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
*-lft-identityN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites81.9%
Taylor expanded in z around 0
Applied rewrites63.0%
Final simplification60.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z (* a b))))
(if (<= z -3.8e+165)
t_1
(if (<= z 1.25e+148) (+ (fma (- a 0.5) b y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, (a * b));
double tmp;
if (z <= -3.8e+165) {
tmp = t_1;
} else if (z <= 1.25e+148) {
tmp = fma((a - 0.5), b, y) + x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, Float64(a * b)) tmp = 0.0 if (z <= -3.8e+165) tmp = t_1; elseif (z <= 1.25e+148) tmp = Float64(fma(Float64(a - 0.5), b, y) + x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+165], t$95$1, If[LessEqual[z, 1.25e+148], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, a \cdot b\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.7999999999999999e165 or 1.25000000000000006e148 < z Initial program 99.6%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
*-lft-identityN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites93.9%
Taylor expanded in a around inf
Applied rewrites88.7%
if -3.7999999999999999e165 < z < 1.25000000000000006e148Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6494.6
Applied rewrites94.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= z -5.2e+168)
(fma t_1 z y)
(if (<= z 2.4e+149) (+ (fma (- a 0.5) b y) x) (fma t_1 z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 - log(t);
double tmp;
if (z <= -5.2e+168) {
tmp = fma(t_1, z, y);
} else if (z <= 2.4e+149) {
tmp = fma((a - 0.5), b, y) + x;
} else {
tmp = fma(t_1, z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (z <= -5.2e+168) tmp = fma(t_1, z, y); elseif (z <= 2.4e+149) tmp = Float64(fma(Float64(a - 0.5), b, y) + x); else tmp = fma(t_1, z, x); 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[z, -5.2e+168], N[(t$95$1 * z + y), $MachinePrecision], If[LessEqual[z, 2.4e+149], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], N[(t$95$1 * z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, y\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, x\right)\\
\end{array}
\end{array}
if z < -5.2e168Initial program 99.5%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
*-lft-identityN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites95.3%
Taylor expanded in b around 0
Applied rewrites76.3%
if -5.2e168 < z < 2.40000000000000012e149Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6494.1
Applied rewrites94.1%
if 2.40000000000000012e149 < z Initial program 99.7%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.4%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites82.2%
Taylor expanded in y around 0
Applied rewrites78.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= z -1.45e+216)
(* t_1 z)
(if (<= z 2.4e+149) (+ (fma (- a 0.5) b y) x) (fma t_1 z x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 - log(t);
double tmp;
if (z <= -1.45e+216) {
tmp = t_1 * z;
} else if (z <= 2.4e+149) {
tmp = fma((a - 0.5), b, y) + x;
} else {
tmp = fma(t_1, z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (z <= -1.45e+216) tmp = Float64(t_1 * z); elseif (z <= 2.4e+149) tmp = Float64(fma(Float64(a - 0.5), b, y) + x); else tmp = fma(t_1, z, x); 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[z, -1.45e+216], N[(t$95$1 * z), $MachinePrecision], If[LessEqual[z, 2.4e+149], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], N[(t$95$1 * z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+216}:\\
\;\;\;\;t\_1 \cdot z\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, x\right)\\
\end{array}
\end{array}
if z < -1.45e216Initial program 99.4%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f6485.7
Applied rewrites85.7%
if -1.45e216 < z < 2.40000000000000012e149Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6493.0
Applied rewrites93.0%
if 2.40000000000000012e149 < z Initial program 99.7%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.4%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites82.2%
Taylor expanded in y around 0
Applied rewrites78.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.45e+216) (* (- 1.0 (log t)) z) (if (<= z 2.5e+149) (+ (fma (- a 0.5) b y) x) (- z (* (log t) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.45e+216) {
tmp = (1.0 - log(t)) * z;
} else if (z <= 2.5e+149) {
tmp = fma((a - 0.5), b, y) + x;
} else {
tmp = z - (log(t) * z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.45e+216) tmp = Float64(Float64(1.0 - log(t)) * z); elseif (z <= 2.5e+149) tmp = Float64(fma(Float64(a - 0.5), b, y) + x); else tmp = Float64(z - Float64(log(t) * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.45e+216], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 2.5e+149], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+216}:\\
\;\;\;\;\left(1 - \log t\right) \cdot z\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{else}:\\
\;\;\;\;z - \log t \cdot z\\
\end{array}
\end{array}
if z < -1.45e216Initial program 99.4%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f6485.7
Applied rewrites85.7%
if -1.45e216 < z < 2.49999999999999995e149Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6493.0
Applied rewrites93.0%
if 2.49999999999999995e149 < 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
*-commutativeN/A
lower-*.f64N/A
lower-log.f6472.0
Applied rewrites72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- z (* (log t) z))))
(if (<= z -1.45e+216)
t_1
(if (<= z 2.5e+149) (+ (fma (- a 0.5) b y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z - (log(t) * z);
double tmp;
if (z <= -1.45e+216) {
tmp = t_1;
} else if (z <= 2.5e+149) {
tmp = fma((a - 0.5), b, y) + x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z - Float64(log(t) * z)) tmp = 0.0 if (z <= -1.45e+216) tmp = t_1; elseif (z <= 2.5e+149) tmp = Float64(fma(Float64(a - 0.5), b, y) + x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e+216], t$95$1, If[LessEqual[z, 2.5e+149], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z - \log t \cdot z\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+216}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.45e216 or 2.49999999999999995e149 < z Initial program 99.6%
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
*-commutativeN/A
lower-*.f64N/A
lower-log.f6476.4
Applied rewrites76.4%
if -1.45e216 < z < 2.49999999999999995e149Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6493.0
Applied rewrites93.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b)) (t_2 (fma (- a 0.5) b y))) (if (<= t_1 -5e+46) t_2 (if (<= t_1 1e+176) (+ x y) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = fma((a - 0.5), b, y);
double tmp;
if (t_1 <= -5e+46) {
tmp = t_2;
} else if (t_1 <= 1e+176) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = fma(Float64(a - 0.5), b, y) tmp = 0.0 if (t_1 <= -5e+46) tmp = t_2; elseif (t_1 <= 1e+176) tmp = Float64(x + y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+46], t$95$2, If[LessEqual[t$95$1, 1e+176], N[(x + y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \mathsf{fma}\left(a - 0.5, b, y\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+176}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000002e46 or 1e176 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
associate-+r+N/A
*-commutativeN/A
distribute-lft-neg-inN/A
*-lft-identityN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in z around 0
Applied rewrites77.1%
if -5.0000000000000002e46 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1e176Initial program 99.8%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.6%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.1%
Taylor expanded in z around 0
Applied rewrites59.8%
Final simplification68.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -5e+204) t_1 (if (<= t_1 1e+200) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+204) {
tmp = t_1;
} else if (t_1 <= 1e+200) {
tmp = x + y;
} 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 - 0.5d0) * b
if (t_1 <= (-5d+204)) then
tmp = t_1
else if (t_1 <= 1d+200) then
tmp = x + y
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 - 0.5) * b;
double tmp;
if (t_1 <= -5e+204) {
tmp = t_1;
} else if (t_1 <= 1e+200) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -5e+204: tmp = t_1 elif t_1 <= 1e+200: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -5e+204) tmp = t_1; elseif (t_1 <= 1e+200) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -5e+204) tmp = t_1; elseif (t_1 <= 1e+200) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+204], t$95$1, If[LessEqual[t$95$1, 1e+200], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+200}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.00000000000000008e204 or 9.9999999999999997e199 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6489.8
Applied rewrites89.8%
if -5.00000000000000008e204 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999997e199Initial program 99.8%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.6%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites86.4%
Taylor expanded in z around 0
Applied rewrites54.4%
Final simplification66.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -5e+215) (* a b) (if (<= t_1 1e+200) (+ x y) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+215) {
tmp = a * b;
} else if (t_1 <= 1e+200) {
tmp = x + y;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (a - 0.5d0) * b
if (t_1 <= (-5d+215)) then
tmp = a * b
else if (t_1 <= 1d+200) then
tmp = x + y
else
tmp = 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 t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+215) {
tmp = a * b;
} else if (t_1 <= 1e+200) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -5e+215: tmp = a * b elif t_1 <= 1e+200: tmp = x + y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -5e+215) tmp = Float64(a * b); elseif (t_1 <= 1e+200) tmp = Float64(x + y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -5e+215) tmp = a * b; elseif (t_1 <= 1e+200) tmp = x + y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+215], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, 1e+200], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+215}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq 10^{+200}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000001e215 or 9.9999999999999997e199 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in a around inf
lower-*.f6473.6
Applied rewrites73.6%
if -5.0000000000000001e215 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999997e199Initial program 99.8%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.6%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in z around 0
Applied rewrites53.8%
Final simplification60.1%
(FPCore (x y z t a b) :precision binary64 (+ (fma (- a 0.5) b y) x))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a - 0.5), b, y) + x;
}
function code(x, y, z, t, a, b) return Float64(fma(Float64(a - 0.5), b, y) + x) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a - 0.5, b, y\right) + x
\end{array}
Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6477.0
Applied rewrites77.0%
(FPCore (x y z t a b) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
def code(x, y, z, t, a, b): return x + y
function code(x, y, z, t, a, b) return Float64(x + y) end
function tmp = code(x, y, z, t, a, b) tmp = x + y; end
code[x_, y_, z_, t_, a_, b_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 99.9%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
Applied rewrites99.7%
Taylor expanded in b around 0
associate-+r+N/A
*-lft-identityN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
associate-+r+N/A
+-commutativeN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.2%
Taylor expanded in z around 0
Applied rewrites38.7%
Final simplification38.7%
(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 2024255
(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)))