
(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 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
unsub-neg99.9%
fma-udef99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.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 -4e+21) (not (<= t_1 5e-9)))
(- 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 <= -4e+21) || !(t_1 <= 5e-9)) {
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 <= (-4d+21)) .or. (.not. (t_1 <= 5d-9))) 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 <= -4e+21) || !(t_1 <= 5e-9)) {
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 <= -4e+21) or not (t_1 <= 5e-9): 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 <= -4e+21) || !(t_1 <= 5e-9)) 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 <= -4e+21) || ~((t_1 <= 5e-9))) 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, -4e+21], N[Not[LessEqual[t$95$1, 5e-9]], $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 -4 \cdot 10^{+21} \lor \neg \left(t_1 \leq 5 \cdot 10^{-9}\right):\\
\;\;\;\;t_1 - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4e21 or 5.0000000000000001e-9 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
if -4e21 < (-.f64 (*.f64 x (log.f64 y)) y) < 5.0000000000000001e-9Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 98.8%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 195.0) (- (+ (log t) t_1) 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 <= 195.0) {
tmp = (log(t) + t_1) - 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 <= 195.0d0) then
tmp = (log(t) + t_1) - 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 <= 195.0) {
tmp = (Math.log(t) + t_1) - 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 <= 195.0: tmp = (math.log(t) + t_1) - 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 <= 195.0) tmp = Float64(Float64(log(t) + t_1) - 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 <= 195.0) tmp = (log(t) + t_1) - 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, 195.0], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $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 195:\\
\;\;\;\;\left(\log t + t_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - y\right) - z\\
\end{array}
\end{array}
if y < 195Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around 0 99.2%
if 195 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.3%
Final simplification99.3%
(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))) (t_2 (- (- y) z)))
(if (<= x -4.3e+60)
t_1
(if (<= x -1e-210)
t_2
(if (<= x -1.12e-225)
(log t)
(if (<= x 1.75e-120)
t_2
(if (<= x 2.4e-79) (log t) (if (<= x 6.2e+164) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -y - z;
double tmp;
if (x <= -4.3e+60) {
tmp = t_1;
} else if (x <= -1e-210) {
tmp = t_2;
} else if (x <= -1.12e-225) {
tmp = log(t);
} else if (x <= 1.75e-120) {
tmp = t_2;
} else if (x <= 2.4e-79) {
tmp = log(t);
} else if (x <= 6.2e+164) {
tmp = t_2;
} 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 = -y - z
if (x <= (-4.3d+60)) then
tmp = t_1
else if (x <= (-1d-210)) then
tmp = t_2
else if (x <= (-1.12d-225)) then
tmp = log(t)
else if (x <= 1.75d-120) then
tmp = t_2
else if (x <= 2.4d-79) then
tmp = log(t)
else if (x <= 6.2d+164) then
tmp = t_2
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 = -y - z;
double tmp;
if (x <= -4.3e+60) {
tmp = t_1;
} else if (x <= -1e-210) {
tmp = t_2;
} else if (x <= -1.12e-225) {
tmp = Math.log(t);
} else if (x <= 1.75e-120) {
tmp = t_2;
} else if (x <= 2.4e-79) {
tmp = Math.log(t);
} else if (x <= 6.2e+164) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -y - z tmp = 0 if x <= -4.3e+60: tmp = t_1 elif x <= -1e-210: tmp = t_2 elif x <= -1.12e-225: tmp = math.log(t) elif x <= 1.75e-120: tmp = t_2 elif x <= 2.4e-79: tmp = math.log(t) elif x <= 6.2e+164: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -4.3e+60) tmp = t_1; elseif (x <= -1e-210) tmp = t_2; elseif (x <= -1.12e-225) tmp = log(t); elseif (x <= 1.75e-120) tmp = t_2; elseif (x <= 2.4e-79) tmp = log(t); elseif (x <= 6.2e+164) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = -y - z; tmp = 0.0; if (x <= -4.3e+60) tmp = t_1; elseif (x <= -1e-210) tmp = t_2; elseif (x <= -1.12e-225) tmp = log(t); elseif (x <= 1.75e-120) tmp = t_2; elseif (x <= 2.4e-79) tmp = log(t); elseif (x <= 6.2e+164) tmp = t_2; 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[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -4.3e+60], t$95$1, If[LessEqual[x, -1e-210], t$95$2, If[LessEqual[x, -1.12e-225], N[Log[t], $MachinePrecision], If[LessEqual[x, 1.75e-120], t$95$2, If[LessEqual[x, 2.4e-79], N[Log[t], $MachinePrecision], If[LessEqual[x, 6.2e+164], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-210}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-225}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-120}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-79}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+164}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.29999999999999971e60 or 6.2000000000000003e164 < x Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
if -4.29999999999999971e60 < x < -1e-210 or -1.12000000000000003e-225 < x < 1.75e-120 or 2.40000000000000006e-79 < x < 6.2000000000000003e164Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 80.0%
add-sqr-sqrt10.7%
pow210.7%
Applied egg-rr10.7%
Taylor expanded in x around 0 0.0%
unpow20.0%
rem-square-sqrt74.6%
*-commutative74.6%
neg-mul-174.6%
Simplified74.6%
if -1e-210 < x < -1.12000000000000003e-225 or 1.75e-120 < x < 2.40000000000000006e-79Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 93.1%
Taylor expanded in y around 0 86.5%
Final simplification72.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.65e+62) (not (<= x 4.2e+167))) (* x (log y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.65e+62) || !(x <= 4.2e+167)) {
tmp = x * log(y);
} 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) :: tmp
if ((x <= (-1.65d+62)) .or. (.not. (x <= 4.2d+167))) then
tmp = x * log(y)
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 tmp;
if ((x <= -1.65e+62) || !(x <= 4.2e+167)) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.65e+62) or not (x <= 4.2e+167): tmp = x * math.log(y) else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.65e+62) || !(x <= 4.2e+167)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.65e+62) || ~((x <= 4.2e+167))) tmp = x * log(y); else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.65e+62], N[Not[LessEqual[x, 4.2e+167]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+62} \lor \neg \left(x \leq 4.2 \cdot 10^{+167}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -1.65e62 or 4.1999999999999998e167 < x Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
if -1.65e62 < x < 4.1999999999999998e167Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
unsub-neg100.0%
fma-udef100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 94.4%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -10500000000.0) (not (<= z 0.00085))) (- (- y) z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -10500000000.0) || !(z <= 0.00085)) {
tmp = -y - 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 ((z <= (-10500000000.0d0)) .or. (.not. (z <= 0.00085d0))) then
tmp = -y - 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 ((z <= -10500000000.0) || !(z <= 0.00085)) {
tmp = -y - z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -10500000000.0) or not (z <= 0.00085): tmp = -y - z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -10500000000.0) || !(z <= 0.00085)) tmp = Float64(Float64(-y) - z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -10500000000.0) || ~((z <= 0.00085))) tmp = -y - z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -10500000000.0], N[Not[LessEqual[z, 0.00085]], $MachinePrecision]], N[((-y) - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10500000000 \lor \neg \left(z \leq 0.00085\right):\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -1.05e10 or 8.49999999999999953e-4 < z Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in z around inf 99.5%
add-sqr-sqrt20.7%
pow220.7%
Applied egg-rr20.7%
Taylor expanded in x around 0 0.0%
unpow20.0%
rem-square-sqrt82.3%
*-commutative82.3%
neg-mul-182.3%
Simplified82.3%
if -1.05e10 < z < 8.49999999999999953e-4Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
unsub-neg99.8%
fma-udef99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 63.2%
Taylor expanded in z around 0 62.5%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3e-235) (not (<= z 5.5e-118))) (- (- y) z) (log t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e-235) || !(z <= 5.5e-118)) {
tmp = -y - z;
} else {
tmp = log(t);
}
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 ((z <= (-3d-235)) .or. (.not. (z <= 5.5d-118))) then
tmp = -y - z
else
tmp = log(t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e-235) || !(z <= 5.5e-118)) {
tmp = -y - z;
} else {
tmp = Math.log(t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3e-235) or not (z <= 5.5e-118): tmp = -y - z else: tmp = math.log(t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3e-235) || !(z <= 5.5e-118)) tmp = Float64(Float64(-y) - z); else tmp = log(t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3e-235) || ~((z <= 5.5e-118))) tmp = -y - z; else tmp = log(t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3e-235], N[Not[LessEqual[z, 5.5e-118]], $MachinePrecision]], N[((-y) - z), $MachinePrecision], N[Log[t], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-235} \lor \neg \left(z \leq 5.5 \cdot 10^{-118}\right):\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t\\
\end{array}
\end{array}
if z < -2.9999999999999999e-235 or 5.5000000000000003e-118 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 91.8%
add-sqr-sqrt20.6%
pow220.6%
Applied egg-rr20.6%
Taylor expanded in x around 0 0.0%
unpow20.0%
rem-square-sqrt69.1%
*-commutative69.1%
neg-mul-169.1%
Simplified69.1%
if -2.9999999999999999e-235 < z < 5.5000000000000003e-118Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
unsub-neg99.8%
fma-udef99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 60.4%
Taylor expanded in z around 0 60.4%
Taylor expanded in y around 0 44.5%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (if (<= y 190.0) (- (log t) z) (- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 190.0) {
tmp = log(t) - z;
} 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 (y <= 190.0d0) then
tmp = log(t) - z
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 (y <= 190.0) {
tmp = Math.log(t) - z;
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 190.0: tmp = math.log(t) - z else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 190.0) tmp = Float64(log(t) - z); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 190.0) tmp = log(t) - z; else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 190.0], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 190:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if y < 190Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around 0 99.2%
Taylor expanded in x around 0 72.2%
if 190 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.3%
add-sqr-sqrt16.5%
pow216.5%
Applied egg-rr16.5%
Taylor expanded in x around 0 0.0%
unpow20.0%
rem-square-sqrt72.3%
*-commutative72.3%
neg-mul-172.3%
Simplified72.3%
Final simplification72.3%
(FPCore (x y z t) :precision binary64 (if (<= y 7.5e+83) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.5e+83) {
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 <= 7.5d+83) 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 <= 7.5e+83) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7.5e+83: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7.5e+83) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 7.5e+83) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.5e+83], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{+83}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 7.49999999999999989e83Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 39.0%
neg-mul-139.0%
Simplified39.0%
if 7.49999999999999989e83 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around inf 64.1%
neg-mul-164.1%
Simplified64.1%
Final simplification48.4%
(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\right) - z
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 83.3%
add-sqr-sqrt19.3%
pow219.3%
Applied egg-rr19.3%
Taylor expanded in x around 0 0.0%
unpow20.0%
rem-square-sqrt56.5%
*-commutative56.5%
neg-mul-156.5%
Simplified56.5%
Final simplification56.5%
(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%
Simplified99.9%
Taylor expanded in y around inf 28.9%
neg-mul-128.9%
Simplified28.9%
Final simplification28.9%
herbie shell --seed 2024019
(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)))