
(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 10 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%
+-commutative99.8%
associate--l-99.8%
associate-+r-99.8%
+-commutative99.8%
associate--l+99.8%
fma-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.8e+70) (not (<= x 1.9e+133))) (- (+ (log t) (* x (log y))) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.8e+70) || !(x <= 1.9e+133)) {
tmp = (log(t) + (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 <= (-4.8d+70)) .or. (.not. (x <= 1.9d+133))) then
tmp = (log(t) + (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 <= -4.8e+70) || !(x <= 1.9e+133)) {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.8e+70) or not (x <= 1.9e+133): tmp = (math.log(t) + (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 <= -4.8e+70) || !(x <= 1.9e+133)) tmp = Float64(Float64(log(t) + 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 <= -4.8e+70) || ~((x <= 1.9e+133))) tmp = (log(t) + (x * log(y))) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.8e+70], N[Not[LessEqual[x, 1.9e+133]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+70} \lor \neg \left(x \leq 1.9 \cdot 10^{+133}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -4.79999999999999974e70 or 1.9000000000000001e133 < x Initial program 99.5%
Taylor expanded in z around 0 85.7%
if -4.79999999999999974e70 < x < 1.9000000000000001e133Initial program 99.9%
Taylor expanded in x around 0 93.5%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (if (<= y 2.1e+140) (- (+ (log t) (* x (log y))) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1e+140) {
tmp = (log(t) + (x * log(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 (y <= 2.1d+140) then
tmp = (log(t) + (x * log(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 (y <= 2.1e+140) {
tmp = (Math.log(t) + (x * Math.log(y))) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.1e+140: tmp = (math.log(t) + (x * math.log(y))) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.1e+140) tmp = Float64(Float64(log(t) + Float64(x * log(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 (y <= 2.1e+140) tmp = (log(t) + (x * log(y))) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.1e+140], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{+140}:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if y < 2.1000000000000002e140Initial program 99.8%
Taylor expanded in y around 0 91.9%
if 2.1000000000000002e140 < y Initial program 100.0%
Taylor expanded in x around 0 94.3%
Final simplification92.5%
(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
(let* ((t_1 (* x (log y))))
(if (<= z -5400000.0)
(- z)
(if (<= z -1.42e-70)
(- y)
(if (<= z -6.8e-186)
t_1
(if (<= z -4.5e-231)
(- y)
(if (<= z -4.3e-285) t_1 (if (<= z 1.595e+35) (- y) (- z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (z <= -5400000.0) {
tmp = -z;
} else if (z <= -1.42e-70) {
tmp = -y;
} else if (z <= -6.8e-186) {
tmp = t_1;
} else if (z <= -4.5e-231) {
tmp = -y;
} else if (z <= -4.3e-285) {
tmp = t_1;
} else if (z <= 1.595e+35) {
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 <= (-5400000.0d0)) then
tmp = -z
else if (z <= (-1.42d-70)) then
tmp = -y
else if (z <= (-6.8d-186)) then
tmp = t_1
else if (z <= (-4.5d-231)) then
tmp = -y
else if (z <= (-4.3d-285)) then
tmp = t_1
else if (z <= 1.595d+35) 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 <= -5400000.0) {
tmp = -z;
} else if (z <= -1.42e-70) {
tmp = -y;
} else if (z <= -6.8e-186) {
tmp = t_1;
} else if (z <= -4.5e-231) {
tmp = -y;
} else if (z <= -4.3e-285) {
tmp = t_1;
} else if (z <= 1.595e+35) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if z <= -5400000.0: tmp = -z elif z <= -1.42e-70: tmp = -y elif z <= -6.8e-186: tmp = t_1 elif z <= -4.5e-231: tmp = -y elif z <= -4.3e-285: tmp = t_1 elif z <= 1.595e+35: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (z <= -5400000.0) tmp = Float64(-z); elseif (z <= -1.42e-70) tmp = Float64(-y); elseif (z <= -6.8e-186) tmp = t_1; elseif (z <= -4.5e-231) tmp = Float64(-y); elseif (z <= -4.3e-285) tmp = t_1; elseif (z <= 1.595e+35) 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 <= -5400000.0) tmp = -z; elseif (z <= -1.42e-70) tmp = -y; elseif (z <= -6.8e-186) tmp = t_1; elseif (z <= -4.5e-231) tmp = -y; elseif (z <= -4.3e-285) tmp = t_1; elseif (z <= 1.595e+35) 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, -5400000.0], (-z), If[LessEqual[z, -1.42e-70], (-y), If[LessEqual[z, -6.8e-186], t$95$1, If[LessEqual[z, -4.5e-231], (-y), If[LessEqual[z, -4.3e-285], t$95$1, If[LessEqual[z, 1.595e+35], (-y), (-z)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -5400000:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-70}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-186}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -5.4e6 or 1.595e35 < z Initial program 99.9%
Taylor expanded in z around inf 67.1%
neg-mul-167.1%
Simplified67.1%
if -5.4e6 < z < -1.42000000000000002e-70 or -6.7999999999999999e-186 < z < -4.4999999999999998e-231 or -4.30000000000000011e-285 < z < 1.595e35Initial program 99.8%
Taylor expanded in y around inf 53.7%
mul-1-neg53.7%
Simplified53.7%
if -1.42000000000000002e-70 < z < -6.7999999999999999e-186 or -4.4999999999999998e-231 < z < -4.30000000000000011e-285Initial program 99.6%
associate--l-99.6%
associate-+l-99.6%
add-cube-cbrt99.2%
associate-*r*99.2%
fma-neg99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in x around inf 54.5%
pow-base-154.5%
*-lft-identity54.5%
Simplified54.5%
Final simplification60.7%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.16e+218)
(and (not (<= x -5.2e+175))
(or (<= x -1.22e+89) (not (<= x 2.2e+130)))))
(* x (log y))
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.16e+218) || (!(x <= -5.2e+175) && ((x <= -1.22e+89) || !(x <= 2.2e+130)))) {
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.16d+218)) .or. (.not. (x <= (-5.2d+175))) .and. (x <= (-1.22d+89)) .or. (.not. (x <= 2.2d+130))) 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.16e+218) || (!(x <= -5.2e+175) && ((x <= -1.22e+89) || !(x <= 2.2e+130)))) {
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.16e+218) or (not (x <= -5.2e+175) and ((x <= -1.22e+89) or not (x <= 2.2e+130))): 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.16e+218) || (!(x <= -5.2e+175) && ((x <= -1.22e+89) || !(x <= 2.2e+130)))) 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.16e+218) || (~((x <= -5.2e+175)) && ((x <= -1.22e+89) || ~((x <= 2.2e+130))))) 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.16e+218], And[N[Not[LessEqual[x, -5.2e+175]], $MachinePrecision], Or[LessEqual[x, -1.22e+89], N[Not[LessEqual[x, 2.2e+130]], $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.16 \cdot 10^{+218} \lor \neg \left(x \leq -5.2 \cdot 10^{+175}\right) \land \left(x \leq -1.22 \cdot 10^{+89} \lor \neg \left(x \leq 2.2 \cdot 10^{+130}\right)\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.15999999999999994e218 or -5.2000000000000001e175 < x < -1.22e89 or 2.19999999999999993e130 < x Initial program 99.5%
associate--l-99.5%
associate-+l-99.5%
add-cube-cbrt98.5%
associate-*r*98.6%
fma-neg98.6%
pow298.6%
Applied egg-rr98.6%
Taylor expanded in x around inf 80.3%
pow-base-180.3%
*-lft-identity80.3%
Simplified80.3%
if -1.15999999999999994e218 < x < -5.2000000000000001e175 or -1.22e89 < x < 2.19999999999999993e130Initial program 99.9%
Taylor expanded in x around 0 92.1%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)))
(if (<= z -5400000.0)
(- z)
(if (<= z -3.8e-231)
t_1
(if (<= z -6.4e-277) (* x (log y)) (if (<= z 1.595e+35) t_1 (- z)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if (z <= -5400000.0) {
tmp = -z;
} else if (z <= -3.8e-231) {
tmp = t_1;
} else if (z <= -6.4e-277) {
tmp = x * log(y);
} else if (z <= 1.595e+35) {
tmp = t_1;
} 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 = log(t) - y
if (z <= (-5400000.0d0)) then
tmp = -z
else if (z <= (-3.8d-231)) then
tmp = t_1
else if (z <= (-6.4d-277)) then
tmp = x * log(y)
else if (z <= 1.595d+35) then
tmp = t_1
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - y;
double tmp;
if (z <= -5400000.0) {
tmp = -z;
} else if (z <= -3.8e-231) {
tmp = t_1;
} else if (z <= -6.4e-277) {
tmp = x * Math.log(y);
} else if (z <= 1.595e+35) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y tmp = 0 if z <= -5400000.0: tmp = -z elif z <= -3.8e-231: tmp = t_1 elif z <= -6.4e-277: tmp = x * math.log(y) elif z <= 1.595e+35: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) tmp = 0.0 if (z <= -5400000.0) tmp = Float64(-z); elseif (z <= -3.8e-231) tmp = t_1; elseif (z <= -6.4e-277) tmp = Float64(x * log(y)); elseif (z <= 1.595e+35) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; tmp = 0.0; if (z <= -5400000.0) tmp = -z; elseif (z <= -3.8e-231) tmp = t_1; elseif (z <= -6.4e-277) tmp = x * log(y); elseif (z <= 1.595e+35) tmp = t_1; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -5400000.0], (-z), If[LessEqual[z, -3.8e-231], t$95$1, If[LessEqual[z, -6.4e-277], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.595e+35], t$95$1, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -5400000:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-277}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -5.4e6 or 1.595e35 < z Initial program 99.9%
Taylor expanded in z around inf 67.1%
neg-mul-167.1%
Simplified67.1%
if -5.4e6 < z < -3.80000000000000013e-231 or -6.3999999999999996e-277 < z < 1.595e35Initial program 99.8%
Taylor expanded in z around 0 97.6%
Taylor expanded in x around 0 67.0%
if -3.80000000000000013e-231 < z < -6.3999999999999996e-277Initial program 99.6%
associate--l-99.6%
associate-+l-99.6%
add-cube-cbrt98.8%
associate-*r*98.3%
fma-neg98.3%
pow298.3%
Applied egg-rr98.3%
Taylor expanded in x around inf 82.8%
pow-base-182.8%
*-lft-identity82.8%
Simplified82.8%
Final simplification67.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)))
(if (<= y 3.4e-189)
t_1
(if (<= y 4.8e-182) (* x (log y)) (if (<= y 1.4e+165) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double tmp;
if (y <= 3.4e-189) {
tmp = t_1;
} else if (y <= 4.8e-182) {
tmp = x * log(y);
} else if (y <= 1.4e+165) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = log(t) - z
if (y <= 3.4d-189) then
tmp = t_1
else if (y <= 4.8d-182) then
tmp = x * log(y)
else if (y <= 1.4d+165) then
tmp = t_1
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - z;
double tmp;
if (y <= 3.4e-189) {
tmp = t_1;
} else if (y <= 4.8e-182) {
tmp = x * Math.log(y);
} else if (y <= 1.4e+165) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z tmp = 0 if y <= 3.4e-189: tmp = t_1 elif y <= 4.8e-182: tmp = x * math.log(y) elif y <= 1.4e+165: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) tmp = 0.0 if (y <= 3.4e-189) tmp = t_1; elseif (y <= 4.8e-182) tmp = Float64(x * log(y)); elseif (y <= 1.4e+165) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; tmp = 0.0; if (y <= 3.4e-189) tmp = t_1; elseif (y <= 4.8e-182) tmp = x * log(y); elseif (y <= 1.4e+165) tmp = t_1; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 3.4e-189], t$95$1, If[LessEqual[y, 4.8e-182], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+165], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 3.4 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-182}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.4000000000000001e-189 or 4.7999999999999997e-182 < y < 1.3999999999999999e165Initial program 99.8%
Taylor expanded in y around 0 90.0%
Taylor expanded in x around 0 60.7%
if 3.4000000000000001e-189 < y < 4.7999999999999997e-182Initial program 99.1%
associate--l-99.1%
associate-+l-99.1%
add-cube-cbrt98.1%
associate-*r*98.1%
fma-neg98.1%
pow298.1%
Applied egg-rr98.1%
Taylor expanded in x around inf 99.1%
pow-base-199.1%
*-lft-identity99.1%
Simplified99.1%
if 1.3999999999999999e165 < y Initial program 99.9%
Taylor expanded in y around inf 88.0%
mul-1-neg88.0%
Simplified88.0%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (<= z -5400000.0) (- z) (if (<= z 1.595e+35) (- y) (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5400000.0) {
tmp = -z;
} else if (z <= 1.595e+35) {
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 <= (-5400000.0d0)) then
tmp = -z
else if (z <= 1.595d+35) 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 <= -5400000.0) {
tmp = -z;
} else if (z <= 1.595e+35) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5400000.0: tmp = -z elif z <= 1.595e+35: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5400000.0) tmp = Float64(-z); elseif (z <= 1.595e+35) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5400000.0) tmp = -z; elseif (z <= 1.595e+35) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5400000.0], (-z), If[LessEqual[z, 1.595e+35], (-y), (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5400000:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -5.4e6 or 1.595e35 < z Initial program 99.9%
Taylor expanded in z around inf 67.1%
neg-mul-167.1%
Simplified67.1%
if -5.4e6 < z < 1.595e35Initial program 99.7%
Taylor expanded in y around inf 42.9%
mul-1-neg42.9%
Simplified42.9%
Final simplification55.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.8%
Taylor expanded in y around inf 28.0%
mul-1-neg28.0%
Simplified28.0%
Final simplification28.0%
herbie shell --seed 2023187
(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)))