
(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 9 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.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.02e+141) (not (<= z 3.8e+50))) (- (- (log t) y) z) (- (+ (* x (log y)) (log t)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e+141) || !(z <= 3.8e+50)) {
tmp = (log(t) - y) - z;
} else {
tmp = ((x * log(y)) + 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 <= (-1.02d+141)) .or. (.not. (z <= 3.8d+50))) then
tmp = (log(t) - y) - z
else
tmp = ((x * log(y)) + 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 <= -1.02e+141) || !(z <= 3.8e+50)) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = ((x * Math.log(y)) + Math.log(t)) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.02e+141) or not (z <= 3.8e+50): tmp = (math.log(t) - y) - z else: tmp = ((x * math.log(y)) + math.log(t)) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.02e+141) || !(z <= 3.8e+50)) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.02e+141) || ~((z <= 3.8e+50))) tmp = (log(t) - y) - z; else tmp = ((x * log(y)) + log(t)) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.02e+141], N[Not[LessEqual[z, 3.8e+50]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+141} \lor \neg \left(z \leq 3.8 \cdot 10^{+50}\right):\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - y\\
\end{array}
\end{array}
if z < -1.02e141 or 3.79999999999999987e50 < z Initial program 100.0%
Taylor expanded in x around 0 85.2%
associate--r+85.2%
Simplified85.2%
if -1.02e141 < z < 3.79999999999999987e50Initial program 99.8%
Taylor expanded in z around 0 94.8%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (if (<= y 5.1e+92) (- (+ (* x (log y)) (log t)) z) (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.1e+92) {
tmp = ((x * log(y)) + log(t)) - 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 <= 5.1d+92) then
tmp = ((x * log(y)) + log(t)) - 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 <= 5.1e+92) {
tmp = ((x * Math.log(y)) + Math.log(t)) - z;
} else {
tmp = (Math.log(t) - y) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 5.1e+92: tmp = ((x * math.log(y)) + math.log(t)) - z else: tmp = (math.log(t) - y) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 5.1e+92) tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - z); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 5.1e+92) tmp = ((x * log(y)) + log(t)) - z; else tmp = (log(t) - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 5.1e+92], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.1 \cdot 10^{+92}:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if y < 5.1000000000000003e92Initial program 99.9%
Taylor expanded in y around 0 93.2%
if 5.1000000000000003e92 < y Initial program 99.9%
Taylor expanded in x around 0 90.7%
associate--r+90.7%
Simplified90.7%
Final simplification92.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -6e+150)
(- z)
(if (<= z -1.25e-21)
(- y)
(if (<= z -2.9e-249)
(log t)
(if (<= z 2.9e-227)
(- y)
(if (<= z 1.35e+69)
(* x (log y))
(if (<= z 1.3e+154) (- y) (- z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6e+150) {
tmp = -z;
} else if (z <= -1.25e-21) {
tmp = -y;
} else if (z <= -2.9e-249) {
tmp = log(t);
} else if (z <= 2.9e-227) {
tmp = -y;
} else if (z <= 1.35e+69) {
tmp = x * log(y);
} else if (z <= 1.3e+154) {
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 <= (-6d+150)) then
tmp = -z
else if (z <= (-1.25d-21)) then
tmp = -y
else if (z <= (-2.9d-249)) then
tmp = log(t)
else if (z <= 2.9d-227) then
tmp = -y
else if (z <= 1.35d+69) then
tmp = x * log(y)
else if (z <= 1.3d+154) 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 <= -6e+150) {
tmp = -z;
} else if (z <= -1.25e-21) {
tmp = -y;
} else if (z <= -2.9e-249) {
tmp = Math.log(t);
} else if (z <= 2.9e-227) {
tmp = -y;
} else if (z <= 1.35e+69) {
tmp = x * Math.log(y);
} else if (z <= 1.3e+154) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6e+150: tmp = -z elif z <= -1.25e-21: tmp = -y elif z <= -2.9e-249: tmp = math.log(t) elif z <= 2.9e-227: tmp = -y elif z <= 1.35e+69: tmp = x * math.log(y) elif z <= 1.3e+154: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6e+150) tmp = Float64(-z); elseif (z <= -1.25e-21) tmp = Float64(-y); elseif (z <= -2.9e-249) tmp = log(t); elseif (z <= 2.9e-227) tmp = Float64(-y); elseif (z <= 1.35e+69) tmp = Float64(x * log(y)); elseif (z <= 1.3e+154) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6e+150) tmp = -z; elseif (z <= -1.25e-21) tmp = -y; elseif (z <= -2.9e-249) tmp = log(t); elseif (z <= 2.9e-227) tmp = -y; elseif (z <= 1.35e+69) tmp = x * log(y); elseif (z <= 1.3e+154) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6e+150], (-z), If[LessEqual[z, -1.25e-21], (-y), If[LessEqual[z, -2.9e-249], N[Log[t], $MachinePrecision], If[LessEqual[z, 2.9e-227], (-y), If[LessEqual[z, 1.35e+69], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+154], (-y), (-z)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+150}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-21}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-249}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-227}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+69}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -6.00000000000000025e150 or 1.29999999999999994e154 < z Initial program 100.0%
Taylor expanded in z around inf 83.1%
mul-1-neg83.1%
Simplified83.1%
if -6.00000000000000025e150 < z < -1.24999999999999993e-21 or -2.90000000000000022e-249 < z < 2.90000000000000011e-227 or 1.3499999999999999e69 < z < 1.29999999999999994e154Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
*-commutative99.9%
add-cube-cbrt99.5%
associate-*r*99.5%
fma-define99.5%
pow299.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 52.3%
neg-mul-152.3%
Simplified52.3%
if -1.24999999999999993e-21 < z < -2.90000000000000022e-249Initial program 99.8%
Taylor expanded in x around 0 65.8%
associate--r+65.8%
Simplified65.8%
Taylor expanded in y around 0 43.5%
Taylor expanded in z around 0 43.5%
if 2.90000000000000011e-227 < z < 1.3499999999999999e69Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
*-commutative99.8%
add-cube-cbrt98.9%
associate-*r*99.0%
fma-define99.0%
pow299.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 41.2%
Final simplification56.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.5e+150)
(- z)
(if (<= z -6e-20)
(- y)
(if (<= z -6.6e-250)
(log t)
(if (<= z 1.8e-214)
(- y)
(if (<= z 10500000000000.0)
(log t)
(if (<= z 1.3e+154) (- y) (- z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+150) {
tmp = -z;
} else if (z <= -6e-20) {
tmp = -y;
} else if (z <= -6.6e-250) {
tmp = log(t);
} else if (z <= 1.8e-214) {
tmp = -y;
} else if (z <= 10500000000000.0) {
tmp = log(t);
} else if (z <= 1.3e+154) {
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 <= (-5.5d+150)) then
tmp = -z
else if (z <= (-6d-20)) then
tmp = -y
else if (z <= (-6.6d-250)) then
tmp = log(t)
else if (z <= 1.8d-214) then
tmp = -y
else if (z <= 10500000000000.0d0) then
tmp = log(t)
else if (z <= 1.3d+154) 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 <= -5.5e+150) {
tmp = -z;
} else if (z <= -6e-20) {
tmp = -y;
} else if (z <= -6.6e-250) {
tmp = Math.log(t);
} else if (z <= 1.8e-214) {
tmp = -y;
} else if (z <= 10500000000000.0) {
tmp = Math.log(t);
} else if (z <= 1.3e+154) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e+150: tmp = -z elif z <= -6e-20: tmp = -y elif z <= -6.6e-250: tmp = math.log(t) elif z <= 1.8e-214: tmp = -y elif z <= 10500000000000.0: tmp = math.log(t) elif z <= 1.3e+154: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+150) tmp = Float64(-z); elseif (z <= -6e-20) tmp = Float64(-y); elseif (z <= -6.6e-250) tmp = log(t); elseif (z <= 1.8e-214) tmp = Float64(-y); elseif (z <= 10500000000000.0) tmp = log(t); elseif (z <= 1.3e+154) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.5e+150) tmp = -z; elseif (z <= -6e-20) tmp = -y; elseif (z <= -6.6e-250) tmp = log(t); elseif (z <= 1.8e-214) tmp = -y; elseif (z <= 10500000000000.0) tmp = log(t); elseif (z <= 1.3e+154) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+150], (-z), If[LessEqual[z, -6e-20], (-y), If[LessEqual[z, -6.6e-250], N[Log[t], $MachinePrecision], If[LessEqual[z, 1.8e-214], (-y), If[LessEqual[z, 10500000000000.0], N[Log[t], $MachinePrecision], If[LessEqual[z, 1.3e+154], (-y), (-z)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+150}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-20}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-250}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-214}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 10500000000000:\\
\;\;\;\;\log t\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -5.50000000000000017e150 or 1.29999999999999994e154 < z Initial program 100.0%
Taylor expanded in z around inf 83.1%
mul-1-neg83.1%
Simplified83.1%
if -5.50000000000000017e150 < z < -6.00000000000000057e-20 or -6.6e-250 < z < 1.8e-214 or 1.05e13 < z < 1.29999999999999994e154Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
*-commutative99.8%
add-cube-cbrt99.4%
associate-*r*99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 50.5%
neg-mul-150.5%
Simplified50.5%
if -6.00000000000000057e-20 < z < -6.6e-250 or 1.8e-214 < z < 1.05e13Initial program 99.8%
Taylor expanded in x around 0 62.3%
associate--r+62.3%
Simplified62.3%
Taylor expanded in y around 0 40.7%
Taylor expanded in z around 0 40.7%
Final simplification55.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.12e+167) (not (<= x 1.92e+115))) (* x (log y)) (- (- (log t) y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.12e+167) || !(x <= 1.92e+115)) {
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.12d+167)) .or. (.not. (x <= 1.92d+115))) 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.12e+167) || !(x <= 1.92e+115)) {
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.12e+167) or not (x <= 1.92e+115): 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.12e+167) || !(x <= 1.92e+115)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.12e+167) || ~((x <= 1.92e+115))) 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.12e+167], N[Not[LessEqual[x, 1.92e+115]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+167} \lor \neg \left(x \leq 1.92 \cdot 10^{+115}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\end{array}
\end{array}
if x < -1.11999999999999999e167 or 1.92e115 < x Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
associate--l+99.7%
*-commutative99.7%
add-cube-cbrt98.4%
associate-*r*98.5%
fma-define98.5%
pow298.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 78.2%
if -1.11999999999999999e167 < x < 1.92e115Initial program 99.9%
Taylor expanded in x around 0 92.1%
associate--r+92.1%
Simplified92.1%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.5e+150) (not (<= z 1.3e+154))) (- z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+150) || !(z <= 1.3e+154)) {
tmp = -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 <= (-5.5d+150)) .or. (.not. (z <= 1.3d+154))) then
tmp = -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 <= -5.5e+150) || !(z <= 1.3e+154)) {
tmp = -z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.5e+150) or not (z <= 1.3e+154): tmp = -z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e+150) || !(z <= 1.3e+154)) tmp = Float64(-z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.5e+150) || ~((z <= 1.3e+154))) tmp = -z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e+150], N[Not[LessEqual[z, 1.3e+154]], $MachinePrecision]], (-z), N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+150} \lor \neg \left(z \leq 1.3 \cdot 10^{+154}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -5.50000000000000017e150 or 1.29999999999999994e154 < z Initial program 100.0%
Taylor expanded in z around inf 83.1%
mul-1-neg83.1%
Simplified83.1%
if -5.50000000000000017e150 < z < 1.29999999999999994e154Initial program 99.8%
Taylor expanded in z around 0 90.5%
Taylor expanded in x around 0 56.8%
Final simplification63.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.5e+150) (not (<= z 1.3e+154))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+150) || !(z <= 1.3e+154)) {
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 <= (-5.5d+150)) .or. (.not. (z <= 1.3d+154))) 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 <= -5.5e+150) || !(z <= 1.3e+154)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.5e+150) or not (z <= 1.3e+154): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e+150) || !(z <= 1.3e+154)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.5e+150) || ~((z <= 1.3e+154))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e+150], N[Not[LessEqual[z, 1.3e+154]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+150} \lor \neg \left(z \leq 1.3 \cdot 10^{+154}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -5.50000000000000017e150 or 1.29999999999999994e154 < z Initial program 100.0%
Taylor expanded in z around inf 83.1%
mul-1-neg83.1%
Simplified83.1%
if -5.50000000000000017e150 < z < 1.29999999999999994e154Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
*-commutative99.8%
add-cube-cbrt99.2%
associate-*r*99.2%
fma-define99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in y around inf 37.8%
neg-mul-137.8%
Simplified37.8%
Final simplification49.9%
(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%
sub-neg99.9%
associate--l+99.9%
*-commutative99.9%
add-cube-cbrt99.4%
associate-*r*99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 29.2%
neg-mul-129.2%
Simplified29.2%
Final simplification29.2%
herbie shell --seed 2024115
(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)))