
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Initial program 99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -5e+143)
t_2
(if (<= t_2 -500000.0)
(- (- (log y) y) z)
(if (<= t_2 4e-16) (- (log t) z) (- t_1 z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+143) {
tmp = t_2;
} else if (t_2 <= -500000.0) {
tmp = (log(y) - y) - z;
} else if (t_2 <= 4e-16) {
tmp = log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-5d+143)) then
tmp = t_2
else if (t_2 <= (-500000.0d0)) then
tmp = (log(y) - y) - z
else if (t_2 <= 4d-16) then
tmp = log(t) - z
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+143) {
tmp = t_2;
} else if (t_2 <= -500000.0) {
tmp = (Math.log(y) - y) - z;
} else if (t_2 <= 4e-16) {
tmp = Math.log(t) - z;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -5e+143: tmp = t_2 elif t_2 <= -500000.0: tmp = (math.log(y) - y) - z elif t_2 <= 4e-16: tmp = math.log(t) - z else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -5e+143) tmp = t_2; elseif (t_2 <= -500000.0) tmp = Float64(Float64(log(y) - y) - z); elseif (t_2 <= 4e-16) tmp = Float64(log(t) - z); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -5e+143) tmp = t_2; elseif (t_2 <= -500000.0) tmp = (log(y) - y) - z; elseif (t_2 <= 4e-16) tmp = log(t) - z; else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+143], t$95$2, If[LessEqual[t$95$2, -500000.0], N[(N[(N[Log[y], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[t$95$2, 4e-16], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+143}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -500000:\\
\;\;\;\;\left(\log y - y\right) - z\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000012e143Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites89.1%
if -5.00000000000000012e143 < (-.f64 (*.f64 x (log.f64 y)) y) < -5e5Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites98.3%
Taylor expanded in x around 0
Applied rewrites85.9%
if -5e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.9999999999999999e-16Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites46.2%
Taylor expanded in x around -inf
Applied rewrites99.8%
if 3.9999999999999999e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
Taylor expanded in x around 0
Applied rewrites99.6%
Taylor expanded in x around 0
Applied rewrites98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (<= t_1 -5e+143)
t_1
(if (<= t_1 -500000.0)
(- (- (log y) y) z)
(if (<= t_1 4e-16) (- (log t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (t_1 <= -5e+143) {
tmp = t_1;
} else if (t_1 <= -500000.0) {
tmp = (log(y) - y) - z;
} else if (t_1 <= 4e-16) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if (t_1 <= (-5d+143)) then
tmp = t_1
else if (t_1 <= (-500000.0d0)) then
tmp = (log(y) - y) - z
else if (t_1 <= 4d-16) then
tmp = log(t) - z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - y;
double tmp;
if (t_1 <= -5e+143) {
tmp = t_1;
} else if (t_1 <= -500000.0) {
tmp = (Math.log(y) - y) - z;
} else if (t_1 <= 4e-16) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if t_1 <= -5e+143: tmp = t_1 elif t_1 <= -500000.0: tmp = (math.log(y) - y) - z elif t_1 <= 4e-16: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_1 <= -5e+143) tmp = t_1; elseif (t_1 <= -500000.0) tmp = Float64(Float64(log(y) - y) - z); elseif (t_1 <= 4e-16) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if (t_1 <= -5e+143) tmp = t_1; elseif (t_1 <= -500000.0) tmp = (log(y) - y) - z; elseif (t_1 <= 4e-16) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+143], t$95$1, If[LessEqual[t$95$1, -500000.0], N[(N[(N[Log[y], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[t$95$1, 4e-16], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq -500000:\\
\;\;\;\;\left(\log y - y\right) - z\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000012e143 or 3.9999999999999999e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites86.9%
if -5.00000000000000012e143 < (-.f64 (*.f64 x (log.f64 y)) y) < -5e5Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites98.3%
Taylor expanded in x around 0
Applied rewrites85.9%
if -5e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.9999999999999999e-16Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites46.2%
Taylor expanded in x around -inf
Applied rewrites99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* x (log y)) y)) (t_2 (- t_1 z))) (if (<= t_1 -500000.0) t_2 (if (<= t_1 4e-16) (- (log t) z) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double t_2 = t_1 - z;
double tmp;
if (t_1 <= -500000.0) {
tmp = t_2;
} else if (t_1 <= 4e-16) {
tmp = log(t) - z;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * log(y)) - y
t_2 = t_1 - z
if (t_1 <= (-500000.0d0)) then
tmp = t_2
else if (t_1 <= 4d-16) then
tmp = log(t) - z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - y;
double t_2 = t_1 - z;
double tmp;
if (t_1 <= -500000.0) {
tmp = t_2;
} else if (t_1 <= 4e-16) {
tmp = Math.log(t) - z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y t_2 = t_1 - z tmp = 0 if t_1 <= -500000.0: tmp = t_2 elif t_1 <= 4e-16: tmp = math.log(t) - z else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) t_2 = Float64(t_1 - z) tmp = 0.0 if (t_1 <= -500000.0) tmp = t_2; elseif (t_1 <= 4e-16) tmp = Float64(log(t) - z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; t_2 = t_1 - z; tmp = 0.0; if (t_1 <= -500000.0) tmp = t_2; elseif (t_1 <= 4e-16) tmp = log(t) - z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - z), $MachinePrecision]}, If[LessEqual[t$95$1, -500000.0], t$95$2, If[LessEqual[t$95$1, 4e-16], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
t_2 := t\_1 - z\\
\mathbf{if}\;t\_1 \leq -500000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e5 or 3.9999999999999999e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites99.4%
if -5e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.9999999999999999e-16Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites46.2%
Taylor expanded in x around -inf
Applied rewrites99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -500000.0)
(- (- (log y) y) z)
(if (<= t_2 4e-16) (- (log t) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -500000.0) {
tmp = (log(y) - y) - z;
} else if (t_2 <= 4e-16) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-500000.0d0)) then
tmp = (log(y) - y) - z
else if (t_2 <= 4d-16) then
tmp = log(t) - z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -500000.0) {
tmp = (Math.log(y) - y) - z;
} else if (t_2 <= 4e-16) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -500000.0: tmp = (math.log(y) - y) - z elif t_2 <= 4e-16: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -500000.0) tmp = Float64(Float64(log(y) - y) - z); elseif (t_2 <= 4e-16) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -500000.0) tmp = (log(y) - y) - z; elseif (t_2 <= 4e-16) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -500000.0], N[(N[(N[Log[y], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[t$95$2, 4e-16], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -500000:\\
\;\;\;\;\left(\log y - y\right) - z\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e5Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites99.3%
Taylor expanded in x around 0
Applied rewrites73.4%
if -5e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.9999999999999999e-16Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites46.2%
Taylor expanded in x around -inf
Applied rewrites99.8%
if 3.9999999999999999e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
Taylor expanded in x around 0
Applied rewrites99.6%
Taylor expanded in x around 0
Applied rewrites81.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -1e+110) (- (log y) y) (if (<= t_2 4e-16) (- (log t) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -1e+110) {
tmp = log(y) - y;
} else if (t_2 <= 4e-16) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-1d+110)) then
tmp = log(y) - y
else if (t_2 <= 4d-16) then
tmp = log(t) - z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -1e+110) {
tmp = Math.log(y) - y;
} else if (t_2 <= 4e-16) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -1e+110: tmp = math.log(y) - y elif t_2 <= 4e-16: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -1e+110) tmp = Float64(log(y) - y); elseif (t_2 <= 4e-16) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -1e+110) tmp = log(y) - y; elseif (t_2 <= 4e-16) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+110], N[(N[Log[y], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[t$95$2, 4e-16], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+110}:\\
\;\;\;\;\log y - y\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-16}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1e110Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites84.8%
Taylor expanded in y around 0
Applied rewrites56.0%
if -1e110 < (-.f64 (*.f64 x (log.f64 y)) y) < 3.9999999999999999e-16Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites65.3%
Taylor expanded in x around -inf
Applied rewrites81.9%
if 3.9999999999999999e-16 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
Taylor expanded in x around 0
Applied rewrites99.6%
Taylor expanded in x around 0
Applied rewrites81.1%
(FPCore (x y z t) :precision binary64 (if (<= y 1.75e+99) (- (log t) z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.75e+99) {
tmp = log(t) - z;
} else {
tmp = log(t) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.75d+99) then
tmp = log(t) - z
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.75e+99) {
tmp = Math.log(t) - z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.75e+99: tmp = math.log(t) - z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.75e+99) tmp = Float64(log(t) - z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.75e+99) tmp = log(t) - z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.75e+99], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75 \cdot 10^{+99}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if y < 1.7499999999999999e99Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites78.7%
Taylor expanded in x around -inf
Applied rewrites55.6%
if 1.7499999999999999e99 < y Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites81.6%
Taylor expanded in x around 0
Applied rewrites68.2%
(FPCore (x y z t) :precision binary64 (- (log t) y))
double code(double x, double y, double z, double t) {
return log(t) - y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) - y
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) - y;
}
def code(x, y, z, t): return math.log(t) - y
function code(x, y, z, t) return Float64(log(t) - y) end
function tmp = code(x, y, z, t) tmp = log(t) - y; end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\log t - y
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites86.3%
Taylor expanded in x around 0
Applied rewrites59.2%
Taylor expanded in x around 0
Applied rewrites43.3%
(FPCore (x y z t) :precision binary64 (log t))
double code(double x, double y, double z, double t) {
return log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t);
}
def code(x, y, z, t): return math.log(t)
function code(x, y, z, t) return log(t) end
function tmp = code(x, y, z, t) tmp = log(t); end
code[x_, y_, z_, t_] := N[Log[t], $MachinePrecision]
\begin{array}{l}
\\
\log t
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites86.3%
Taylor expanded in x around -inf
Applied rewrites15.5%
herbie shell --seed 2024321
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
:pre (TRUE)
(+ (- (- (* x (log y)) y) z) (log t)))