
(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 12 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 (+ (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.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (or (<= t_1 -2e+23) (not (<= t_1 2e-17)))
(- t_1 z)
(- (log t) (+ y z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if ((t_1 <= -2e+23) || !(t_1 <= 2e-17)) {
tmp = t_1 - z;
} 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) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if ((t_1 <= (-2d+23)) .or. (.not. (t_1 <= 2d-17))) then
tmp = t_1 - z
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 t_1 = (x * Math.log(y)) - y;
double tmp;
if ((t_1 <= -2e+23) || !(t_1 <= 2e-17)) {
tmp = t_1 - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if (t_1 <= -2e+23) or not (t_1 <= 2e-17): tmp = t_1 - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if ((t_1 <= -2e+23) || !(t_1 <= 2e-17)) tmp = Float64(t_1 - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if ((t_1 <= -2e+23) || ~((t_1 <= 2e-17))) tmp = t_1 - z; else tmp = log(t) - (y + z); 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, -2e+23], N[Not[LessEqual[t$95$1, 2e-17]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+23} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-17}\right):\\
\;\;\;\;t\_1 - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999998e23 or 2.00000000000000014e-17 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 89.1%
Simplified88.9%
clear-num88.8%
un-div-inv88.9%
Applied egg-rr88.9%
Taylor expanded in z around inf 88.9%
Taylor expanded in y around 0 99.8%
if -1.9999999999999998e23 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.00000000000000014e-17Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 112.0) (- (+ t_1 (log t)) z) (- (- t_1 y) z))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 112.0) {
tmp = (t_1 + log(t)) - z;
} else {
tmp = (t_1 - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 112.0d0) then
tmp = (t_1 + log(t)) - z
else
tmp = (t_1 - y) - 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 (y <= 112.0) {
tmp = (t_1 + Math.log(t)) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 112.0: tmp = (t_1 + math.log(t)) - z else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 112.0) tmp = Float64(Float64(t_1 + log(t)) - z); else tmp = Float64(Float64(t_1 - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 112.0) tmp = (t_1 + log(t)) - z; else tmp = (t_1 - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 112.0], N[(N[(t$95$1 + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 112:\\
\;\;\;\;\left(t\_1 + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - y\right) - z\\
\end{array}
\end{array}
if y < 112Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around 0 98.8%
if 112 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 99.9%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.3e+63) (not (<= x 2.8e+49))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e+63) || !(x <= 2.8e+49)) {
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 <= (-2.3d+63)) .or. (.not. (x <= 2.8d+49))) 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 <= -2.3e+63) || !(x <= 2.8e+49)) {
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 <= -2.3e+63) or not (x <= 2.8e+49): 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 <= -2.3e+63) || !(x <= 2.8e+49)) 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 <= -2.3e+63) || ~((x <= 2.8e+49))) 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, -2.3e+63], N[Not[LessEqual[x, 2.8e+49]], $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 -2.3 \cdot 10^{+63} \lor \neg \left(x \leq 2.8 \cdot 10^{+49}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.29999999999999993e63 or 2.7999999999999998e49 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 88.1%
if -2.29999999999999993e63 < x < 2.7999999999999998e49Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 98.5%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8.8e+64) (not (<= x 1.95e+86))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.8e+64) || !(x <= 1.95e+86)) {
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 <= (-8.8d+64)) .or. (.not. (x <= 1.95d+86))) 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 <= -8.8e+64) || !(x <= 1.95e+86)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8.8e+64) or not (x <= 1.95e+86): 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 <= -8.8e+64) || !(x <= 1.95e+86)) 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 <= -8.8e+64) || ~((x <= 1.95e+86))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.8e+64], N[Not[LessEqual[x, 1.95e+86]], $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 -8.8 \cdot 10^{+64} \lor \neg \left(x \leq 1.95 \cdot 10^{+86}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -8.80000000000000007e64 or 1.9500000000000001e86 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 87.9%
Taylor expanded in x around inf 87.9%
mul-1-neg87.9%
unsub-neg87.9%
Simplified87.9%
Taylor expanded in z around 0 75.6%
if -8.80000000000000007e64 < x < 1.9500000000000001e86Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 96.8%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (<= x -3.5e+63) (* x (- (log y) (/ z x))) (if (<= x 5.2e+50) (- (log t) (+ y z)) (- (* x (log y)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.5e+63) {
tmp = x * (log(y) - (z / x));
} else if (x <= 5.2e+50) {
tmp = log(t) - (y + z);
} else {
tmp = (x * log(y)) - 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 (x <= (-3.5d+63)) then
tmp = x * (log(y) - (z / x))
else if (x <= 5.2d+50) then
tmp = log(t) - (y + z)
else
tmp = (x * log(y)) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.5e+63) {
tmp = x * (Math.log(y) - (z / x));
} else if (x <= 5.2e+50) {
tmp = Math.log(t) - (y + z);
} else {
tmp = (x * Math.log(y)) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.5e+63: tmp = x * (math.log(y) - (z / x)) elif x <= 5.2e+50: tmp = math.log(t) - (y + z) else: tmp = (x * math.log(y)) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.5e+63) tmp = Float64(x * Float64(log(y) - Float64(z / x))); elseif (x <= 5.2e+50) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(x * log(y)) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.5e+63) tmp = x * (log(y) - (z / x)); elseif (x <= 5.2e+50) tmp = log(t) - (y + z); else tmp = (x * log(y)) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.5e+63], N[(x * N[(N[Log[y], $MachinePrecision] - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+50], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+63}:\\
\;\;\;\;x \cdot \left(\log y - \frac{z}{x}\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+50}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - y\\
\end{array}
\end{array}
if x < -3.50000000000000029e63Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 90.2%
Taylor expanded in x around inf 90.3%
mul-1-neg90.3%
unsub-neg90.3%
Simplified90.3%
if -3.50000000000000029e63 < x < 5.2000000000000004e50Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 98.5%
if 5.2000000000000004e50 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 91.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.5e+63)
(- t_1 z)
(if (<= x 1.12e+52) (- (log t) (+ y z)) (- t_1 y)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.5e+63) {
tmp = t_1 - z;
} else if (x <= 1.12e+52) {
tmp = log(t) - (y + z);
} else {
tmp = t_1 - 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)
if (x <= (-3.5d+63)) then
tmp = t_1 - z
else if (x <= 1.12d+52) then
tmp = log(t) - (y + z)
else
tmp = t_1 - 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);
double tmp;
if (x <= -3.5e+63) {
tmp = t_1 - z;
} else if (x <= 1.12e+52) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3.5e+63: tmp = t_1 - z elif x <= 1.12e+52: tmp = math.log(t) - (y + z) else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.5e+63) tmp = Float64(t_1 - z); elseif (x <= 1.12e+52) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -3.5e+63) tmp = t_1 - z; elseif (x <= 1.12e+52) tmp = log(t) - (y + z); else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e+63], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[x, 1.12e+52], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+63}:\\
\;\;\;\;t\_1 - z\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+52}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - y\\
\end{array}
\end{array}
if x < -3.50000000000000029e63Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 90.2%
if -3.50000000000000029e63 < x < 1.12000000000000002e52Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 98.5%
if 1.12000000000000002e52 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 91.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.3e+64) (not (<= x 1.15e+86))) (* x (log y)) (* y (- -1.0 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e+64) || !(x <= 1.15e+86)) {
tmp = x * log(y);
} else {
tmp = y * (-1.0 - (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) :: tmp
if ((x <= (-2.3d+64)) .or. (.not. (x <= 1.15d+86))) then
tmp = x * log(y)
else
tmp = y * ((-1.0d0) - (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.3e+64) || !(x <= 1.15e+86)) {
tmp = x * Math.log(y);
} else {
tmp = y * (-1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.3e+64) or not (x <= 1.15e+86): tmp = x * math.log(y) else: tmp = y * (-1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.3e+64) || !(x <= 1.15e+86)) tmp = Float64(x * log(y)); else tmp = Float64(y * Float64(-1.0 - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.3e+64) || ~((x <= 1.15e+86))) tmp = x * log(y); else tmp = y * (-1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.3e+64], N[Not[LessEqual[x, 1.15e+86]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(y * N[(-1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+64} \lor \neg \left(x \leq 1.15 \cdot 10^{+86}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 - \frac{z}{y}\right)\\
\end{array}
\end{array}
if x < -2.3e64 or 1.14999999999999995e86 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 87.9%
Taylor expanded in x around inf 87.9%
mul-1-neg87.9%
unsub-neg87.9%
Simplified87.9%
Taylor expanded in z around 0 75.6%
if -2.3e64 < x < 1.14999999999999995e86Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in y around inf 90.4%
Simplified71.1%
clear-num71.1%
un-div-inv71.1%
Applied egg-rr71.1%
Taylor expanded in z around inf 71.8%
Taylor expanded in x around 0 68.6%
mul-1-neg68.6%
distribute-rgt-neg-in68.6%
distribute-neg-in68.6%
metadata-eval68.6%
sub-neg68.6%
Simplified68.6%
Final simplification71.1%
(FPCore (x y z t) :precision binary64 (if (<= y 6.8) (- z) (* y (- -1.0 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.8) {
tmp = -z;
} else {
tmp = y * (-1.0 - (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) :: tmp
if (y <= 6.8d0) then
tmp = -z
else
tmp = y * ((-1.0d0) - (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.8) {
tmp = -z;
} else {
tmp = y * (-1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.8: tmp = -z else: tmp = y * (-1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.8) tmp = Float64(-z); else tmp = Float64(y * Float64(-1.0 - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.8) tmp = -z; else tmp = y * (-1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.8], (-z), N[(y * N[(-1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 - \frac{z}{y}\right)\\
\end{array}
\end{array}
if y < 6.79999999999999982Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 37.7%
mul-1-neg37.7%
Simplified37.7%
if 6.79999999999999982 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 75.3%
mul-1-neg75.3%
distribute-rgt-neg-in75.3%
distribute-neg-in75.3%
metadata-eval75.3%
sub-neg75.3%
Simplified75.3%
(FPCore (x y z t) :precision binary64 (if (<= y 4e+69) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4e+69) {
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 <= 4d+69) 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 <= 4e+69) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4e+69: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4e+69) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4e+69) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4e+69], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{+69}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 4.0000000000000003e69Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 38.3%
mul-1-neg38.3%
Simplified38.3%
if 4.0000000000000003e69 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 64.8%
mul-1-neg64.8%
Simplified64.8%
(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.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 31.7%
mul-1-neg31.7%
Simplified31.7%
(FPCore (x y z t) :precision binary64 z)
double code(double x, double y, double z, double t) {
return 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 = z
end function
public static double code(double x, double y, double z, double t) {
return z;
}
def code(x, y, z, t): return z
function code(x, y, z, t) return z end
function tmp = code(x, y, z, t) tmp = z; end
code[x_, y_, z_, t_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 29.3%
mul-1-neg29.3%
Simplified29.3%
add-sqr-sqrt13.4%
sqrt-unprod6.7%
sqr-neg6.7%
sqrt-unprod1.1%
add-sqr-sqrt2.3%
*-un-lft-identity2.3%
Applied egg-rr2.3%
Taylor expanded in z around 0 2.3%
herbie shell --seed 2024157
(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)))