
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
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
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
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
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
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
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
(if (<= t_1 -700.0)
(fma (log t) a (- 0.0 t))
(if (<= t_1 875.0)
(fma (log t) (+ a -0.5) (log (* y z)))
(- (/ (log t) (/ 1.0 (+ a -0.5))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
double tmp;
if (t_1 <= -700.0) {
tmp = fma(log(t), a, (0.0 - t));
} else if (t_1 <= 875.0) {
tmp = fma(log(t), (a + -0.5), log((y * z)));
} else {
tmp = (log(t) / (1.0 / (a + -0.5))) - t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) tmp = 0.0 if (t_1 <= -700.0) tmp = fma(log(t), a, Float64(0.0 - t)); elseif (t_1 <= 875.0) tmp = fma(log(t), Float64(a + -0.5), log(Float64(y * z))); else tmp = Float64(Float64(log(t) / Float64(1.0 / Float64(a + -0.5))) - t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], N[(N[Log[t], $MachinePrecision] * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 875.0], N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] / N[(1.0 / N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, 0 - t\right)\\
\mathbf{elif}\;t\_1 \leq 875:\\
\;\;\;\;\mathsf{fma}\left(\log t, a + -0.5, \log \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\log t}{\frac{1}{a + -0.5}} - t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -700Initial program 99.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6496.5
Simplified96.5%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6496.6
Simplified96.6%
Taylor expanded in a around inf
Simplified96.6%
if -700 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 875Initial program 99.0%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr94.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6491.6
Simplified91.6%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6451.4
Simplified51.4%
if 875 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) Initial program 99.6%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval99.6
Applied egg-rr99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6480.9
Simplified80.9%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
(if (<= t_1 -700.0)
(fma (log t) a (- 0.0 t))
(if (<= t_1 875.0)
(fma (log t) -0.5 (log (* (+ x y) z)))
(- (/ (log t) (/ 1.0 (+ a -0.5))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
double tmp;
if (t_1 <= -700.0) {
tmp = fma(log(t), a, (0.0 - t));
} else if (t_1 <= 875.0) {
tmp = fma(log(t), -0.5, log(((x + y) * z)));
} else {
tmp = (log(t) / (1.0 / (a + -0.5))) - t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) tmp = 0.0 if (t_1 <= -700.0) tmp = fma(log(t), a, Float64(0.0 - t)); elseif (t_1 <= 875.0) tmp = fma(log(t), -0.5, log(Float64(Float64(x + y) * z))); else tmp = Float64(Float64(log(t) / Float64(1.0 / Float64(a + -0.5))) - t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], N[(N[Log[t], $MachinePrecision] * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 875.0], N[(N[Log[t], $MachinePrecision] * -0.5 + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] / N[(1.0 / N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, 0 - t\right)\\
\mathbf{elif}\;t\_1 \leq 875:\\
\;\;\;\;\mathsf{fma}\left(\log t, -0.5, \log \left(\left(x + y\right) \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\log t}{\frac{1}{a + -0.5}} - t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -700Initial program 99.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6496.5
Simplified96.5%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6496.6
Simplified96.6%
Taylor expanded in a around inf
Simplified96.6%
if -700 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 875Initial program 99.0%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr94.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6491.6
Simplified91.6%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6489.6
Simplified89.6%
if 875 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) Initial program 99.6%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval99.6
Applied egg-rr99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6480.9
Simplified80.9%
Final simplification91.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t)))))
(if (<= t_1 -700.0)
(fma (log t) a (- 0.0 t))
(if (<= t_1 875.0)
(fma (log t) -0.5 (log (* y z)))
(- (/ (log t) (/ 1.0 (+ a -0.5))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
double tmp;
if (t_1 <= -700.0) {
tmp = fma(log(t), a, (0.0 - t));
} else if (t_1 <= 875.0) {
tmp = fma(log(t), -0.5, log((y * z)));
} else {
tmp = (log(t) / (1.0 / (a + -0.5))) - t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) tmp = 0.0 if (t_1 <= -700.0) tmp = fma(log(t), a, Float64(0.0 - t)); elseif (t_1 <= 875.0) tmp = fma(log(t), -0.5, log(Float64(y * z))); else tmp = Float64(Float64(log(t) / Float64(1.0 / Float64(a + -0.5))) - t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], N[(N[Log[t], $MachinePrecision] * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 875.0], N[(N[Log[t], $MachinePrecision] * -0.5 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] / N[(1.0 / N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, 0 - t\right)\\
\mathbf{elif}\;t\_1 \leq 875:\\
\;\;\;\;\mathsf{fma}\left(\log t, -0.5, \log \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\log t}{\frac{1}{a + -0.5}} - t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -700Initial program 99.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6496.5
Simplified96.5%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6496.6
Simplified96.6%
Taylor expanded in a around inf
Simplified96.6%
if -700 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < 875Initial program 99.0%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr94.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6491.6
Simplified91.6%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6451.4
Simplified51.4%
Taylor expanded in a around 0
Simplified50.0%
if 875 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) Initial program 99.6%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval99.6
Applied egg-rr99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6480.9
Simplified80.9%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (<= (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))) -50.0) (fma (log t) a (- 0.0 t)) (* (log t) (+ a -0.5))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t))) <= -50.0) {
tmp = fma(log(t), a, (0.0 - t));
} else {
tmp = log(t) * (a + -0.5);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) <= -50.0) tmp = fma(log(t), a, Float64(0.0 - t)); else tmp = Float64(log(t) * Float64(a + -0.5)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -50.0], N[(N[Log[t], $MachinePrecision] * a + N[(0.0 - t), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \leq -50:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, 0 - t\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) < -50Initial program 99.7%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6485.6
Simplified85.6%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6485.7
Simplified85.7%
Taylor expanded in a around inf
Simplified86.3%
if -50 < (+.f64 (-.f64 (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) t) (*.f64 (-.f64 a #s(literal 1/2 binary64)) (log.f64 t))) Initial program 99.4%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6453.0
Simplified53.0%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6452.7
Simplified52.7%
Final simplification73.3%
(FPCore (x y z t a) :precision binary64 (if (<= (+ (log (+ x y)) (log z)) 700.0) (- (fma (+ a -0.5) (log t) (log (* (+ x y) z))) t) (- (* (log t) (+ a -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((log((x + y)) + log(z)) <= 700.0) {
tmp = fma((a + -0.5), log(t), log(((x + y) * z))) - t;
} else {
tmp = (log(t) * (a + -0.5)) - t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(log(Float64(x + y)) + log(z)) <= 700.0) tmp = Float64(fma(Float64(a + -0.5), log(t), log(Float64(Float64(x + y) * z))) - t); else tmp = Float64(Float64(log(t) * Float64(a + -0.5)) - t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision], 700.0], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log \left(x + y\right) + \log z \leq 700:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial program 99.5%
+-commutativeN/A
associate-+r-N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sum-logN/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6497.1
Applied egg-rr97.1%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6476.8
Simplified76.8%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6476.8
Simplified76.8%
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6476.8
Applied egg-rr76.8%
(FPCore (x y z t a) :precision binary64 (if (<= (+ (log (+ x y)) (log z)) 700.0) (- (fma (log t) (+ a -0.5) (log (* y z))) t) (- (* (log t) (+ a -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((log((x + y)) + log(z)) <= 700.0) {
tmp = fma(log(t), (a + -0.5), log((y * z))) - t;
} else {
tmp = (log(t) * (a + -0.5)) - t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(log(Float64(x + y)) + log(z)) <= 700.0) tmp = Float64(fma(log(t), Float64(a + -0.5), log(Float64(y * z))) - t); else tmp = Float64(Float64(log(t) * Float64(a + -0.5)) - t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision], 700.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log \left(x + y\right) + \log z \leq 700:\\
\;\;\;\;\mathsf{fma}\left(\log t, a + -0.5, \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial program 99.5%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr97.0%
Taylor expanded in x around 0
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f6458.4
Simplified58.4%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6476.8
Simplified76.8%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6476.8
Simplified76.8%
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6476.8
Applied egg-rr76.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 430.0) (fma (log t) (+ a -0.5) (+ (log z) (log y))) (* t (+ -1.0 (+ (/ (log (+ x y)) t) (/ (* a (log t)) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 430.0) {
tmp = fma(log(t), (a + -0.5), (log(z) + log(y)));
} else {
tmp = t * (-1.0 + ((log((x + y)) / t) + ((a * log(t)) / t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 430.0) tmp = fma(log(t), Float64(a + -0.5), Float64(log(z) + log(y))); else tmp = Float64(t * Float64(-1.0 + Float64(Float64(log(Float64(x + y)) / t) + Float64(Float64(a * log(t)) / t)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 430.0], N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-1.0 + N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 430:\\
\;\;\;\;\mathsf{fma}\left(\log t, a + -0.5, \log z + \log y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-1 + \left(\frac{\log \left(x + y\right)}{t} + \frac{a \cdot \log t}{t}\right)\right)\\
\end{array}
\end{array}
if t < 430Initial program 99.4%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr79.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6478.0
Simplified78.0%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6445.8
Simplified45.8%
log-prodN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
log-lowering-log.f6458.1
Applied egg-rr58.1%
if 430 < t Initial program 99.8%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6497.8
Simplified97.8%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 490.0) (+ (log z) (fma (log t) (+ a -0.5) (log y))) (* t (+ -1.0 (+ (/ (log (+ x y)) t) (/ (* a (log t)) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 490.0) {
tmp = log(z) + fma(log(t), (a + -0.5), log(y));
} else {
tmp = t * (-1.0 + ((log((x + y)) / t) + ((a * log(t)) / t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 490.0) tmp = Float64(log(z) + fma(log(t), Float64(a + -0.5), log(y))); else tmp = Float64(t * Float64(-1.0 + Float64(Float64(log(Float64(x + y)) / t) + Float64(Float64(a * log(t)) / t)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 490.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-1.0 + N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 490:\\
\;\;\;\;\log z + \mathsf{fma}\left(\log t, a + -0.5, \log y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-1 + \left(\frac{\log \left(x + y\right)}{t} + \frac{a \cdot \log t}{t}\right)\right)\\
\end{array}
\end{array}
if t < 490Initial program 99.4%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr79.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6478.0
Simplified78.0%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6445.8
Simplified45.8%
Taylor expanded in z around 0
+-commutativeN/A
remove-double-negN/A
log-recN/A
mul-1-negN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
log-lowering-log.f6458.0
Simplified58.0%
if 490 < t Initial program 99.8%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in a around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6497.8
Simplified97.8%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (+ (fma (+ a -0.5) (log t) (log (+ x y))) (- (log z) t)))
double code(double x, double y, double z, double t, double a) {
return fma((a + -0.5), log(t), log((x + y))) + (log(z) - t);
}
function code(x, y, z, t, a) return Float64(fma(Float64(a + -0.5), log(t), log(Float64(x + y))) + Float64(log(z) - t)) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right)\right) + \left(\log z - t\right)
\end{array}
Initial program 99.6%
+-commutativeN/A
associate--l+N/A
associate-+r+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
log-lowering-log.f6499.5
Applied egg-rr99.5%
(FPCore (x y z t a) :precision binary64 (+ (log y) (fma (log t) (+ a -0.5) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return log(y) + fma(log(t), (a + -0.5), (log(z) - t));
}
function code(x, y, z, t, a) return Float64(log(y) + fma(log(t), Float64(a + -0.5), Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log y + \mathsf{fma}\left(\log t, a + -0.5, \log z - t\right)
\end{array}
Initial program 99.6%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
log-lowering-log.f6462.7
Simplified62.7%
(FPCore (x y z t a) :precision binary64 (if (<= (- a 0.5) -4e+18) (* a (log t)) (if (<= (- a 0.5) -0.4) (- (* (log t) -0.5) t) (* (log t) (+ a -0.5)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -4e+18) {
tmp = a * log(t);
} else if ((a - 0.5) <= -0.4) {
tmp = (log(t) * -0.5) - t;
} else {
tmp = log(t) * (a + -0.5);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((a - 0.5d0) <= (-4d+18)) then
tmp = a * log(t)
else if ((a - 0.5d0) <= (-0.4d0)) then
tmp = (log(t) * (-0.5d0)) - t
else
tmp = log(t) * (a + (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -4e+18) {
tmp = a * Math.log(t);
} else if ((a - 0.5) <= -0.4) {
tmp = (Math.log(t) * -0.5) - t;
} else {
tmp = Math.log(t) * (a + -0.5);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -4e+18: tmp = a * math.log(t) elif (a - 0.5) <= -0.4: tmp = (math.log(t) * -0.5) - t else: tmp = math.log(t) * (a + -0.5) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -4e+18) tmp = Float64(a * log(t)); elseif (Float64(a - 0.5) <= -0.4) tmp = Float64(Float64(log(t) * -0.5) - t); else tmp = Float64(log(t) * Float64(a + -0.5)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -4e+18) tmp = a * log(t); elseif ((a - 0.5) <= -0.4) tmp = (log(t) * -0.5) - t; else tmp = log(t) * (a + -0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -4e+18], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4], N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+18}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a - 0.5 \leq -0.4:\\
\;\;\;\;\log t \cdot -0.5 - t\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -4e18Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6486.0
Simplified86.0%
if -4e18 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002Initial program 99.5%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6450.6
Simplified50.6%
Taylor expanded in a around 0
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6450.3
Simplified50.3%
if -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6498.2
Simplified98.2%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6480.0
Simplified80.0%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= a -15200000000.0) t_1 (if (<= a 2300000.0) (- 0.0 t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -15200000000.0) {
tmp = t_1;
} else if (a <= 2300000.0) {
tmp = 0.0 - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-15200000000.0d0)) then
tmp = t_1
else if (a <= 2300000.0d0) then
tmp = 0.0d0 - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -15200000000.0) {
tmp = t_1;
} else if (a <= 2300000.0) {
tmp = 0.0 - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -15200000000.0: tmp = t_1 elif a <= 2300000.0: tmp = 0.0 - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -15200000000.0) tmp = t_1; elseif (a <= 2300000.0) tmp = Float64(0.0 - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -15200000000.0) tmp = t_1; elseif (a <= 2300000.0) tmp = 0.0 - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -15200000000.0], t$95$1, If[LessEqual[a, 2300000.0], N[(0.0 - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -15200000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2300000:\\
\;\;\;\;0 - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.52e10 or 2.3e6 < a Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6482.9
Simplified82.9%
if -1.52e10 < a < 2.3e6Initial program 99.5%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6444.6
Simplified44.6%
sub0-negN/A
neg-lowering-neg.f6444.6
Applied egg-rr44.6%
Final simplification62.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 72000000000000.0) (* (log t) (+ a -0.5)) (- 0.0 t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 72000000000000.0) {
tmp = log(t) * (a + -0.5);
} else {
tmp = 0.0 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= 72000000000000.0d0) then
tmp = log(t) * (a + (-0.5d0))
else
tmp = 0.0d0 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 72000000000000.0) {
tmp = Math.log(t) * (a + -0.5);
} else {
tmp = 0.0 - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 72000000000000.0: tmp = math.log(t) * (a + -0.5) else: tmp = 0.0 - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 72000000000000.0) tmp = Float64(log(t) * Float64(a + -0.5)); else tmp = Float64(0.0 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 72000000000000.0) tmp = log(t) * (a + -0.5); else tmp = 0.0 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 72000000000000.0], N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision], N[(0.0 - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 72000000000000:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0 - t\\
\end{array}
\end{array}
if t < 7.2e13Initial program 99.4%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6455.5
Simplified55.5%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6454.3
Simplified54.3%
if 7.2e13 < t Initial program 99.9%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6474.3
Simplified74.3%
sub0-negN/A
neg-lowering-neg.f6474.3
Applied egg-rr74.3%
Final simplification62.3%
(FPCore (x y z t a) :precision binary64 (fma (log t) (+ a -0.5) (- 0.0 t)))
double code(double x, double y, double z, double t, double a) {
return fma(log(t), (a + -0.5), (0.0 - t));
}
function code(x, y, z, t, a) return fma(log(t), Float64(a + -0.5), Float64(0.0 - t)) end
code[x_, y_, z_, t_, a_] := N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision] + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log t, a + -0.5, 0 - t\right)
\end{array}
Initial program 99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6473.0
Simplified73.0%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6473.0
Simplified73.0%
Final simplification73.0%
(FPCore (x y z t a) :precision binary64 (- (* (log t) (+ a -0.5)) t))
double code(double x, double y, double z, double t, double a) {
return (log(t) * (a + -0.5)) - t;
}
real(8) function code(x, y, z, t, a)
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
code = (log(t) * (a + (-0.5d0))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * (a + -0.5)) - t;
}
def code(x, y, z, t, a): return (math.log(t) * (a + -0.5)) - t
function code(x, y, z, t, a) return Float64(Float64(log(t) * Float64(a + -0.5)) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * (a + -0.5)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot \left(a + -0.5\right) - t
\end{array}
Initial program 99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6473.0
Simplified73.0%
Taylor expanded in t around 0
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
neg-lowering-neg.f6473.0
Simplified73.0%
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f6473.0
Applied egg-rr73.0%
(FPCore (x y z t a) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t, double a) {
return 0.0 - t;
}
real(8) function code(x, y, z, t, a)
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
code = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0 - t;
}
def code(x, y, z, t, a): return 0.0 - t
function code(x, y, z, t, a) return Float64(0.0 - t) end
function tmp = code(x, y, z, t, a) tmp = 0.0 - t; end
code[x_, y_, z_, t_, a_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}
\\
0 - t
\end{array}
Initial program 99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6432.0
Simplified32.0%
sub0-negN/A
neg-lowering-neg.f6432.0
Applied egg-rr32.0%
Final simplification32.0%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
real(8) function code(x, y, z, t, a)
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
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6432.0
Simplified32.0%
flip--N/A
metadata-evalN/A
neg-sub0N/A
+-lft-identityN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lft-identityN/A
+-commutativeN/A
distribute-rgt-outN/A
mul0-lftN/A
accelerator-lowering-fma.f6417.2
Applied egg-rr17.2%
flip3--N/A
metadata-evalN/A
+-lft-identityN/A
distribute-rgt-inN/A
+-rgt-identityN/A
associate-/l/N/A
Applied egg-rr2.6%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
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
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2024196
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))