
(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 14 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 (fma x (log y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - (y + z)));
}
function code(x, y, z, t) return fma(x, log(y), Float64(log(t) - Float64(y + z))) end
code[x_, y_, z_, t_] := N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (or (<= t_1 -2.6e+18) (not (<= t_1 2e-32)))
(- t_1 z)
(- (- (log t) z) y))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if ((t_1 <= -2.6e+18) || !(t_1 <= 2e-32)) {
tmp = t_1 - z;
} else {
tmp = (log(t) - z) - 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) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if ((t_1 <= (-2.6d+18)) .or. (.not. (t_1 <= 2d-32))) then
tmp = t_1 - z
else
tmp = (log(t) - z) - y
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 <= -2.6e+18) || !(t_1 <= 2e-32)) {
tmp = t_1 - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if (t_1 <= -2.6e+18) or not (t_1 <= 2e-32): tmp = t_1 - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if ((t_1 <= -2.6e+18) || !(t_1 <= 2e-32)) tmp = Float64(t_1 - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if ((t_1 <= -2.6e+18) || ~((t_1 <= 2e-32))) tmp = t_1 - z; else tmp = (log(t) - z) - y; 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[Or[LessEqual[t$95$1, -2.6e+18], N[Not[LessEqual[t$95$1, 2e-32]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -2.6 \cdot 10^{+18} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-32}\right):\\
\;\;\;\;t\_1 - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.6e18 or 2.00000000000000011e-32 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.5%
if -2.6e18 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.00000000000000011e-32Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-cube-cbrt99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.5%
neg-mul-199.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (<= t_1 -2.6e+18)
(fma (log y) x (- (+ y z)))
(if (<= t_1 2e-32) (- (- (log t) z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if (t_1 <= -2.6e+18) {
tmp = fma(log(y), x, -(y + z));
} else if (t_1 <= 2e-32) {
tmp = (log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if (t_1 <= -2.6e+18) tmp = fma(log(y), x, Float64(-Float64(y + z))); elseif (t_1 <= 2e-32) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return 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, -2.6e+18], N[(N[Log[y], $MachinePrecision] * x + (-N[(y + z), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, 2e-32], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -2.6 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -\left(y + z\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-32}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.6e18Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
sub-neg99.8%
sub-neg99.8%
associate-+l+99.8%
*-commutative99.8%
fma-define99.9%
*-un-lft-identity99.9%
fma-define99.9%
fma-neg99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
if -2.6e18 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.00000000000000011e-32Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-cube-cbrt99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.5%
neg-mul-199.5%
Simplified99.5%
if 2.00000000000000011e-32 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 98.4%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (<= y 0.0017) (- (+ (log t) (* x (log y))) z) (fma (log y) x (- (+ y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.0017) {
tmp = (log(t) + (x * log(y))) - z;
} else {
tmp = fma(log(y), x, -(y + z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 0.0017) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - z); else tmp = fma(log(y), x, Float64(-Float64(y + z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 0.0017], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-N[(y + z), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0017:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -\left(y + z\right)\right)\\
\end{array}
\end{array}
if y < 0.00169999999999999991Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around 0 99.5%
if 0.00169999999999999991 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.0%
sub-neg98.0%
sub-neg98.0%
associate-+l+98.0%
*-commutative98.0%
fma-define98.0%
*-un-lft-identity98.0%
fma-define98.0%
fma-neg98.0%
*-un-lft-identity98.0%
Applied egg-rr98.0%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
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) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (+ (- (* x (log y)) y) (- (log t) z)))
double code(double x, double y, double z, double t) {
return ((x * log(y)) - y) + (log(t) - z);
}
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) + (log(t) - z)
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) - y) + (Math.log(t) - z);
}
def code(x, y, z, t): return ((x * math.log(y)) - y) + (math.log(t) - z)
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) - y) + Float64(log(t) - z)) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) - y) + (log(t) - z); end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y - y\right) + \left(\log t - z\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.4e+122)
(not (or (<= x 1.8e+16) (and (not (<= x 1.34e+73)) (<= x 6.6e+172)))))
(* x (log y))
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.4e+122) || !((x <= 1.8e+16) || (!(x <= 1.34e+73) && (x <= 6.6e+172)))) {
tmp = x * log(y);
} else {
tmp = log(t) - (y + 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) :: tmp
if ((x <= (-1.4d+122)) .or. (.not. (x <= 1.8d+16) .or. (.not. (x <= 1.34d+73)) .and. (x <= 6.6d+172))) then
tmp = x * log(y)
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.4e+122) || !((x <= 1.8e+16) || (!(x <= 1.34e+73) && (x <= 6.6e+172)))) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.4e+122) or not ((x <= 1.8e+16) or (not (x <= 1.34e+73) and (x <= 6.6e+172))): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.4e+122) || !((x <= 1.8e+16) || (!(x <= 1.34e+73) && (x <= 6.6e+172)))) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.4e+122) || ~(((x <= 1.8e+16) || (~((x <= 1.34e+73)) && (x <= 6.6e+172))))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.4e+122], N[Not[Or[LessEqual[x, 1.8e+16], And[N[Not[LessEqual[x, 1.34e+73]], $MachinePrecision], LessEqual[x, 6.6e+172]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+122} \lor \neg \left(x \leq 1.8 \cdot 10^{+16} \lor \neg \left(x \leq 1.34 \cdot 10^{+73}\right) \land x \leq 6.6 \cdot 10^{+172}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.4e122 or 1.8e16 < x < 1.34e73 or 6.59999999999999965e172 < x Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in x around inf 79.6%
if -1.4e122 < x < 1.8e16 or 1.34e73 < x < 6.59999999999999965e172Initial program 99.9%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 93.4%
Final simplification89.6%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.45e+124)
(not (or (<= x 1.8e+16) (and (not (<= x 4.6e+67)) (<= x 3.6e+172)))))
(* x (log y))
(- (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.45e+124) || !((x <= 1.8e+16) || (!(x <= 4.6e+67) && (x <= 3.6e+172)))) {
tmp = x * log(y);
} else {
tmp = -(y + 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) :: tmp
if ((x <= (-1.45d+124)) .or. (.not. (x <= 1.8d+16) .or. (.not. (x <= 4.6d+67)) .and. (x <= 3.6d+172))) then
tmp = x * log(y)
else
tmp = -(y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.45e+124) || !((x <= 1.8e+16) || (!(x <= 4.6e+67) && (x <= 3.6e+172)))) {
tmp = x * Math.log(y);
} else {
tmp = -(y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.45e+124) or not ((x <= 1.8e+16) or (not (x <= 4.6e+67) and (x <= 3.6e+172))): tmp = x * math.log(y) else: tmp = -(y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.45e+124) || !((x <= 1.8e+16) || (!(x <= 4.6e+67) && (x <= 3.6e+172)))) tmp = Float64(x * log(y)); else tmp = Float64(-Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.45e+124) || ~(((x <= 1.8e+16) || (~((x <= 4.6e+67)) && (x <= 3.6e+172))))) tmp = x * log(y); else tmp = -(y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.45e+124], N[Not[Or[LessEqual[x, 1.8e+16], And[N[Not[LessEqual[x, 4.6e+67]], $MachinePrecision], LessEqual[x, 3.6e+172]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-N[(y + z), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+124} \lor \neg \left(x \leq 1.8 \cdot 10^{+16} \lor \neg \left(x \leq 4.6 \cdot 10^{+67}\right) \land x \leq 3.6 \cdot 10^{+172}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-\left(y + z\right)\\
\end{array}
\end{array}
if x < -1.45000000000000011e124 or 1.8e16 < x < 4.5999999999999997e67 or 3.59999999999999975e172 < x Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in x around inf 79.6%
if -1.45000000000000011e124 < x < 1.8e16 or 4.5999999999999997e67 < x < 3.59999999999999975e172Initial program 99.9%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in z around inf 84.9%
Taylor expanded in x around 0 78.7%
neg-mul-178.7%
neg-sub078.7%
metadata-eval78.7%
+-commutative78.7%
associate--r+78.7%
metadata-eval78.7%
neg-sub078.7%
Simplified78.7%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.35e+27) (not (<= x 1.8e+16))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+27) || !(x <= 1.8e+16)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + 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) :: tmp
if ((x <= (-1.35d+27)) .or. (.not. (x <= 1.8d+16))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.35e+27) || !(x <= 1.8e+16)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.35e+27) or not (x <= 1.8e+16): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.35e+27) || !(x <= 1.8e+16)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.35e+27) || ~((x <= 1.8e+16))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.35e+27], N[Not[LessEqual[x, 1.8e+16]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+27} \lor \neg \left(x \leq 1.8 \cdot 10^{+16}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.3499999999999999e27 or 1.8e16 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in z around 0 81.8%
if -1.3499999999999999e27 < x < 1.8e16Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.3%
Final simplification92.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2e+26)
(- t_1 y)
(if (<= x 2.15e+15) (- (log t) (+ y z)) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2e+26) {
tmp = t_1 - y;
} else if (x <= 2.15e+15) {
tmp = log(t) - (y + 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) :: tmp
t_1 = x * log(y)
if (x <= (-2d+26)) then
tmp = t_1 - y
else if (x <= 2.15d+15) then
tmp = log(t) - (y + 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 tmp;
if (x <= -2e+26) {
tmp = t_1 - y;
} else if (x <= 2.15e+15) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2e+26: tmp = t_1 - y elif x <= 2.15e+15: tmp = math.log(t) - (y + z) else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2e+26) tmp = Float64(t_1 - y); elseif (x <= 2.15e+15) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2e+26) tmp = t_1 - y; elseif (x <= 2.15e+15) tmp = log(t) - (y + 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]}, If[LessEqual[x, -2e+26], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 2.15e+15], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+15}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -2.0000000000000001e26Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in z around 0 87.6%
if -2.0000000000000001e26 < x < 2.15e15Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.3%
if 2.15e15 < x Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 91.4%
Final simplification95.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -5.2e+25)
(- t_1 y)
(if (<= x 2.15e+15) (- (- (log t) z) y) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -5.2e+25) {
tmp = t_1 - y;
} else if (x <= 2.15e+15) {
tmp = (log(t) - z) - y;
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-5.2d+25)) then
tmp = t_1 - y
else if (x <= 2.15d+15) then
tmp = (log(t) - z) - y
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 tmp;
if (x <= -5.2e+25) {
tmp = t_1 - y;
} else if (x <= 2.15e+15) {
tmp = (Math.log(t) - z) - y;
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -5.2e+25: tmp = t_1 - y elif x <= 2.15e+15: tmp = (math.log(t) - z) - y else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -5.2e+25) tmp = Float64(t_1 - y); elseif (x <= 2.15e+15) tmp = Float64(Float64(log(t) - z) - y); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -5.2e+25) tmp = t_1 - y; elseif (x <= 2.15e+15) tmp = (log(t) - z) - y; 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]}, If[LessEqual[x, -5.2e+25], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, 2.15e+15], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+25}:\\
\;\;\;\;t\_1 - y\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+15}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if x < -5.1999999999999997e25Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in z around 0 87.6%
if -5.1999999999999997e25 < x < 2.15e15Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
add-cube-cbrt99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 99.3%
neg-mul-199.3%
Simplified99.3%
if 2.15e15 < x Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 91.4%
Final simplification95.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y 950000000.0) (and (not (<= y 1.85e+43)) (<= y 9.5e+115))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= 950000000.0) || (!(y <= 1.85e+43) && (y <= 9.5e+115))) {
tmp = -z;
} else {
tmp = -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 <= 950000000.0d0) .or. (.not. (y <= 1.85d+43)) .and. (y <= 9.5d+115)) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= 950000000.0) || (!(y <= 1.85e+43) && (y <= 9.5e+115))) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= 950000000.0) or (not (y <= 1.85e+43) and (y <= 9.5e+115)): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= 950000000.0) || (!(y <= 1.85e+43) && (y <= 9.5e+115))) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= 950000000.0) || (~((y <= 1.85e+43)) && (y <= 9.5e+115))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, 950000000.0], And[N[Not[LessEqual[y, 1.85e+43]], $MachinePrecision], LessEqual[y, 9.5e+115]]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 950000000 \lor \neg \left(y \leq 1.85 \cdot 10^{+43}\right) \land y \leq 9.5 \cdot 10^{+115}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 9.5e8 or 1.85e43 < y < 9.4999999999999997e115Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 46.8%
neg-mul-146.8%
Simplified46.8%
if 9.5e8 < y < 1.85e43 or 9.4999999999999997e115 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around inf 69.4%
neg-mul-169.4%
Simplified69.4%
Final simplification55.1%
(FPCore (x y z t) :precision binary64 (- (+ y z)))
double code(double x, double y, double z, double t) {
return -(y + z);
}
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 = -(y + z)
end function
public static double code(double x, double y, double z, double t) {
return -(y + z);
}
def code(x, y, z, t): return -(y + z)
function code(x, y, z, t) return Float64(-Float64(y + z)) end
function tmp = code(x, y, z, t) tmp = -(y + z); end
code[x_, y_, z_, t_] := (-N[(y + z), $MachinePrecision])
\begin{array}{l}
\\
-\left(y + z\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 88.9%
Taylor expanded in x around 0 62.4%
neg-mul-162.4%
neg-sub062.4%
metadata-eval62.4%
+-commutative62.4%
associate--r+62.4%
metadata-eval62.4%
neg-sub062.4%
Simplified62.4%
Final simplification62.4%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -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 = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 29.4%
neg-mul-129.4%
Simplified29.4%
Final simplification29.4%
herbie shell --seed 2024062
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))