
(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 16 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.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)))
(if (<= (- a 0.5) -2e+14)
(- t_1 t)
(if (<= (- a 0.5) -0.4999)
(+ (log (+ x y)) (- (log z) (+ t (* (log t) 0.5))))
(+ (- (log z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if ((a - 0.5) <= -2e+14) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.4999) {
tmp = log((x + y)) + (log(z) - (t + (log(t) * 0.5)));
} else {
tmp = (log(z) - t) + 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 = log(t) * a
if ((a - 0.5d0) <= (-2d+14)) then
tmp = t_1 - t
else if ((a - 0.5d0) <= (-0.4999d0)) then
tmp = log((x + y)) + (log(z) - (t + (log(t) * 0.5d0)))
else
tmp = (log(z) - t) + 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 = Math.log(t) * a;
double tmp;
if ((a - 0.5) <= -2e+14) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.4999) {
tmp = Math.log((x + y)) + (Math.log(z) - (t + (Math.log(t) * 0.5)));
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if (a - 0.5) <= -2e+14: tmp = t_1 - t elif (a - 0.5) <= -0.4999: tmp = math.log((x + y)) + (math.log(z) - (t + (math.log(t) * 0.5))) else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+14) tmp = Float64(t_1 - t); elseif (Float64(a - 0.5) <= -0.4999) tmp = Float64(log(Float64(x + y)) + Float64(log(z) - Float64(t + Float64(log(t) * 0.5)))); else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if ((a - 0.5) <= -2e+14) tmp = t_1 - t; elseif ((a - 0.5) <= -0.4999) tmp = log((x + y)) + (log(z) - (t + (log(t) * 0.5))); else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+14], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4999], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(t + N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;t\_1 - t\\
\mathbf{elif}\;a - 0.5 \leq -0.4999:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t\_1\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -2e14Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
associate-+r-99.8%
fma-undefine99.8%
associate--r+99.8%
+-commutative99.8%
sum-log71.4%
Applied egg-rr71.4%
Taylor expanded in a around inf 99.8%
*-commutative99.8%
Simplified99.8%
if -2e14 < (-.f64 a #s(literal 1/2 binary64)) < -0.49990000000000001Initial program 99.6%
associate-+l-99.6%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around 0 99.2%
*-commutative99.2%
Simplified99.2%
if -0.49990000000000001 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log z) t)) (t_2 (* (log t) a)))
(if (<= (- a 0.5) -2e+14)
(- t_2 t)
(if (<= (- a 0.5) -0.4999)
(+ t_1 (+ (log y) (* (log t) -0.5)))
(+ t_1 t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) - t;
double t_2 = log(t) * a;
double tmp;
if ((a - 0.5) <= -2e+14) {
tmp = t_2 - t;
} else if ((a - 0.5) <= -0.4999) {
tmp = t_1 + (log(y) + (log(t) * -0.5));
} else {
tmp = t_1 + t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = log(z) - t
t_2 = log(t) * a
if ((a - 0.5d0) <= (-2d+14)) then
tmp = t_2 - t
else if ((a - 0.5d0) <= (-0.4999d0)) then
tmp = t_1 + (log(y) + (log(t) * (-0.5d0)))
else
tmp = t_1 + t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(z) - t;
double t_2 = Math.log(t) * a;
double tmp;
if ((a - 0.5) <= -2e+14) {
tmp = t_2 - t;
} else if ((a - 0.5) <= -0.4999) {
tmp = t_1 + (Math.log(y) + (Math.log(t) * -0.5));
} else {
tmp = t_1 + t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) - t t_2 = math.log(t) * a tmp = 0 if (a - 0.5) <= -2e+14: tmp = t_2 - t elif (a - 0.5) <= -0.4999: tmp = t_1 + (math.log(y) + (math.log(t) * -0.5)) else: tmp = t_1 + t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) - t) t_2 = Float64(log(t) * a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+14) tmp = Float64(t_2 - t); elseif (Float64(a - 0.5) <= -0.4999) tmp = Float64(t_1 + Float64(log(y) + Float64(log(t) * -0.5))); else tmp = Float64(t_1 + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) - t; t_2 = log(t) * a; tmp = 0.0; if ((a - 0.5) <= -2e+14) tmp = t_2 - t; elseif ((a - 0.5) <= -0.4999) tmp = t_1 + (log(y) + (log(t) * -0.5)); else tmp = t_1 + t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+14], N[(t$95$2 - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4999], N[(t$95$1 + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z - t\\
t_2 := \log t \cdot a\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;t\_2 - t\\
\mathbf{elif}\;a - 0.5 \leq -0.4999:\\
\;\;\;\;t\_1 + \left(\log y + \log t \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t\_2\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -2e14Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
associate-+r-99.8%
fma-undefine99.8%
associate--r+99.8%
+-commutative99.8%
sum-log71.4%
Applied egg-rr71.4%
Taylor expanded in a around inf 99.8%
*-commutative99.8%
Simplified99.8%
if -2e14 < (-.f64 a #s(literal 1/2 binary64)) < -0.49990000000000001Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.5%
Taylor expanded in a around 0 74.1%
*-commutative74.1%
Simplified74.1%
if -0.49990000000000001 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)))
(if (<= (- a 0.5) -2e+14)
(- t_1 t)
(if (<= (- a 0.5) -0.4999)
(+ (log y) (- (+ (log z) (* (log t) -0.5)) t))
(+ (- (log z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if ((a - 0.5) <= -2e+14) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.4999) {
tmp = log(y) + ((log(z) + (log(t) * -0.5)) - t);
} else {
tmp = (log(z) - t) + 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 = log(t) * a
if ((a - 0.5d0) <= (-2d+14)) then
tmp = t_1 - t
else if ((a - 0.5d0) <= (-0.4999d0)) then
tmp = log(y) + ((log(z) + (log(t) * (-0.5d0))) - t)
else
tmp = (log(z) - t) + 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 = Math.log(t) * a;
double tmp;
if ((a - 0.5) <= -2e+14) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.4999) {
tmp = Math.log(y) + ((Math.log(z) + (Math.log(t) * -0.5)) - t);
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if (a - 0.5) <= -2e+14: tmp = t_1 - t elif (a - 0.5) <= -0.4999: tmp = math.log(y) + ((math.log(z) + (math.log(t) * -0.5)) - t) else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+14) tmp = Float64(t_1 - t); elseif (Float64(a - 0.5) <= -0.4999) tmp = Float64(log(y) + Float64(Float64(log(z) + Float64(log(t) * -0.5)) - t)); else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if ((a - 0.5) <= -2e+14) tmp = t_1 - t; elseif ((a - 0.5) <= -0.4999) tmp = log(y) + ((log(z) + (log(t) * -0.5)) - t); else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+14], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4999], N[(N[Log[y], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+14}:\\
\;\;\;\;t\_1 - t\\
\mathbf{elif}\;a - 0.5 \leq -0.4999:\\
\;\;\;\;\log y + \left(\left(\log z + \log t \cdot -0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t\_1\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -2e14Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
associate-+r-99.8%
fma-undefine99.8%
associate--r+99.8%
+-commutative99.8%
sum-log71.4%
Applied egg-rr71.4%
Taylor expanded in a around inf 99.8%
*-commutative99.8%
Simplified99.8%
if -2e14 < (-.f64 a #s(literal 1/2 binary64)) < -0.49990000000000001Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.5%
Taylor expanded in a around 0 74.0%
associate--l+74.0%
+-commutative74.0%
*-commutative74.0%
Simplified74.0%
if -0.49990000000000001 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 140.0) (+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t)) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 140.0) {
tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t);
} else {
tmp = (log(z) - t) + (log(t) * a);
}
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 (log(z) <= 140.0d0) then
tmp = log(((x + y) * z)) + ((log(t) * (a + (-0.5d0))) - t)
else
tmp = (log(z) - t) + (log(t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 140.0) {
tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 140.0: tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t) else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 140.0) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 140.0) tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t); else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 140.0], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 140:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if (log.f64 z) < 140Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
fma-undefine99.6%
metadata-eval99.6%
sub-neg99.6%
associate-+r+99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l-99.6%
+-commutative99.6%
sum-log89.5%
sub-neg89.5%
metadata-eval89.5%
*-commutative89.5%
Applied egg-rr89.5%
if 140 < (log.f64 z) Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.7%
Taylor expanded in a around inf 81.3%
*-commutative81.3%
Simplified81.3%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 140.0) (+ (log (* y z)) (- (* (log t) (- a 0.5)) t)) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 140.0) {
tmp = log((y * z)) + ((log(t) * (a - 0.5)) - t);
} else {
tmp = (log(z) - t) + (log(t) * a);
}
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 (log(z) <= 140.0d0) then
tmp = log((y * z)) + ((log(t) * (a - 0.5d0)) - t)
else
tmp = (log(z) - t) + (log(t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 140.0) {
tmp = Math.log((y * z)) + ((Math.log(t) * (a - 0.5)) - t);
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 140.0: tmp = math.log((y * z)) + ((math.log(t) * (a - 0.5)) - t) else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 140.0) tmp = Float64(log(Float64(y * z)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 140.0) tmp = log((y * z)) + ((log(t) * (a - 0.5)) - t); else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 140.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 140:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if (log.f64 z) < 140Initial program 99.6%
associate-+l-99.6%
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%
associate-+r-99.6%
fma-undefine99.6%
associate--r+99.6%
+-commutative99.6%
sum-log89.5%
Applied egg-rr89.5%
Taylor expanded in x around 0 67.1%
if 140 < (log.f64 z) Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.7%
Taylor expanded in a around inf 81.3%
*-commutative81.3%
Simplified81.3%
Final simplification72.9%
(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.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (* (log t) (- a 0.5)) (log y))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + ((log(t) * (a - 0.5)) + log(y));
}
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(t) * (a - 0.5d0)) + log(y))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + ((Math.log(t) * (a - 0.5)) + Math.log(y));
}
def code(x, y, z, t, a): return (math.log(z) - t) + ((math.log(t) * (a - 0.5)) + math.log(y))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(Float64(log(t) * Float64(a - 0.5)) + log(y))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + ((log(t) * (a - 0.5)) + log(y)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log t \cdot \left(a - 0.5\right) + \log y\right)
\end{array}
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.8%
Final simplification73.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00032) (+ (* (log t) (- a 0.5)) (log (* y z))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00032) {
tmp = (log(t) * (a - 0.5)) + log((y * z));
} else {
tmp = (log(t) * a) - 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 <= 0.00032d0) then
tmp = (log(t) * (a - 0.5d0)) + log((y * z))
else
tmp = (log(t) * a) - 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 <= 0.00032) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((y * z));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00032: tmp = (math.log(t) * (a - 0.5)) + math.log((y * z)) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00032) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00032) tmp = (log(t) * (a - 0.5)) + log((y * z)); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00032], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00032:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 3.20000000000000026e-4Initial program 99.4%
associate-+l-99.4%
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%
associate-+r-99.4%
fma-undefine99.4%
associate--r+99.4%
+-commutative99.4%
sum-log67.6%
Applied egg-rr67.6%
Taylor expanded in x around 0 48.7%
Taylor expanded in t around 0 48.3%
if 3.20000000000000026e-4 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
associate-+r-99.9%
fma-undefine99.9%
associate--r+99.9%
+-commutative99.9%
sum-log71.9%
Applied egg-rr71.9%
Taylor expanded in a around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (* (log t) a)))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(t) * a);
}
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(t) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(t) * a);
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(t) * a)
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(t) * a)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(t) * a); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \log t \cdot a
\end{array}
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.8%
Taylor expanded in a around inf 81.2%
*-commutative81.2%
Simplified81.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0024) (* (log t) (- a 0.5)) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0024) {
tmp = log(t) * (a - 0.5);
} else {
tmp = (log(t) * a) - 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 <= 0.0024d0) then
tmp = log(t) * (a - 0.5d0)
else
tmp = (log(t) * a) - 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 <= 0.0024) {
tmp = Math.log(t) * (a - 0.5);
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0024: tmp = math.log(t) * (a - 0.5) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0024) tmp = Float64(log(t) * Float64(a - 0.5)); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0024) tmp = log(t) * (a - 0.5); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0024], N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0024:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.00239999999999999979Initial program 99.4%
Taylor expanded in t around inf 98.5%
Taylor expanded in t around inf 58.0%
neg-mul-158.0%
Simplified58.0%
Taylor expanded in t around 0 58.0%
if 0.00239999999999999979 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
associate-+r-99.9%
fma-undefine99.9%
associate--r+99.9%
+-commutative99.9%
sum-log71.9%
Applied egg-rr71.9%
Taylor expanded in a around inf 98.2%
*-commutative98.2%
Simplified98.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.35e+48) (* (log t) (- a 0.5)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.35e+48) {
tmp = log(t) * (a - 0.5);
} 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 <= 1.35d+48) then
tmp = log(t) * (a - 0.5d0)
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 <= 1.35e+48) {
tmp = Math.log(t) * (a - 0.5);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.35e+48: tmp = math.log(t) * (a - 0.5) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.35e+48) tmp = Float64(log(t) * Float64(a - 0.5)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.35e+48) tmp = log(t) * (a - 0.5); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.35e+48], N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.35 \cdot 10^{+48}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.35000000000000002e48Initial program 99.4%
Taylor expanded in t around inf 98.7%
Taylor expanded in t around inf 63.2%
neg-mul-163.2%
Simplified63.2%
Taylor expanded in t around 0 57.7%
if 1.35000000000000002e48 < 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.8%
Taylor expanded in t around inf 82.4%
mul-1-neg82.4%
Simplified82.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.05e+16) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.05e+16) {
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 (t <= 1.05d+16) 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 (t <= 1.05e+16) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.05e+16: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.05e+16) 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 (t <= 1.05e+16) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.05e+16], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.05 \cdot 10^{+16}:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.05e16Initial program 99.4%
Taylor expanded in t around inf 98.6%
Taylor expanded in t around inf 59.6%
neg-mul-159.6%
Simplified59.6%
Taylor expanded in a around inf 55.0%
*-commutative55.0%
Simplified55.0%
if 1.05e16 < 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 78.1%
Taylor expanded in t around inf 79.3%
mul-1-neg79.3%
Simplified79.3%
(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.7%
Taylor expanded in t around inf 99.3%
Taylor expanded in t around inf 80.5%
neg-mul-180.5%
Simplified80.5%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.2) (log y) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.2) {
tmp = log(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 <= 4.2d0) then
tmp = log(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 <= 4.2) {
tmp = Math.log(y);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.2: tmp = math.log(y) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.2) tmp = log(y); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.2) tmp = log(y); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.2], N[Log[y], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2:\\
\;\;\;\;\log y\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 4.20000000000000018Initial program 99.4%
associate-+l-99.4%
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 inf 9.3%
neg-mul-19.3%
Simplified9.3%
Taylor expanded in t around 0 9.3%
Taylor expanded in x around 0 7.0%
if 4.20000000000000018 < 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 78.6%
Taylor expanded in t around inf 75.8%
mul-1-neg75.8%
Simplified75.8%
(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.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.8%
Taylor expanded in t around inf 43.1%
mul-1-neg43.1%
Simplified43.1%
(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 2024106
(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))))