
(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 19 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 (fma (+ a -0.5) b (fma (log t) (- z) (+ x (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, fma(log(t), -z, (x + (z + y))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, fma(log(t), Float64(-z), Float64(x + Float64(z + y)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(N[Log[t], $MachinePrecision] * (-z) + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, \mathsf{fma}\left(\log t, -z, x + \left(z + y\right)\right)\right)
\end{array}
Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* b (- a 0.5)) (- (+ z (+ x y)) (* (log t) z)))))
(if (<= t_1 (- INFINITY))
(* a b)
(if (<= t_1 -5e-58)
(fma -0.5 b x)
(if (<= t_1 5e+306) (fma -0.5 b y) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a - 0.5)) + ((z + (x + y)) - (log(t) * z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = a * b;
} else if (t_1 <= -5e-58) {
tmp = fma(-0.5, b, x);
} else if (t_1 <= 5e+306) {
tmp = fma(-0.5, b, y);
} else {
tmp = a * b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a - 0.5)) + Float64(Float64(z + Float64(x + y)) - Float64(log(t) * z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(a * b); elseif (t_1 <= -5e-58) tmp = fma(-0.5, b, x); elseif (t_1 <= 5e+306) tmp = fma(-0.5, b, y); else tmp = Float64(a * b); 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[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, -5e-58], N[(-0.5 * b + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+306], N[(-0.5 * b + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right) + \left(\left(z + \left(x + y\right)\right) - \log t \cdot z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, y\right)\\
\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)) < -inf.0 or 4.99999999999999993e306 < (+.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-*.f64100.0
Simplified100.0%
if -inf.0 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -4.99999999999999977e-58Initial program 99.8%
Taylor expanded in x around inf
Simplified51.0%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f6440.6
Simplified40.6%
if -4.99999999999999977e-58 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 4.99999999999999993e306Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified52.2%
Taylor expanded in a around 0
Simplified36.5%
Final simplification45.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* b (- a 0.5)) (- (+ z (+ x y)) (* (log t) z)))))
(if (<= t_1 (- INFINITY))
(* a b)
(if (<= t_1 -2e-71) (fma -0.5 b x) (fma a b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a - 0.5)) + ((z + (x + y)) - (log(t) * z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = a * b;
} else if (t_1 <= -2e-71) {
tmp = fma(-0.5, b, x);
} else {
tmp = fma(a, b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a - 0.5)) + Float64(Float64(z + Float64(x + y)) - Float64(log(t) * z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(a * b); elseif (t_1 <= -2e-71) tmp = fma(-0.5, b, x); else tmp = fma(a, b, y); 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[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, -2e-71], N[(-0.5 * b + x), $MachinePrecision], N[(a * b + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right) + \left(\left(z + \left(x + y\right)\right) - \log t \cdot z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-71}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, 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)) < -inf.0Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64100.0
Simplified100.0%
if -inf.0 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -1.9999999999999998e-71Initial program 99.8%
Taylor expanded in x around inf
Simplified51.4%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f6441.1
Simplified41.1%
if -1.9999999999999998e-71 < (+.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
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified57.4%
Taylor expanded in a around inf
Simplified44.2%
Final simplification45.6%
(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 -1e+92)
t_2
(if (<= t_1 5e+81) (+ x (fma z (- 1.0 (log t)) 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 = y + fma(b, (a + -0.5), x);
double tmp;
if (t_1 <= -1e+92) {
tmp = t_2;
} else if (t_1 <= 5e+81) {
tmp = x + fma(z, (1.0 - log(t)), y);
} 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 <= -1e+92) tmp = t_2; elseif (t_1 <= 5e+81) tmp = Float64(x + fma(z, Float64(1.0 - log(t)), y)); 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, -1e+92], t$95$2, If[LessEqual[t$95$1, 5e+81], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + y), $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 -1 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+81}:\\
\;\;\;\;x + \mathsf{fma}\left(z, 1 - \log t, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e92 or 4.9999999999999998e81 < (*.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-+.f6491.4
Simplified91.4%
if -1e92 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.9999999999999998e81Initial 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-+.f6491.1
Simplified91.1%
associate-+r+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6491.2
Applied egg-rr91.2%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))) (t_2 (fma a b (fma z t_1 x))))
(if (<= (- a 0.5) -4e+24)
t_2
(if (<= (- a 0.5) 1e+19) (+ x (fma b -0.5 (fma z t_1 y))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 - log(t);
double t_2 = fma(a, b, fma(z, t_1, x));
double tmp;
if ((a - 0.5) <= -4e+24) {
tmp = t_2;
} else if ((a - 0.5) <= 1e+19) {
tmp = x + fma(b, -0.5, fma(z, t_1, y));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) t_2 = fma(a, b, fma(z, t_1, x)) tmp = 0.0 if (Float64(a - 0.5) <= -4e+24) tmp = t_2; elseif (Float64(a - 0.5) <= 1e+19) tmp = Float64(x + fma(b, -0.5, fma(z, t_1, y))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * b + N[(z * t$95$1 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -4e+24], t$95$2, If[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+19], N[(x + N[(b * -0.5 + N[(z * t$95$1 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
t_2 := \mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t\_1, x\right)\right)\\
\mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+24}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a - 0.5 \leq 10^{+19}:\\
\;\;\;\;x + \mathsf{fma}\left(b, -0.5, \mathsf{fma}\left(z, t\_1, y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -3.9999999999999999e24 or 1e19 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-commutativeN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
*-rgt-identityN/A
distribute-lft-out--N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6486.7
Simplified86.7%
Taylor expanded in a around inf
Simplified86.7%
if -3.9999999999999999e24 < (-.f64 a #s(literal 1/2 binary64)) < 1e19Initial 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
Simplified99.0%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* b (- a 0.5)) (- (+ z (+ x y)) (* (log t) z))) -2e-71) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((b * (a - 0.5)) + ((z + (x + y)) - (log(t) * z))) <= -2e-71) {
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 (((b * (a - 0.5d0)) + ((z + (x + y)) - (log(t) * z))) <= (-2d-71)) 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 (((b * (a - 0.5)) + ((z + (x + y)) - (Math.log(t) * z))) <= -2e-71) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((b * (a - 0.5)) + ((z + (x + y)) - (math.log(t) * z))) <= -2e-71: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(b * Float64(a - 0.5)) + Float64(Float64(z + Float64(x + y)) - Float64(log(t) * z))) <= -2e-71) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((b * (a - 0.5)) + ((z + (x + y)) - (log(t) * z))) <= -2e-71) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-71], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot \left(a - 0.5\right) + \left(\left(z + \left(x + y\right)\right) - \log t \cdot z\right) \leq -2 \cdot 10^{-71}:\\
\;\;\;\;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.9999999999999998e-71Initial program 99.8%
Taylor expanded in x around inf
Simplified22.2%
if -1.9999999999999998e-71 < (+.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
Simplified19.0%
Final simplification20.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ z (+ x y)) (* (log t) z)) -5e-58) (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)) <= -5e-58) {
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)) <= -5e-58) 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], -5e-58], 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 -5 \cdot 10^{-58}:\\
\;\;\;\;\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))) < -4.99999999999999977e-58Initial program 99.8%
Taylor expanded in x around inf
Simplified56.0%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6456.1
Applied egg-rr56.1%
if -4.99999999999999977e-58 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified58.0%
Final simplification57.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= z -2.7e+95)
(fma z t_1 x)
(if (<= z 7e+250) (+ y (fma b (+ a -0.5) x)) (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 (z <= -2.7e+95) {
tmp = fma(z, t_1, x);
} else if (z <= 7e+250) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = 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 (z <= -2.7e+95) tmp = fma(z, t_1, x); elseif (z <= 7e+250) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = 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[z, -2.7e+95], N[(z * t$95$1 + x), $MachinePrecision], If[LessEqual[z, 7e+250], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z * t$95$1 + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, x\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+250}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t\_1, y\right)\\
\end{array}
\end{array}
if z < -2.7e95Initial 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-+.f6473.2
Simplified73.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6459.5
Simplified59.5%
if -2.7e95 < z < 7.0000000000000001e250Initial 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.3
Simplified86.3%
if 7.0000000000000001e250 < z Initial 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-+.f6471.2
Simplified71.2%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6471.2
Simplified71.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- 1.0 (log t)) x)))
(if (<= z -2.3e+95)
t_1
(if (<= z 3.05e+231) (+ 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 <= -2.3e+95) {
tmp = t_1;
} else if (z <= 3.05e+231) {
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 <= -2.3e+95) tmp = t_1; elseif (z <= 3.05e+231) 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, -2.3e+95], t$95$1, If[LessEqual[z, 3.05e+231], 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 -2.3 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{+231}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.29999999999999997e95 or 3.04999999999999986e231 < z Initial 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-+.f6472.6
Simplified72.6%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6461.8
Simplified61.8%
if -2.29999999999999997e95 < z < 3.04999999999999986e231Initial 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.5
Simplified86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -1.35e+180)
t_1
(if (<= z 1.2e+251) (+ 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 * (1.0 - log(t));
double tmp;
if (z <= -1.35e+180) {
tmp = t_1;
} else if (z <= 1.2e+251) {
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(1.0 - log(t))) tmp = 0.0 if (z <= -1.35e+180) tmp = t_1; elseif (z <= 1.2e+251) 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]), $MachinePrecision]}, If[LessEqual[z, -1.35e+180], t$95$1, If[LessEqual[z, 1.2e+251], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+251}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.35000000000000008e180 or 1.19999999999999991e251 < z Initial 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-+.f6474.8
Simplified74.8%
associate-+r+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
log-lowering-log.f6474.8
Applied egg-rr74.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
log-lowering-log.f6468.0
Simplified68.0%
if -1.35000000000000008e180 < z < 1.19999999999999991e251Initial 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-+.f6483.7
Simplified83.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -1e+266)
(* a b)
(if (<= t_1 -1e+92)
(fma -0.5 b x)
(if (<= t_1 5e+134) (+ x y) (* a b))))))
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 <= -1e+266) {
tmp = a * b;
} else if (t_1 <= -1e+92) {
tmp = fma(-0.5, b, x);
} else if (t_1 <= 5e+134) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -1e+266) tmp = Float64(a * b); elseif (t_1 <= -1e+92) tmp = fma(-0.5, b, x); elseif (t_1 <= 5e+134) tmp = Float64(x + y); else tmp = Float64(a * b); 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[t$95$1, -1e+266], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, -1e+92], N[(-0.5 * b + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+134], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+266}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+92}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e266 or 4.99999999999999981e134 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6466.1
Simplified66.1%
if -1e266 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e92Initial program 100.0%
Taylor expanded in x around inf
Simplified59.9%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f6445.4
Simplified45.4%
if -1e92 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999981e134Initial 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-+.f6489.8
Simplified89.8%
Taylor expanded in z around 0
+-lowering-+.f6456.7
Simplified56.7%
Final simplification57.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5))) (t_2 (* (+ a -0.5) b))) (if (<= t_1 -5e+131) t_2 (if (<= t_1 5e+134) (+ x 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 = (a + -0.5) * b;
double tmp;
if (t_1 <= -5e+131) {
tmp = t_2;
} else if (t_1 <= 5e+134) {
tmp = x + y;
} 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 = (a + (-0.5d0)) * b
if (t_1 <= (-5d+131)) then
tmp = t_2
else if (t_1 <= 5d+134) then
tmp = x + y
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 = (a + -0.5) * b;
double tmp;
if (t_1 <= -5e+131) {
tmp = t_2;
} else if (t_1 <= 5e+134) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = (a + -0.5) * b tmp = 0 if t_1 <= -5e+131: tmp = t_2 elif t_1 <= 5e+134: tmp = x + y 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(Float64(a + -0.5) * b) tmp = 0.0 if (t_1 <= -5e+131) tmp = t_2; elseif (t_1 <= 5e+134) tmp = Float64(x + y); 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 = (a + -0.5) * b; tmp = 0.0; if (t_1 <= -5e+131) tmp = t_2; elseif (t_1 <= 5e+134) tmp = x + y; 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[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+131], t$95$2, If[LessEqual[t$95$1, 5e+134], N[(x + y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.99999999999999995e131 or 4.99999999999999981e134 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6479.5
Simplified79.5%
if -4.99999999999999995e131 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999981e134Initial 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-+.f6489.5
Simplified89.5%
Taylor expanded in z around 0
+-lowering-+.f6456.8
Simplified56.8%
Final simplification65.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= t_1 -2e+261) (* a b) (if (<= t_1 5e+134) (+ x y) (* a b)))))
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 <= -2e+261) {
tmp = a * b;
} else if (t_1 <= 5e+134) {
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 = b * (a - 0.5d0)
if (t_1 <= (-2d+261)) then
tmp = a * b
else if (t_1 <= 5d+134) 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 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+261) {
tmp = a * b;
} else if (t_1 <= 5e+134) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -2e+261: tmp = a * b elif t_1 <= 5e+134: tmp = x + y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -2e+261) tmp = Float64(a * b); elseif (t_1 <= 5e+134) 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 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -2e+261) tmp = a * b; elseif (t_1 <= 5e+134) tmp = x + y; else tmp = a * b; 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, -2e+261], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, 5e+134], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+261}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.9999999999999999e261 or 4.99999999999999981e134 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6464.4
Simplified64.4%
if -1.9999999999999999e261 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999981e134Initial 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-+.f6483.0
Simplified83.0%
Taylor expanded in z around 0
+-lowering-+.f6452.4
Simplified52.4%
Final simplification55.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -1e-22) (+ x (* a b)) (if (<= (+ x y) 2e+114) (* (+ a -0.5) b) (fma a b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -1e-22) {
tmp = x + (a * b);
} else if ((x + y) <= 2e+114) {
tmp = (a + -0.5) * b;
} else {
tmp = fma(a, b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -1e-22) tmp = Float64(x + Float64(a * b)); elseif (Float64(x + y) <= 2e+114) tmp = Float64(Float64(a + -0.5) * b); else tmp = fma(a, b, y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e-22], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e+114], N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision], N[(a * b + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-22}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 2 \cdot 10^{+114}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, y\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1e-22Initial program 99.9%
Taylor expanded in x around inf
Simplified56.8%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6447.7
Simplified47.7%
if -1e-22 < (+.f64 x y) < 2e114Initial program 99.8%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6448.7
Simplified48.7%
if 2e114 < (+.f64 x y) Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified63.6%
Taylor expanded in a around inf
Simplified53.1%
Final simplification49.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (+ a -0.5) b x))) (if (<= a -2.55e+23) t_1 (if (<= a 1.22e+20) (fma -0.5 b (+ x y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((a + -0.5), b, x);
double tmp;
if (a <= -2.55e+23) {
tmp = t_1;
} else if (a <= 1.22e+20) {
tmp = fma(-0.5, b, (x + y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(a + -0.5), b, x) tmp = 0.0 if (a <= -2.55e+23) tmp = t_1; elseif (a <= 1.22e+20) tmp = fma(-0.5, b, Float64(x + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + -0.5), $MachinePrecision] * b + x), $MachinePrecision]}, If[LessEqual[a, -2.55e+23], t$95$1, If[LessEqual[a, 1.22e+20], N[(-0.5 * b + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a + -0.5, b, x\right)\\
\mathbf{if}\;a \leq -2.55 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.5500000000000001e23 or 1.22e20 < a Initial program 99.9%
Taylor expanded in x around inf
Simplified70.0%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6470.1
Applied egg-rr70.1%
if -2.5500000000000001e23 < a < 1.22e20Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around 0
+-lowering-+.f6471.8
Simplified71.8%
Taylor expanded in a around 0
Simplified70.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ x (* a b)))) (if (<= a -6.4e+22) t_1 (if (<= a 8e+18) (fma -0.5 b (+ x y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * b);
double tmp;
if (a <= -6.4e+22) {
tmp = t_1;
} else if (a <= 8e+18) {
tmp = fma(-0.5, b, (x + y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * b)) tmp = 0.0 if (a <= -6.4e+22) tmp = t_1; elseif (a <= 8e+18) tmp = fma(-0.5, b, Float64(x + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.4e+22], t$95$1, If[LessEqual[a, 8e+18], N[(-0.5 * b + N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot b\\
\mathbf{if}\;a \leq -6.4 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, b, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.4e22 or 8e18 < a Initial program 99.9%
Taylor expanded in x around inf
Simplified70.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6470.0
Simplified70.0%
if -6.4e22 < a < 8e18Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-lowering-neg.f64N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around 0
+-lowering-+.f6471.8
Simplified71.8%
Taylor expanded in a around 0
Simplified70.9%
Final simplification70.5%
(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-+.f6476.6
Simplified76.6%
(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-+.f6462.1
Simplified62.1%
Taylor expanded in z around 0
+-lowering-+.f6439.6
Simplified39.6%
(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
Simplified19.9%
(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 2024205
(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)))