
(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 21 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 (- (+ x y) (* z (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (z + ((x + y) - (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 = (z + ((x + y) - (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 (z + ((x + y) - (z * Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (z + ((x + y) - (z * math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(z + Float64(Float64(x + y) - Float64(z * log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (z + ((x + y) - (z * log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z + N[(N[(x + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z + \left(\left(x + y\right) - z \cdot \log t\right)\right) + \left(a - 0.5\right) \cdot b
\end{array}
Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- a 0.5) b) (- (+ z (+ x y)) (* z (log t))))))
(if (<= t_1 -2e+305)
(* a b)
(if (<= t_1 1e-21) (fma b -0.5 x) (if (<= t_1 2e+303) (+ z y) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a - 0.5) * b) + ((z + (x + y)) - (z * log(t)));
double tmp;
if (t_1 <= -2e+305) {
tmp = a * b;
} else if (t_1 <= 1e-21) {
tmp = fma(b, -0.5, x);
} else if (t_1 <= 2e+303) {
tmp = z + y;
} else {
tmp = a * b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a - 0.5) * b) + Float64(Float64(z + Float64(x + y)) - Float64(z * log(t)))) tmp = 0.0 if (t_1 <= -2e+305) tmp = Float64(a * b); elseif (t_1 <= 1e-21) tmp = fma(b, -0.5, x); elseif (t_1 <= 2e+303) tmp = Float64(z + y); else tmp = Float64(a * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision] + N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+305], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, 1e-21], N[(b * -0.5 + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+303], N[(z + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b + \left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+305}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;z + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\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)) < -1.9999999999999999e305 or 2e303 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6494.2
Simplified94.2%
if -1.9999999999999999e305 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 9.99999999999999908e-22Initial program 99.8%
Taylor expanded in x around inf
Simplified56.5%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6443.1
Simplified43.1%
if 9.99999999999999908e-22 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 2e303Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6490.2
Simplified90.2%
Taylor expanded in y around inf
Simplified39.4%
Taylor expanded in b around 0
+-lowering-+.f6428.1
Simplified28.1%
Final simplification43.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- a 0.5) b) (- (+ z (+ x y)) (* z (log t))))))
(if (<= t_1 -2e+305)
(* a b)
(if (<= t_1 20.0) (fma b -0.5 x) (fma b a y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a - 0.5) * b) + ((z + (x + y)) - (z * log(t)));
double tmp;
if (t_1 <= -2e+305) {
tmp = a * b;
} else if (t_1 <= 20.0) {
tmp = fma(b, -0.5, x);
} else {
tmp = fma(b, a, y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a - 0.5) * b) + Float64(Float64(z + Float64(x + y)) - Float64(z * log(t)))) tmp = 0.0 if (t_1 <= -2e+305) tmp = Float64(a * b); elseif (t_1 <= 20.0) tmp = fma(b, -0.5, x); else tmp = fma(b, a, y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision] + N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+305], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, 20.0], N[(b * -0.5 + x), $MachinePrecision], N[(b * a + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b + \left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+305}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq 20:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right)\\
\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)) < -1.9999999999999999e305Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64100.0
Simplified100.0%
if -1.9999999999999999e305 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 20Initial program 99.8%
Taylor expanded in x around inf
Simplified55.1%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6442.1
Simplified42.1%
if 20 < (+.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%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6490.7
Simplified90.7%
Taylor expanded in y around inf
Simplified47.7%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6446.8
Simplified46.8%
Final simplification47.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)) (t_2 (fma z (- 1.0 (log t)) y)))
(if (<= t_1 -6e+111)
(+ y (fma b (+ a -0.5) x))
(if (<= t_1 5e+88) (+ x (fma b -0.5 t_2)) (fma b (+ a -0.5) 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(z, (1.0 - log(t)), y);
double tmp;
if (t_1 <= -6e+111) {
tmp = y + fma(b, (a + -0.5), x);
} else if (t_1 <= 5e+88) {
tmp = x + fma(b, -0.5, t_2);
} else {
tmp = fma(b, (a + -0.5), t_2);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = fma(z, Float64(1.0 - log(t)), y) tmp = 0.0 if (t_1 <= -6e+111) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); elseif (t_1 <= 5e+88) tmp = Float64(x + fma(b, -0.5, t_2)); else tmp = fma(b, Float64(a + -0.5), 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[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+111], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+88], N[(x + N[(b * -0.5 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \mathsf{fma}\left(z, 1 - \log t, y\right)\\
\mathbf{if}\;t\_1 \leq -6 \cdot 10^{+111}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+88}:\\
\;\;\;\;x + \mathsf{fma}\left(b, -0.5, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -6e111Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6494.4
Simplified94.4%
if -6e111 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999997e88Initial program 99.9%
Taylor expanded in a around 0
associate--l+N/A
+-lowering-+.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
accelerator-lowering-fma.f64N/A
cancel-sign-sub-invN/A
associate-+l+N/A
cancel-sign-sub-invN/A
Simplified96.3%
if 4.99999999999999997e88 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around 0
associate--l+N/A
sub-negN/A
+-commutativeN/A
associate-+r+N/A
*-lft-identityN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
sub-negN/A
log-recN/A
Simplified90.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)) (t_2 (+ y (fma b (+ a -0.5) x))))
(if (<= t_1 -6e+111)
t_2
(if (<= t_1 2e+141) (fma z (- 1.0 (log t)) (+ 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 = y + fma(b, (a + -0.5), x);
double tmp;
if (t_1 <= -6e+111) {
tmp = t_2;
} else if (t_1 <= 2e+141) {
tmp = fma(z, (1.0 - log(t)), (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(y + fma(b, Float64(a + -0.5), x)) tmp = 0.0 if (t_1 <= -6e+111) tmp = t_2; elseif (t_1 <= 2e+141) tmp = fma(z, Float64(1.0 - log(t)), 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[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+111], t$95$2, If[LessEqual[t$95$1, 2e+141], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + 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 := y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{if}\;t\_1 \leq -6 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - \log t, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -6e111 or 2.00000000000000003e141 < (*.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
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6492.2
Simplified92.2%
if -6e111 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.00000000000000003e141Initial program 99.9%
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
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6490.4
Simplified90.4%
Final simplification91.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= (- a 0.5) -5000000000000.0)
(+ y (fma b (+ a -0.5) x))
(if (<= (- a 0.5) 1e+38)
(+ x (fma b -0.5 (fma z t_1 y)))
(fma z t_1 (fma a b 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 ((a - 0.5) <= -5000000000000.0) {
tmp = y + fma(b, (a + -0.5), x);
} else if ((a - 0.5) <= 1e+38) {
tmp = x + fma(b, -0.5, fma(z, t_1, y));
} else {
tmp = fma(z, t_1, fma(a, b, y));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5000000000000.0) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); elseif (Float64(a - 0.5) <= 1e+38) tmp = Float64(x + fma(b, -0.5, fma(z, t_1, y))); else tmp = fma(z, t_1, fma(a, b, 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[(a - 0.5), $MachinePrecision], -5000000000000.0], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+38], N[(x + N[(b * -0.5 + N[(z * t$95$1 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t$95$1 + N[(a * b + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;a - 0.5 \leq -5000000000000:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{elif}\;a - 0.5 \leq 10^{+38}:\\
\;\;\;\;x + \mathsf{fma}\left(b, -0.5, \mathsf{fma}\left(z, t\_1, y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, \mathsf{fma}\left(a, b, y\right)\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5e12Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6486.4
Simplified86.4%
if -5e12 < (-.f64 a #s(literal 1/2 binary64)) < 9.99999999999999977e37Initial program 99.8%
Taylor expanded in a around 0
associate--l+N/A
+-lowering-+.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
accelerator-lowering-fma.f64N/A
cancel-sign-sub-invN/A
associate-+l+N/A
cancel-sign-sub-invN/A
Simplified98.3%
if 9.99999999999999977e37 < (-.f64 a #s(literal 1/2 binary64)) Initial program 100.0%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64100.0
Applied egg-rr100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64100.0
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-+r-N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
*-rgt-identityN/A
distribute-lft-inN/A
log-recN/A
sub-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6484.6
Simplified84.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= (+ x y) -1e+107)
(+ (* (- a 0.5) b) (+ z x))
(if (<= (+ x y) 1e+16)
(fma z t_1 (* b (+ a -0.5)))
(fma z t_1 (fma a b 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 ((x + y) <= -1e+107) {
tmp = ((a - 0.5) * b) + (z + x);
} else if ((x + y) <= 1e+16) {
tmp = fma(z, t_1, (b * (a + -0.5)));
} else {
tmp = fma(z, t_1, fma(a, b, y));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (Float64(x + y) <= -1e+107) tmp = Float64(Float64(Float64(a - 0.5) * b) + Float64(z + x)); elseif (Float64(x + y) <= 1e+16) tmp = fma(z, t_1, Float64(b * Float64(a + -0.5))); else tmp = fma(z, t_1, fma(a, b, 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[(x + y), $MachinePrecision], -1e+107], N[(N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision] + N[(z + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 1e+16], N[(z * t$95$1 + N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t$95$1 + N[(a * b + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{+107}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b + \left(z + x\right)\\
\mathbf{elif}\;x + y \leq 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, b \cdot \left(a + -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, \mathsf{fma}\left(a, b, y\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -9.9999999999999997e106Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around inf
Simplified68.2%
if -9.9999999999999997e106 < (+.f64 x y) < 1e16Initial program 99.8%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.8
Applied egg-rr99.8%
Taylor expanded in x around 0
associate--l+N/A
sub-negN/A
+-commutativeN/A
associate-+r+N/A
*-lft-identityN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
sub-negN/A
log-recN/A
Simplified92.1%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6487.2
Simplified87.2%
if 1e16 < (+.f64 x y) Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6494.8
Simplified94.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate-+r-N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
*-rgt-identityN/A
distribute-lft-inN/A
log-recN/A
sub-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6462.8
Simplified62.8%
Final simplification73.5%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* (- a 0.5) b) (- (+ z (+ x y)) (* z (log t)))) -2e-151) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((a - 0.5) * b) + ((z + (x + y)) - (z * log(t)))) <= -2e-151) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((((a - 0.5d0) * b) + ((z + (x + y)) - (z * log(t)))) <= (-2d-151)) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((a - 0.5) * b) + ((z + (x + y)) - (z * Math.log(t)))) <= -2e-151) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (((a - 0.5) * b) + ((z + (x + y)) - (z * math.log(t)))) <= -2e-151: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(a - 0.5) * b) + Float64(Float64(z + Float64(x + y)) - Float64(z * log(t)))) <= -2e-151) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((((a - 0.5) * b) + ((z + (x + y)) - (z * log(t)))) <= -2e-151) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision] + N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-151], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a - 0.5\right) \cdot b + \left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) \leq -2 \cdot 10^{-151}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\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)) < -1.9999999999999999e-151Initial program 99.9%
Taylor expanded in x around inf
Simplified24.3%
if -1.9999999999999999e-151 < (+.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 y around inf
Simplified22.6%
Final simplification23.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ z (+ x y)) (* z (log t))) -2e-151) (fma (+ a -0.5) b 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 + (x + y)) - (z * log(t))) <= -2e-151) {
tmp = fma((a + -0.5), b, 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(x + y)) - Float64(z * log(t))) <= -2e-151) tmp = fma(Float64(a + -0.5), b, 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[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-151], N[(N[(a + -0.5), $MachinePrecision] * b + x), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(z + \left(x + y\right)\right) - z \cdot \log t \leq -2 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, b, 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))) < -1.9999999999999999e-151Initial program 99.9%
Taylor expanded in x around inf
Simplified62.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6462.9
Applied egg-rr62.9%
if -1.9999999999999999e-151 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6476.9
Simplified76.9%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6452.6
Simplified52.6%
Final simplification57.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= (+ x y) -2e-151)
(fma z t_1 (fma b (+ a -0.5) x))
(fma b (+ a -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 ((x + y) <= -2e-151) {
tmp = fma(z, t_1, fma(b, (a + -0.5), x));
} else {
tmp = fma(b, (a + -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(x + y) <= -2e-151) tmp = fma(z, t_1, fma(b, Float64(a + -0.5), x)); else tmp = fma(b, Float64(a + -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[(x + y), $MachinePrecision], -2e-151], N[(z * t$95$1 + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + N[(z * t$95$1 + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, \mathsf{fma}\left(b, a + -0.5, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, \mathsf{fma}\left(z, t\_1, y\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.9999999999999999e-151Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-inN/A
log-recN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified82.1%
if -1.9999999999999999e-151 < (+.f64 x y) Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around 0
associate--l+N/A
sub-negN/A
+-commutativeN/A
associate-+r+N/A
*-lft-identityN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
sub-negN/A
log-recN/A
Simplified77.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= z -3.2e+158)
(fma z t_1 y)
(if (<= z 8.8e+159) (+ y (fma b (+ a -0.5) x)) (fma z t_1 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 <= -3.2e+158) {
tmp = fma(z, t_1, y);
} else if (z <= 8.8e+159) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = fma(z, t_1, x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (z <= -3.2e+158) tmp = fma(z, t_1, y); elseif (z <= 8.8e+159) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = fma(z, t_1, 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, -3.2e+158], N[(z * t$95$1 + y), $MachinePrecision], If[LessEqual[z, 8.8e+159], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z * t$95$1 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, y\right)\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+159}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, x\right)\\
\end{array}
\end{array}
if z < -3.19999999999999995e158Initial program 99.7%
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
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6479.2
Simplified79.2%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6468.9
Simplified68.9%
if -3.19999999999999995e158 < z < 8.7999999999999997e159Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6490.2
Simplified90.2%
if 8.7999999999999997e159 < z Initial 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
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6480.4
Simplified80.4%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6480.4
Simplified80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- 1.0 (log t)) x)))
(if (<= z -3.7e+169)
t_1
(if (<= z 7e+159) (+ 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 <= -3.7e+169) {
tmp = t_1;
} else if (z <= 7e+159) {
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 <= -3.7e+169) tmp = t_1; elseif (z <= 7e+159) 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, -3.7e+169], t$95$1, If[LessEqual[z, 7e+159], 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 -3.7 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+159}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.70000000000000001e169 or 6.9999999999999999e159 < z Initial 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
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6478.1
Simplified78.1%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6471.8
Simplified71.8%
if -3.70000000000000001e169 < z < 6.9999999999999999e159Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.9
Simplified89.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.65e+247) (fma z (- (log t)) z) (if (<= z 1.8e+181) (+ y (fma b (+ a -0.5) x)) (- z (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e+247) {
tmp = fma(z, -log(t), z);
} else if (z <= 1.8e+181) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = z - (z * log(t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.65e+247) tmp = fma(z, Float64(-log(t)), z); elseif (z <= 1.8e+181) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = Float64(z - Float64(z * log(t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.65e+247], N[(z * (-N[Log[t], $MachinePrecision]) + z), $MachinePrecision], If[LessEqual[z, 1.8e+181], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+247}:\\
\;\;\;\;\mathsf{fma}\left(z, -\log t, z\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+181}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\end{array}
if z < -1.65000000000000001e247Initial program 99.5%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.5
Applied egg-rr99.5%
Taylor expanded in x around 0
associate--l+N/A
sub-negN/A
+-commutativeN/A
associate-+r+N/A
*-lft-identityN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
distribute-rgt-inN/A
log-recN/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
sub-negN/A
log-recN/A
Simplified99.7%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
log-recN/A
neg-lowering-neg.f64N/A
log-lowering-log.f6474.9
Simplified74.9%
if -1.65000000000000001e247 < z < 1.79999999999999992e181Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6486.6
Simplified86.6%
if 1.79999999999999992e181 < z Initial program 99.9%
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
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f6476.2
Simplified76.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- z (* z (log t)))))
(if (<= z -1.75e+247)
t_1
(if (<= z 5.2e+181) (+ 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 <= -1.75e+247) {
tmp = t_1;
} else if (z <= 5.2e+181) {
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 <= -1.75e+247) tmp = t_1; elseif (z <= 5.2e+181) 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, -1.75e+247], t$95$1, If[LessEqual[z, 5.2e+181], 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 -1.75 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+181}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e247 or 5.2e181 < 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
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f6475.6
Simplified75.6%
if -1.7500000000000001e247 < z < 5.2e181Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6486.6
Simplified86.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -4e+234) (* a b) (if (<= t_1 2e+209) (+ 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 <= -4e+234) {
tmp = a * b;
} else if (t_1 <= 2e+209) {
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 <= (-4d+234)) then
tmp = a * b
else if (t_1 <= 2d+209) 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 <= -4e+234) {
tmp = a * b;
} else if (t_1 <= 2e+209) {
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 <= -4e+234: tmp = a * b elif t_1 <= 2e+209: 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 <= -4e+234) tmp = Float64(a * b); elseif (t_1 <= 2e+209) 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 <= -4e+234) tmp = a * b; elseif (t_1 <= 2e+209) 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, -4e+234], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, 2e+209], 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 -4 \cdot 10^{+234}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+209}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.00000000000000007e234 or 2.0000000000000001e209 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6472.5
Simplified72.5%
if -4.00000000000000007e234 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e209Initial program 99.9%
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
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6481.8
Simplified81.8%
Taylor expanded in z around 0
+-lowering-+.f6454.0
Simplified54.0%
Final simplification58.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -6e-33) (+ x (* a b)) (if (<= (+ x y) 1e+16) (* b (+ a -0.5)) (fma b a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -6e-33) {
tmp = x + (a * b);
} else if ((x + y) <= 1e+16) {
tmp = b * (a + -0.5);
} else {
tmp = fma(b, a, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -6e-33) tmp = Float64(x + Float64(a * b)); elseif (Float64(x + y) <= 1e+16) tmp = Float64(b * Float64(a + -0.5)); else tmp = fma(b, a, y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -6e-33], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 1e+16], N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision], N[(b * a + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -6 \cdot 10^{-33}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 10^{+16}:\\
\;\;\;\;b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -6.0000000000000003e-33Initial program 99.9%
Taylor expanded in x around inf
Simplified61.8%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6450.8
Simplified50.8%
if -6.0000000000000003e-33 < (+.f64 x y) < 1e16Initial program 99.8%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6458.7
Simplified58.7%
if 1e16 < (+.f64 x y) Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6494.8
Simplified94.8%
Taylor expanded in y around inf
Simplified48.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6447.3
Simplified47.3%
Final simplification51.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (+ a -0.5)))) (if (<= b -2.75e+150) t_1 (if (<= b 1.8e+163) (fma a b (+ x y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a + -0.5);
double tmp;
if (b <= -2.75e+150) {
tmp = t_1;
} else if (b <= 1.8e+163) {
tmp = fma(a, b, (x + y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a + -0.5)) tmp = 0.0 if (b <= -2.75e+150) tmp = t_1; elseif (b <= 1.8e+163) tmp = fma(a, b, Float64(x + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.75e+150], t$95$1, If[LessEqual[b, 1.8e+163], N[(a * b + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;b \leq -2.75 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.75000000000000008e150 or 1.79999999999999989e163 < b Initial program 99.9%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6483.7
Simplified83.7%
if -2.75000000000000008e150 < b < 1.79999999999999989e163Initial program 99.9%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6499.9
Applied egg-rr99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6495.2
Simplified95.2%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6468.8
Simplified68.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.6e-33) (fma a b (+ x y)) (fma b (+ a -0.5) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.6e-33) {
tmp = fma(a, b, (x + y));
} else {
tmp = fma(b, (a + -0.5), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.6e-33) tmp = fma(a, b, Float64(x + y)); else tmp = fma(b, Float64(a + -0.5), y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.6e-33], N[(a * b + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, y\right)\\
\end{array}
\end{array}
if x < -7.59999999999999988e-33Initial program 100.0%
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64100.0
Applied egg-rr100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6490.8
Simplified90.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6477.7
Simplified77.7%
if -7.59999999999999988e-33 < x Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6474.3
Simplified74.3%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6457.7
Simplified57.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
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6477.7
Simplified77.7%
(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%
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
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6464.7
Simplified64.7%
Taylor expanded in z around 0
+-lowering-+.f6443.0
Simplified43.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf
Simplified24.2%
(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 2024198
(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)))