
(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 19 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) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.5%
associate-+l-99.5%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))))
(if (<= t 1.8e-17)
(+ (log (+ x y)) (+ (log z) t_1))
(if (<= t 5.5e+22) (- (+ (log (* y z)) t_1) t) (fma (log t) a (- t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double tmp;
if (t <= 1.8e-17) {
tmp = log((x + y)) + (log(z) + t_1);
} else if (t <= 5.5e+22) {
tmp = (log((y * z)) + t_1) - t;
} else {
tmp = fma(log(t), a, -t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) tmp = 0.0 if (t <= 1.8e-17) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + t_1)); elseif (t <= 5.5e+22) tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t); else tmp = fma(log(t), a, Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.8e-17], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+22], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 1.8 \cdot 10^{-17}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + t\_1\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+22}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t\_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\end{array}
\end{array}
if t < 1.79999999999999997e-17Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
if 1.79999999999999997e-17 < t < 5.50000000000000021e22Initial program 99.9%
add-cbrt-cube76.6%
pow1/333.7%
pow333.7%
sub-neg33.7%
metadata-eval33.7%
*-commutative33.7%
Applied egg-rr33.7%
pow-pow99.9%
metadata-eval99.9%
pow199.9%
associate-+l-99.9%
+-commutative99.9%
sum-log91.8%
+-commutative91.8%
Applied egg-rr91.8%
Taylor expanded in x around 0 60.3%
if 5.50000000000000021e22 < t Initial program 99.9%
add-cbrt-cube71.7%
pow1/37.6%
pow37.6%
sub-neg7.6%
metadata-eval7.6%
*-commutative7.6%
Applied egg-rr7.6%
pow-pow99.9%
metadata-eval99.9%
pow199.9%
associate-+l-99.9%
+-commutative99.9%
sum-log81.5%
+-commutative81.5%
Applied egg-rr81.5%
Taylor expanded in x around 0 64.5%
Taylor expanded in a around inf 99.9%
*-commutative99.9%
Simplified99.9%
fma-neg99.9%
Applied egg-rr99.9%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.6e-30) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (fma (log t) a (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.6e-30) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = fma(log(t), a, -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.6e-30) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = fma(log(t), a, Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.6e-30], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.6 \cdot 10^{-30}:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\end{array}
\end{array}
if t < 4.59999999999999968e-30Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.2%
+-commutative99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 63.6%
Taylor expanded in t around 0 63.6%
if 4.59999999999999968e-30 < t Initial program 99.9%
add-cbrt-cube70.6%
pow1/311.0%
pow311.0%
sub-neg11.0%
metadata-eval11.0%
*-commutative11.0%
Applied egg-rr11.0%
pow-pow99.9%
metadata-eval99.9%
pow199.9%
associate-+l-99.9%
+-commutative99.9%
sum-log81.8%
+-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in x around 0 65.0%
Taylor expanded in a around inf 97.4%
*-commutative97.4%
Simplified97.4%
fma-neg97.4%
Applied egg-rr97.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.6e-30) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (fma (log t) a (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.6e-30) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = fma(log(t), a, -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.6e-30) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = fma(log(t), a, Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.6e-30], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.6 \cdot 10^{-30}:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\end{array}
\end{array}
if t < 4.59999999999999968e-30Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
Taylor expanded in x around 0 63.6%
associate--l+63.6%
Simplified63.6%
if 4.59999999999999968e-30 < t Initial program 99.9%
add-cbrt-cube70.6%
pow1/311.0%
pow311.0%
sub-neg11.0%
metadata-eval11.0%
*-commutative11.0%
Applied egg-rr11.0%
pow-pow99.9%
metadata-eval99.9%
pow199.9%
associate-+l-99.9%
+-commutative99.9%
sum-log81.8%
+-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in x around 0 65.0%
Taylor expanded in a around inf 97.4%
*-commutative97.4%
Simplified97.4%
fma-neg97.4%
Applied egg-rr97.4%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
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) + (log(t) * (a - 0.5d0))
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) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5)); 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[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
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(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 70.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7e+27) (not (<= a 5.0))) (fma (log t) a (- t)) (+ (log (* z (+ x y))) (- (* (log t) (+ a -0.5)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7e+27) || !(a <= 5.0)) {
tmp = fma(log(t), a, -t);
} else {
tmp = log((z * (x + y))) + ((log(t) * (a + -0.5)) - t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7e+27) || !(a <= 5.0)) tmp = fma(log(t), a, Float64(-t)); else tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7e+27], N[Not[LessEqual[a, 5.0]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+27} \lor \neg \left(a \leq 5\right):\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\end{array}
\end{array}
if a < -7.0000000000000004e27 or 5 < a Initial program 99.7%
add-cbrt-cube33.2%
pow1/317.9%
pow317.9%
sub-neg17.9%
metadata-eval17.9%
*-commutative17.9%
Applied egg-rr17.9%
pow-pow99.7%
metadata-eval99.7%
pow199.7%
associate-+l-99.7%
+-commutative99.7%
sum-log78.7%
+-commutative78.7%
Applied egg-rr78.7%
Taylor expanded in x around 0 60.0%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
fma-neg99.1%
Applied egg-rr99.1%
if -7.0000000000000004e27 < a < 5Initial program 99.4%
associate-+l-99.4%
+-commutative99.4%
sum-log83.3%
sub-neg83.3%
metadata-eval83.3%
*-commutative83.3%
Applied egg-rr83.3%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -0.500005) (not (<= (- a 0.5) -0.49999999996))) (fma (log t) a (- t)) (- (+ (log (* y z)) (* (log t) -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -0.500005) || !((a - 0.5) <= -0.49999999996)) {
tmp = fma(log(t), a, -t);
} else {
tmp = (log((y * z)) + (log(t) * -0.5)) - t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -0.500005) || !(Float64(a - 0.5) <= -0.49999999996)) tmp = fma(log(t), a, Float64(-t)); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)) - t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -0.500005], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.49999999996]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -0.500005 \lor \neg \left(a - 0.5 \leq -0.49999999996\right):\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot -0.5\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -0.50000500000000003 or -0.49999999996 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
add-cbrt-cube38.4%
pow1/320.2%
pow320.2%
sub-neg20.2%
metadata-eval20.2%
*-commutative20.2%
Applied egg-rr20.2%
pow-pow99.6%
metadata-eval99.6%
pow199.6%
associate-+l-99.6%
+-commutative99.6%
sum-log79.2%
+-commutative79.2%
Applied egg-rr79.2%
Taylor expanded in x around 0 59.6%
Taylor expanded in a around inf 97.5%
*-commutative97.5%
Simplified97.5%
fma-neg97.5%
Applied egg-rr97.5%
if -0.50000500000000003 < (-.f64 a #s(literal 1/2 binary64)) < -0.49999999996Initial program 99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
associate-+r-99.5%
+-commutative99.5%
sum-log83.2%
Applied egg-rr83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in x around 0 55.7%
Taylor expanded in a around 0 55.6%
Final simplification76.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.5e+27) (not (<= a 4.2))) (fma (log t) a (- t)) (- (+ (log (* y z)) (* (log t) (- a 0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.5e+27) || !(a <= 4.2)) {
tmp = fma(log(t), a, -t);
} else {
tmp = (log((y * z)) + (log(t) * (a - 0.5))) - t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.5e+27) || !(a <= 4.2)) tmp = fma(log(t), a, Float64(-t)); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) - t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.5e+27], N[Not[LessEqual[a, 4.2]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+27} \lor \neg \left(a \leq 4.2\right):\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\end{array}
\end{array}
if a < -6.5000000000000005e27 or 4.20000000000000018 < a Initial program 99.7%
add-cbrt-cube33.2%
pow1/317.9%
pow317.9%
sub-neg17.9%
metadata-eval17.9%
*-commutative17.9%
Applied egg-rr17.9%
pow-pow99.7%
metadata-eval99.7%
pow199.7%
associate-+l-99.7%
+-commutative99.7%
sum-log78.7%
+-commutative78.7%
Applied egg-rr78.7%
Taylor expanded in x around 0 60.0%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
fma-neg99.1%
Applied egg-rr99.1%
if -6.5000000000000005e27 < a < 4.20000000000000018Initial program 99.4%
add-cbrt-cube99.4%
pow1/346.9%
pow346.8%
sub-neg46.8%
metadata-eval46.8%
*-commutative46.8%
Applied egg-rr46.8%
pow-pow99.4%
metadata-eval99.4%
pow199.4%
associate-+l-99.4%
+-commutative99.4%
sum-log83.3%
+-commutative83.3%
Applied egg-rr83.3%
Taylor expanded in x around 0 55.7%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.7e-117) (+ (log (+ x y)) (* (log t) a)) (if (<= t 1.4e-91) (log (* z (/ (+ x y) (sqrt t)))) (fma (log t) a (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.7e-117) {
tmp = log((x + y)) + (log(t) * a);
} else if (t <= 1.4e-91) {
tmp = log((z * ((x + y) / sqrt(t))));
} else {
tmp = fma(log(t), a, -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.7e-117) tmp = Float64(log(Float64(x + y)) + Float64(log(t) * a)); elseif (t <= 1.4e-91) tmp = log(Float64(z * Float64(Float64(x + y) / sqrt(t)))); else tmp = fma(log(t), a, Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.7e-117], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-91], N[Log[N[(z * N[(N[(x + y), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.7 \cdot 10^{-117}:\\
\;\;\;\;\log \left(x + y\right) + \log t \cdot a\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-91}:\\
\;\;\;\;\log \left(z \cdot \frac{x + y}{\sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\end{array}
\end{array}
if t < 3.7000000000000002e-117Initial program 99.0%
associate-+l-99.0%
associate--l+99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-undefine99.1%
sub-neg99.1%
+-commutative99.1%
distribute-neg-in99.1%
metadata-eval99.1%
metadata-eval99.1%
unsub-neg99.1%
Simplified99.1%
Taylor expanded in a around inf 59.4%
*-commutative59.4%
Simplified59.4%
if 3.7000000000000002e-117 < t < 1.4e-91Initial program 99.0%
associate-+l-99.0%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in t around 0 99.4%
add-sqr-sqrt9.8%
pow29.8%
Applied egg-rr9.8%
Taylor expanded in a around 0 80.8%
*-commutative80.8%
Simplified80.8%
+-commutative80.8%
*-un-lft-identity80.8%
fma-define80.8%
add-log-exp80.8%
diff-log61.6%
exp-to-pow61.6%
pow1/261.6%
+-commutative61.6%
Applied egg-rr61.6%
fma-undefine61.6%
*-lft-identity61.6%
+-commutative61.6%
Simplified61.6%
*-un-lft-identity61.6%
sum-log52.2%
+-commutative52.2%
Applied egg-rr52.2%
*-lft-identity52.2%
associate-*l/71.6%
associate-/l*71.7%
Simplified71.7%
if 1.4e-91 < t Initial program 99.8%
add-cbrt-cube70.5%
pow1/320.5%
pow320.5%
sub-neg20.5%
metadata-eval20.5%
*-commutative20.5%
Applied egg-rr20.5%
pow-pow99.8%
metadata-eval99.8%
pow199.8%
associate-+l-99.8%
+-commutative99.8%
sum-log82.6%
+-commutative82.6%
Applied egg-rr82.6%
Taylor expanded in x around 0 62.3%
Taylor expanded in a around inf 88.4%
*-commutative88.4%
Simplified88.4%
fma-neg88.5%
Applied egg-rr88.5%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.6e-30) (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) (fma (log t) a (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.6e-30) {
tmp = log((z * (x + y))) + (log(t) * (a - 0.5));
} else {
tmp = fma(log(t), a, -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.6e-30) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))); else tmp = fma(log(t), a, Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.6e-30], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.6 \cdot 10^{-30}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\end{array}
\end{array}
if t < 4.59999999999999968e-30Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
associate-+r-99.2%
+-commutative99.2%
sum-log80.6%
+-commutative80.6%
Applied egg-rr80.6%
if 4.59999999999999968e-30 < t Initial program 99.9%
add-cbrt-cube70.6%
pow1/311.0%
pow311.0%
sub-neg11.0%
metadata-eval11.0%
*-commutative11.0%
Applied egg-rr11.0%
pow-pow99.9%
metadata-eval99.9%
pow199.9%
associate-+l-99.9%
+-commutative99.9%
sum-log81.8%
+-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in x around 0 65.0%
Taylor expanded in a around inf 97.4%
*-commutative97.4%
Simplified97.4%
fma-neg97.4%
Applied egg-rr97.4%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1800000.0) (not (<= a 3.2e-41))) (fma (log t) a (- t)) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1800000.0) || !(a <= 3.2e-41)) {
tmp = fma(log(t), a, -t);
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1800000.0) || !(a <= 3.2e-41)) tmp = fma(log(t), a, Float64(-t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1800000.0], N[Not[LessEqual[a, 3.2e-41]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1800000 \lor \neg \left(a \leq 3.2 \cdot 10^{-41}\right):\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -1.8e6 or 3.20000000000000012e-41 < a Initial program 99.7%
add-cbrt-cube40.8%
pow1/323.2%
pow323.2%
sub-neg23.2%
metadata-eval23.2%
*-commutative23.2%
Applied egg-rr23.2%
pow-pow99.7%
metadata-eval99.7%
pow199.7%
associate-+l-99.7%
+-commutative99.7%
sum-log79.6%
+-commutative79.6%
Applied egg-rr79.6%
Taylor expanded in x around 0 60.0%
Taylor expanded in a around inf 93.9%
*-commutative93.9%
Simplified93.9%
fma-neg94.0%
Applied egg-rr94.0%
if -1.8e6 < a < 3.20000000000000012e-41Initial program 99.4%
associate-+l-99.4%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 61.8%
Taylor expanded in x around 0 46.2%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 6.1e-61) (+ (* (log t) (- a 0.5)) (log (* y z))) (fma (log t) a (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6.1e-61) {
tmp = (log(t) * (a - 0.5)) + log((y * z));
} else {
tmp = fma(log(t), a, -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6.1e-61) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))); else tmp = fma(log(t), a, Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6.1e-61], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.1 \cdot 10^{-61}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log t, a, -t\right)\\
\end{array}
\end{array}
if t < 6.1000000000000001e-61Initial program 99.1%
+-commutative99.1%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
associate--l+99.2%
Simplified99.2%
associate-+r-99.2%
+-commutative99.2%
sum-log81.2%
Applied egg-rr81.2%
+-commutative81.2%
Simplified81.2%
Taylor expanded in x around 0 50.0%
Taylor expanded in t around 0 50.0%
if 6.1000000000000001e-61 < t Initial program 99.8%
add-cbrt-cube70.4%
pow1/315.5%
pow315.5%
sub-neg15.5%
metadata-eval15.5%
*-commutative15.5%
Applied egg-rr15.5%
pow-pow99.8%
metadata-eval99.8%
pow199.8%
associate-+l-99.8%
+-commutative99.8%
sum-log81.3%
+-commutative81.3%
Applied egg-rr81.3%
Taylor expanded in x around 0 63.3%
Taylor expanded in a around inf 93.0%
*-commutative93.0%
Simplified93.0%
fma-neg93.0%
Applied egg-rr93.0%
Final simplification74.7%
(FPCore (x y z t a) :precision binary64 (fma (log t) a (- t)))
double code(double x, double y, double z, double t, double a) {
return fma(log(t), a, -t);
}
function code(x, y, z, t, a) return fma(log(t), a, Float64(-t)) end
code[x_, y_, z_, t_, a_] := N[(N[Log[t], $MachinePrecision] * a + (-t)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log t, a, -t\right)
\end{array}
Initial program 99.5%
add-cbrt-cube69.4%
pow1/333.7%
pow333.7%
sub-neg33.7%
metadata-eval33.7%
*-commutative33.7%
Applied egg-rr33.7%
pow-pow99.5%
metadata-eval99.5%
pow199.5%
associate-+l-99.5%
+-commutative99.5%
sum-log81.2%
+-commutative81.2%
Applied egg-rr81.2%
Taylor expanded in x around 0 57.6%
Taylor expanded in a around inf 74.9%
*-commutative74.9%
Simplified74.9%
fma-neg74.9%
Applied egg-rr74.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.85e+19) (not (<= a 70000.0))) (* (log t) a) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.85e+19) || !(a <= 70000.0)) {
tmp = log(t) * a;
} else {
tmp = log(y) - 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 ((a <= (-1.85d+19)) .or. (.not. (a <= 70000.0d0))) then
tmp = log(t) * a
else
tmp = log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.85e+19) || !(a <= 70000.0)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.85e+19) or not (a <= 70000.0): tmp = math.log(t) * a else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.85e+19) || !(a <= 70000.0)) tmp = Float64(log(t) * a); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.85e+19) || ~((a <= 70000.0))) tmp = log(t) * a; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.85e+19], N[Not[LessEqual[a, 70000.0]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.85 \cdot 10^{+19} \lor \neg \left(a \leq 70000\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -1.85e19 or 7e4 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 75.4%
Taylor expanded in a around inf 82.7%
*-commutative82.7%
Simplified82.7%
if -1.85e19 < a < 7e4Initial program 99.4%
associate-+l-99.4%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 58.6%
neg-mul-158.6%
Simplified58.6%
Taylor expanded in x around 0 42.7%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.8e+27) (not (<= a 0.00044))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.8e+27) || !(a <= 0.00044)) {
tmp = log(t) * a;
} else {
tmp = -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 ((a <= (-7.8d+27)) .or. (.not. (a <= 0.00044d0))) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.8e+27) || !(a <= 0.00044)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.8e+27) or not (a <= 0.00044): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.8e+27) || !(a <= 0.00044)) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.8e+27) || ~((a <= 0.00044))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.8e+27], N[Not[LessEqual[a, 0.00044]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{+27} \lor \neg \left(a \leq 0.00044\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -7.7999999999999997e27 or 4.40000000000000016e-4 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 73.6%
Taylor expanded in a around inf 80.8%
*-commutative80.8%
Simplified80.8%
if -7.7999999999999997e27 < a < 4.40000000000000016e-4Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 68.3%
Taylor expanded in t around inf 52.8%
neg-mul-152.8%
Simplified52.8%
Final simplification65.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 5e-7) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5e-7) {
tmp = log((x + y));
} else {
tmp = -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 <= 5d-7) then
tmp = log((x + y))
else
tmp = -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 <= 5e-7) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 5e-7: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 5e-7) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 5e-7) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 5e-7], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 4.99999999999999977e-7Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around inf 9.0%
neg-mul-19.0%
Simplified9.0%
Taylor expanded in t around 0 9.0%
+-commutative9.0%
Simplified9.0%
if 4.99999999999999977e-7 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 76.4%
Taylor expanded in t around inf 72.5%
neg-mul-172.5%
Simplified72.5%
Final simplification40.5%
(FPCore (x y z t a) :precision binary64 (- (* (log t) a) t))
double code(double x, double y, double z, double t, double a) {
return (log(t) * a) - 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) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * a) - t;
}
def code(x, y, z, t, a): return (math.log(t) * a) - t
function code(x, y, z, t, a) return Float64(Float64(log(t) * a) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * a) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot a - t
\end{array}
Initial program 99.5%
add-cbrt-cube69.4%
pow1/333.7%
pow333.7%
sub-neg33.7%
metadata-eval33.7%
*-commutative33.7%
Applied egg-rr33.7%
pow-pow99.5%
metadata-eval99.5%
pow199.5%
associate-+l-99.5%
+-commutative99.5%
sum-log81.2%
+-commutative81.2%
Applied egg-rr81.2%
Taylor expanded in x around 0 57.6%
Taylor expanded in a around inf 74.9%
*-commutative74.9%
Simplified74.9%
(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 Float64(-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.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 70.7%
Taylor expanded in t around inf 37.3%
neg-mul-137.3%
Simplified37.3%
(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 2024107
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))