
(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 11 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.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 210.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 <= 210.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 <= 210.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 <= 210.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 <= 210.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 <= 210.0) tmp = Float64(Float64(t_1 + log(t)) - z); else tmp = Float64(t_1 - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 210.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, 210.0], N[(N[(t$95$1 + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 210:\\
\;\;\;\;\left(t\_1 + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\end{array}
\end{array}
if y < 210Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around 0 99.1%
if 210 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -300000000000.0)
t_1
(if (<= x -1.7e-301)
t_2
(if (<= x 9e-217) (- (log t) z) (if (<= x 1.9e+61) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - y;
double tmp;
if (x <= -300000000000.0) {
tmp = t_1;
} else if (x <= -1.7e-301) {
tmp = t_2;
} else if (x <= 9e-217) {
tmp = log(t) - z;
} else if (x <= 1.9e+61) {
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 = log(t) - y
if (x <= (-300000000000.0d0)) then
tmp = t_1
else if (x <= (-1.7d-301)) then
tmp = t_2
else if (x <= 9d-217) then
tmp = log(t) - z
else if (x <= 1.9d+61) 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 = Math.log(t) - y;
double tmp;
if (x <= -300000000000.0) {
tmp = t_1;
} else if (x <= -1.7e-301) {
tmp = t_2;
} else if (x <= 9e-217) {
tmp = Math.log(t) - z;
} else if (x <= 1.9e+61) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - y tmp = 0 if x <= -300000000000.0: tmp = t_1 elif x <= -1.7e-301: tmp = t_2 elif x <= 9e-217: tmp = math.log(t) - z elif x <= 1.9e+61: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - y) tmp = 0.0 if (x <= -300000000000.0) tmp = t_1; elseif (x <= -1.7e-301) tmp = t_2; elseif (x <= 9e-217) tmp = Float64(log(t) - z); elseif (x <= 1.9e+61) 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 = log(t) - y; tmp = 0.0; if (x <= -300000000000.0) tmp = t_1; elseif (x <= -1.7e-301) tmp = t_2; elseif (x <= 9e-217) tmp = log(t) - z; elseif (x <= 1.9e+61) 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[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -300000000000.0], t$95$1, If[LessEqual[x, -1.7e-301], t$95$2, If[LessEqual[x, 9e-217], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 1.9e+61], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -300000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-301}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-217}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3e11 or 1.89999999999999998e61 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around inf 69.4%
if -3e11 < x < -1.7000000000000001e-301 or 8.9999999999999997e-217 < x < 1.89999999999999998e61Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 98.3%
Taylor expanded in z around 0 66.0%
if -1.7000000000000001e-301 < x < 8.9999999999999997e-217Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in y around 0 79.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -2.5e+14)
t_1
(if (<= x -1.08e-301)
t_2
(if (<= x 4.3e-257) (- z) (if (<= x 4.2e+61) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - y;
double tmp;
if (x <= -2.5e+14) {
tmp = t_1;
} else if (x <= -1.08e-301) {
tmp = t_2;
} else if (x <= 4.3e-257) {
tmp = -z;
} else if (x <= 4.2e+61) {
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 = log(t) - y
if (x <= (-2.5d+14)) then
tmp = t_1
else if (x <= (-1.08d-301)) then
tmp = t_2
else if (x <= 4.3d-257) then
tmp = -z
else if (x <= 4.2d+61) 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 = Math.log(t) - y;
double tmp;
if (x <= -2.5e+14) {
tmp = t_1;
} else if (x <= -1.08e-301) {
tmp = t_2;
} else if (x <= 4.3e-257) {
tmp = -z;
} else if (x <= 4.2e+61) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - y tmp = 0 if x <= -2.5e+14: tmp = t_1 elif x <= -1.08e-301: tmp = t_2 elif x <= 4.3e-257: tmp = -z elif x <= 4.2e+61: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - y) tmp = 0.0 if (x <= -2.5e+14) tmp = t_1; elseif (x <= -1.08e-301) tmp = t_2; elseif (x <= 4.3e-257) tmp = Float64(-z); elseif (x <= 4.2e+61) 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 = log(t) - y; tmp = 0.0; if (x <= -2.5e+14) tmp = t_1; elseif (x <= -1.08e-301) tmp = t_2; elseif (x <= 4.3e-257) tmp = -z; elseif (x <= 4.2e+61) 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[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -2.5e+14], t$95$1, If[LessEqual[x, -1.08e-301], t$95$2, If[LessEqual[x, 4.3e-257], (-z), If[LessEqual[x, 4.2e+61], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.08 \cdot 10^{-301}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-257}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.5e14 or 4.2000000000000002e61 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around inf 69.4%
if -2.5e14 < x < -1.08000000000000002e-301 or 4.29999999999999998e-257 < x < 4.2000000000000002e61Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 98.4%
Taylor expanded in z around 0 65.8%
if -1.08000000000000002e-301 < x < 4.29999999999999998e-257Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= z -3e+68)
(- z)
(if (<= z -1.56e-155)
t_1
(if (<= z -5.4e-183)
(- y)
(if (<= z -2.2e-299) t_1 (if (<= z 2e+120) (- y) (- z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (z <= -3e+68) {
tmp = -z;
} else if (z <= -1.56e-155) {
tmp = t_1;
} else if (z <= -5.4e-183) {
tmp = -y;
} else if (z <= -2.2e-299) {
tmp = t_1;
} else if (z <= 2e+120) {
tmp = -y;
} else {
tmp = -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 (z <= (-3d+68)) then
tmp = -z
else if (z <= (-1.56d-155)) then
tmp = t_1
else if (z <= (-5.4d-183)) then
tmp = -y
else if (z <= (-2.2d-299)) then
tmp = t_1
else if (z <= 2d+120) then
tmp = -y
else
tmp = -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 (z <= -3e+68) {
tmp = -z;
} else if (z <= -1.56e-155) {
tmp = t_1;
} else if (z <= -5.4e-183) {
tmp = -y;
} else if (z <= -2.2e-299) {
tmp = t_1;
} else if (z <= 2e+120) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if z <= -3e+68: tmp = -z elif z <= -1.56e-155: tmp = t_1 elif z <= -5.4e-183: tmp = -y elif z <= -2.2e-299: tmp = t_1 elif z <= 2e+120: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (z <= -3e+68) tmp = Float64(-z); elseif (z <= -1.56e-155) tmp = t_1; elseif (z <= -5.4e-183) tmp = Float64(-y); elseif (z <= -2.2e-299) tmp = t_1; elseif (z <= 2e+120) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (z <= -3e+68) tmp = -z; elseif (z <= -1.56e-155) tmp = t_1; elseif (z <= -5.4e-183) tmp = -y; elseif (z <= -2.2e-299) tmp = t_1; elseif (z <= 2e+120) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+68], (-z), If[LessEqual[z, -1.56e-155], t$95$1, If[LessEqual[z, -5.4e-183], (-y), If[LessEqual[z, -2.2e-299], t$95$1, If[LessEqual[z, 2e+120], (-y), (-z)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -3 \cdot 10^{+68}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -1.56 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-183}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-299}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+120}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -3.0000000000000002e68 or 2e120 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 79.2%
mul-1-neg79.2%
Simplified79.2%
if -3.0000000000000002e68 < z < -1.56e-155 or -5.40000000000000016e-183 < z < -2.2e-299Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 51.5%
if -1.56e-155 < z < -5.40000000000000016e-183 or -2.2e-299 < z < 2e120Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 47.3%
mul-1-neg47.3%
Simplified47.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -15000000.0) (not (<= x 2.6e-21))) (- (* x (log y)) (+ y z)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -15000000.0) || !(x <= 2.6e-21)) {
tmp = (x * log(y)) - (y + 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) :: tmp
if ((x <= (-15000000.0d0)) .or. (.not. (x <= 2.6d-21))) then
tmp = (x * log(y)) - (y + 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 tmp;
if ((x <= -15000000.0) || !(x <= 2.6e-21)) {
tmp = (x * Math.log(y)) - (y + z);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -15000000.0) or not (x <= 2.6e-21): tmp = (x * math.log(y)) - (y + z) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -15000000.0) || !(x <= 2.6e-21)) tmp = Float64(Float64(x * log(y)) - Float64(y + z)); 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 <= -15000000.0) || ~((x <= 2.6e-21))) tmp = (x * log(y)) - (y + z); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -15000000.0], N[Not[LessEqual[x, 2.6e-21]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -15000000 \lor \neg \left(x \leq 2.6 \cdot 10^{-21}\right):\\
\;\;\;\;x \cdot \log y - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.5e7 or 2.60000000000000017e-21 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
if -1.5e7 < x < 2.60000000000000017e-21Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.8%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8e+65) (not (<= x 8.2e+60))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8e+65) || !(x <= 8.2e+60)) {
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 <= (-8d+65)) .or. (.not. (x <= 8.2d+60))) 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 <= -8e+65) || !(x <= 8.2e+60)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8e+65) or not (x <= 8.2e+60): 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 <= -8e+65) || !(x <= 8.2e+60)) 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 <= -8e+65) || ~((x <= 8.2e+60))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8e+65], N[Not[LessEqual[x, 8.2e+60]], $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 \cdot 10^{+65} \lor \neg \left(x \leq 8.2 \cdot 10^{+60}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -7.9999999999999999e65 or 8.2e60 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around inf 72.9%
if -7.9999999999999999e65 < x < 8.2e60Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 96.3%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (<= z -0.023) (- z) (if (<= z -4.5e-66) (log t) (if (<= z 1.6e+118) (- y) (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.023) {
tmp = -z;
} else if (z <= -4.5e-66) {
tmp = log(t);
} else if (z <= 1.6e+118) {
tmp = -y;
} else {
tmp = -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 (z <= (-0.023d0)) then
tmp = -z
else if (z <= (-4.5d-66)) then
tmp = log(t)
else if (z <= 1.6d+118) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.023) {
tmp = -z;
} else if (z <= -4.5e-66) {
tmp = Math.log(t);
} else if (z <= 1.6e+118) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.023: tmp = -z elif z <= -4.5e-66: tmp = math.log(t) elif z <= 1.6e+118: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.023) tmp = Float64(-z); elseif (z <= -4.5e-66) tmp = log(t); elseif (z <= 1.6e+118) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.023) tmp = -z; elseif (z <= -4.5e-66) tmp = log(t); elseif (z <= 1.6e+118) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.023], (-z), If[LessEqual[z, -4.5e-66], N[Log[t], $MachinePrecision], If[LessEqual[z, 1.6e+118], (-y), (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.023:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-66}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+118}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -0.023 or 1.60000000000000008e118 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 69.7%
mul-1-neg69.7%
Simplified69.7%
if -0.023 < z < -4.4999999999999998e-66Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in x around 0 56.7%
Taylor expanded in y around 0 46.5%
Taylor expanded in z around 0 44.6%
if -4.4999999999999998e-66 < z < 1.60000000000000008e118Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 42.3%
mul-1-neg42.3%
Simplified42.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.95e+30) (not (<= z 2.15e+120))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e+30) || !(z <= 2.15e+120)) {
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 ((z <= (-1.95d+30)) .or. (.not. (z <= 2.15d+120))) 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 ((z <= -1.95e+30) || !(z <= 2.15e+120)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.95e+30) or not (z <= 2.15e+120): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.95e+30) || !(z <= 2.15e+120)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.95e+30) || ~((z <= 2.15e+120))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.95e+30], N[Not[LessEqual[z, 2.15e+120]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+30} \lor \neg \left(z \leq 2.15 \cdot 10^{+120}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -1.95000000000000005e30 or 2.1500000000000001e120 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 73.6%
mul-1-neg73.6%
Simplified73.6%
if -1.95000000000000005e30 < z < 2.1500000000000001e120Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 38.3%
mul-1-neg38.3%
Simplified38.3%
Final simplification49.6%
(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%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 30.0%
mul-1-neg30.0%
Simplified30.0%
(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 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%
associate--l-99.8%
Simplified99.8%
*-commutative99.8%
add-cube-cbrt99.4%
associate-*r*99.4%
fma-neg99.4%
pow299.4%
associate-+r-99.4%
Applied egg-rr99.4%
add-sqr-sqrt38.5%
pow238.5%
Applied egg-rr16.5%
Taylor expanded in y around inf 2.4%
herbie shell --seed 2024100
(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)))