
(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 9 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) (- (* (log t) (- a 0.5)) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) + ((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((x + y)) + (log(z) + ((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((x + y)) + (Math.log(z) + ((Math.log(t) * (a - 0.5)) - t));
}
def code(x, y, z, t, a): return math.log((x + y)) + (math.log(z) + ((math.log(t) * (a - 0.5)) - t))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) + Float64(Float64(log(t) * Float64(a - 0.5)) - t))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + (log(z) + ((log(t) * (a - 0.5)) - t)); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z + \left(\log t \cdot \left(a - 0.5\right) - t\right)\right)
\end{array}
Initial program 99.6%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 7.8e-22) (+ (log z) (+ (log (+ x y)) (* (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 <= 7.8e-22) {
tmp = log(z) + (log((x + y)) + (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 <= 7.8d-22) then
tmp = log(z) + (log((x + y)) + (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 <= 7.8e-22) {
tmp = Math.log(z) + (Math.log((x + y)) + (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 <= 7.8e-22: tmp = math.log(z) + (math.log((x + y)) + (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 <= 7.8e-22) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + 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 <= 7.8e-22) tmp = log(z) + (log((x + y)) + (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, 7.8e-22], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.8 \cdot 10^{-22}:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a + -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 7.79999999999999996e-22Initial program 99.3%
Taylor expanded in t around 0
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6499.4%
Simplified99.4%
if 7.79999999999999996e-22 < t Initial program 99.9%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.8%
Simplified99.8%
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
Applied egg-rr73.2%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6498.5%
Simplified98.5%
Final simplification98.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 7.8e-22) (+ (log z) (+ (* (log t) (+ a -0.5)) (log y))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7.8e-22) {
tmp = log(z) + ((log(t) * (a + -0.5)) + log(y));
} 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 <= 7.8d-22) then
tmp = log(z) + ((log(t) * (a + (-0.5d0))) + log(y))
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 <= 7.8e-22) {
tmp = Math.log(z) + ((Math.log(t) * (a + -0.5)) + Math.log(y));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7.8e-22: tmp = math.log(z) + ((math.log(t) * (a + -0.5)) + math.log(y)) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7.8e-22) tmp = Float64(log(z) + Float64(Float64(log(t) * Float64(a + -0.5)) + log(y))); 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 <= 7.8e-22) tmp = log(z) + ((log(t) * (a + -0.5)) + log(y)); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7.8e-22], N[(N[Log[z], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.8 \cdot 10^{-22}:\\
\;\;\;\;\log z + \left(\log t \cdot \left(a + -0.5\right) + \log y\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 7.79999999999999996e-22Initial program 99.3%
Taylor expanded in t around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6498.4%
Simplified98.4%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr73.2%
Taylor expanded in t around 0
/-lowering-/.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6473.2%
Simplified73.2%
Taylor expanded in y around inf
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6460.4%
Simplified60.4%
if 7.79999999999999996e-22 < t Initial program 99.9%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.8%
Simplified99.8%
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
Applied egg-rr73.2%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6498.5%
Simplified98.5%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.8e-58) (+ (* (log t) (+ a -0.5)) (log (* y z))) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.8e-58) {
tmp = (log(t) * (a + -0.5)) + log((y * z));
} else {
tmp = (log(t) * (a - 0.5)) - 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.8d-58) then
tmp = (log(t) * (a + (-0.5d0))) + log((y * z))
else
tmp = (log(t) * (a - 0.5d0)) - 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.8e-58) {
tmp = (Math.log(t) * (a + -0.5)) + Math.log((y * z));
} else {
tmp = (Math.log(t) * (a - 0.5)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.8e-58: tmp = (math.log(t) * (a + -0.5)) + math.log((y * z)) else: tmp = (math.log(t) * (a - 0.5)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.8e-58) tmp = Float64(Float64(log(t) * Float64(a + -0.5)) + log(Float64(y * z))); else tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.8e-58) tmp = (log(t) * (a + -0.5)) + log((y * z)); else tmp = (log(t) * (a - 0.5)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.8e-58], 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] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{-58}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\
\end{array}
\end{array}
if t < 4.8000000000000001e-58Initial program 99.3%
Taylor expanded in t around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6498.3%
Simplified98.3%
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr73.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6473.8%
Simplified73.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6439.7%
Simplified39.7%
if 4.8000000000000001e-58 < t Initial program 99.9%
Taylor expanded in t around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6499.8%
Simplified99.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-lowering-neg.f6496.8%
Simplified96.8%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (* (log t) a) t))) (if (<= a -1.3) t_1 (if (<= a 0.65) (- (log (+ x y)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(t) * a) - t;
double tmp;
if (a <= -1.3) {
tmp = t_1;
} else if (a <= 0.65) {
tmp = log((x + y)) - 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 = (log(t) * a) - t
if (a <= (-1.3d0)) then
tmp = t_1
else if (a <= 0.65d0) then
tmp = log((x + y)) - 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 = (Math.log(t) * a) - t;
double tmp;
if (a <= -1.3) {
tmp = t_1;
} else if (a <= 0.65) {
tmp = Math.log((x + y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log(t) * a) - t tmp = 0 if a <= -1.3: tmp = t_1 elif a <= 0.65: tmp = math.log((x + y)) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(t) * a) - t) tmp = 0.0 if (a <= -1.3) tmp = t_1; elseif (a <= 0.65) tmp = Float64(log(Float64(x + y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log(t) * a) - t; tmp = 0.0; if (a <= -1.3) tmp = t_1; elseif (a <= 0.65) tmp = log((x + y)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -1.3], t$95$1, If[LessEqual[a, 0.65], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a - t\\
\mathbf{if}\;a \leq -1.3:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 0.65:\\
\;\;\;\;\log \left(x + y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.30000000000000004 or 0.650000000000000022 < a Initial program 99.7%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.7%
Simplified99.7%
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
Applied egg-rr72.8%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6498.7%
Simplified98.7%
if -1.30000000000000004 < a < 0.650000000000000022Initial program 99.6%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.6%
Simplified99.6%
Taylor expanded in t around inf
*-lowering-*.f64N/A
associate--r+N/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
associate-/l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
log-recN/A
mul-1-negN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
--lowering--.f6498.8%
Simplified98.8%
Taylor expanded in t around inf
mul-1-negN/A
neg-lowering-neg.f6458.7%
Simplified58.7%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) a))) (if (<= a -1.15e+39) t_1 (if (<= a 6e+43) (- 0.0 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 <= -1.15e+39) {
tmp = t_1;
} else if (a <= 6e+43) {
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 = log(t) * a
if (a <= (-1.15d+39)) then
tmp = t_1
else if (a <= 6d+43) 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 = Math.log(t) * a;
double tmp;
if (a <= -1.15e+39) {
tmp = t_1;
} else if (a <= 6e+43) {
tmp = 0.0 - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if a <= -1.15e+39: tmp = t_1 elif a <= 6e+43: tmp = 0.0 - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (a <= -1.15e+39) tmp = t_1; elseif (a <= 6e+43) tmp = Float64(0.0 - t); else tmp = 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 <= -1.15e+39) tmp = t_1; elseif (a <= 6e+43) tmp = 0.0 - t; else tmp = 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[a, -1.15e+39], t$95$1, If[LessEqual[a, 6e+43], N[(0.0 - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -1.15 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+43}:\\
\;\;\;\;0 - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.15000000000000006e39 or 6.00000000000000033e43 < a Initial program 99.6%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.6%
Simplified99.6%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6483.8%
Simplified83.8%
if -1.15000000000000006e39 < a < 6.00000000000000033e43Initial program 99.6%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.7%
Simplified99.7%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6453.8%
Simplified53.8%
sub0-negN/A
neg-lowering-neg.f6453.8%
Applied egg-rr53.8%
Final simplification65.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.6%
Taylor expanded in t around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
log-lowering-log.f6499.2%
Simplified99.2%
Taylor expanded in t around inf
mul-1-negN/A
neg-lowering-neg.f6476.2%
Simplified76.2%
Final simplification76.2%
(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.6%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.6%
Simplified99.6%
associate-+r-N/A
+-commutativeN/A
associate--r+N/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
Applied egg-rr73.5%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6473.5%
Simplified73.5%
(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%
associate--l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
+-lowering-+.f64N/A
associate-+l-N/A
--lowering--.f64N/A
log-lowering-log.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f6499.6%
Simplified99.6%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6438.9%
Simplified38.9%
sub0-negN/A
neg-lowering-neg.f6438.9%
Applied egg-rr38.9%
Final simplification38.9%
(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 2024160
(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))))