
(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.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2e+89) (not (<= z 1.15e+95))) (- (log t) (+ y z)) (- (+ (log t) (* x (log y))) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e+89) || !(z <= 1.15e+95)) {
tmp = log(t) - (y + z);
} else {
tmp = (log(t) + (x * log(y))) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2d+89)) .or. (.not. (z <= 1.15d+95))) then
tmp = log(t) - (y + z)
else
tmp = (log(t) + (x * log(y))) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e+89) || !(z <= 1.15e+95)) {
tmp = Math.log(t) - (y + z);
} else {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2e+89) or not (z <= 1.15e+95): tmp = math.log(t) - (y + z) else: tmp = (math.log(t) + (x * math.log(y))) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2e+89) || !(z <= 1.15e+95)) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2e+89) || ~((z <= 1.15e+95))) tmp = log(t) - (y + z); else tmp = (log(t) + (x * log(y))) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2e+89], N[Not[LessEqual[z, 1.15e+95]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+89} \lor \neg \left(z \leq 1.15 \cdot 10^{+95}\right):\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\end{array}
\end{array}
if z < -1.99999999999999999e89 or 1.14999999999999999e95 < z Initial program 99.9%
Taylor expanded in x around 0 85.3%
if -1.99999999999999999e89 < z < 1.14999999999999999e95Initial program 99.8%
Taylor expanded in z around 0 95.4%
Final simplification91.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (log t) (* x (log y)))))
(if (<= y 9e+80)
(- t_1 z)
(if (<= y 1.75e+183) (- (log t) (+ y z)) (- t_1 y)))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) + (x * log(y));
double tmp;
if (y <= 9e+80) {
tmp = t_1 - z;
} else if (y <= 1.75e+183) {
tmp = log(t) - (y + z);
} else {
tmp = t_1 - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) + (x * log(y))
if (y <= 9d+80) then
tmp = t_1 - z
else if (y <= 1.75d+183) then
tmp = log(t) - (y + z)
else
tmp = t_1 - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) + (x * Math.log(y));
double tmp;
if (y <= 9e+80) {
tmp = t_1 - z;
} else if (y <= 1.75e+183) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) + (x * math.log(y)) tmp = 0 if y <= 9e+80: tmp = t_1 - z elif y <= 1.75e+183: tmp = math.log(t) - (y + z) else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) + Float64(x * log(y))) tmp = 0.0 if (y <= 9e+80) tmp = Float64(t_1 - z); elseif (y <= 1.75e+183) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) + (x * log(y)); tmp = 0.0; if (y <= 9e+80) tmp = t_1 - z; elseif (y <= 1.75e+183) tmp = log(t) - (y + z); else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9e+80], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[y, 1.75e+183], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;y \leq 9 \cdot 10^{+80}:\\
\;\;\;\;t_1 - z\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+183}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if y < 9.00000000000000013e80Initial program 99.7%
Taylor expanded in y around 0 95.3%
if 9.00000000000000013e80 < y < 1.74999999999999994e183Initial program 100.0%
Taylor expanded in x around 0 91.5%
if 1.74999999999999994e183 < y Initial program 99.9%
Taylor expanded in z around 0 91.1%
Final simplification93.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= z -1.2e+94)
(- z)
(if (<= z -3.2e-40)
t_2
(if (<= z -3.2e-58)
t_1
(if (<= z 3.95e-10)
t_2
(if (<= z 2.4e+52) t_1 (if (<= z 1.08e+82) (- y) (- z)))))))))
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 (z <= -1.2e+94) {
tmp = -z;
} else if (z <= -3.2e-40) {
tmp = t_2;
} else if (z <= -3.2e-58) {
tmp = t_1;
} else if (z <= 3.95e-10) {
tmp = t_2;
} else if (z <= 2.4e+52) {
tmp = t_1;
} else if (z <= 1.08e+82) {
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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = log(t) - y
if (z <= (-1.2d+94)) then
tmp = -z
else if (z <= (-3.2d-40)) then
tmp = t_2
else if (z <= (-3.2d-58)) then
tmp = t_1
else if (z <= 3.95d-10) then
tmp = t_2
else if (z <= 2.4d+52) then
tmp = t_1
else if (z <= 1.08d+82) 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 t_2 = Math.log(t) - y;
double tmp;
if (z <= -1.2e+94) {
tmp = -z;
} else if (z <= -3.2e-40) {
tmp = t_2;
} else if (z <= -3.2e-58) {
tmp = t_1;
} else if (z <= 3.95e-10) {
tmp = t_2;
} else if (z <= 2.4e+52) {
tmp = t_1;
} else if (z <= 1.08e+82) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - y tmp = 0 if z <= -1.2e+94: tmp = -z elif z <= -3.2e-40: tmp = t_2 elif z <= -3.2e-58: tmp = t_1 elif z <= 3.95e-10: tmp = t_2 elif z <= 2.4e+52: tmp = t_1 elif z <= 1.08e+82: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - y) tmp = 0.0 if (z <= -1.2e+94) tmp = Float64(-z); elseif (z <= -3.2e-40) tmp = t_2; elseif (z <= -3.2e-58) tmp = t_1; elseif (z <= 3.95e-10) tmp = t_2; elseif (z <= 2.4e+52) tmp = t_1; elseif (z <= 1.08e+82) tmp = Float64(-y); else tmp = Float64(-z); 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 (z <= -1.2e+94) tmp = -z; elseif (z <= -3.2e-40) tmp = t_2; elseif (z <= -3.2e-58) tmp = t_1; elseif (z <= 3.95e-10) tmp = t_2; elseif (z <= 2.4e+52) tmp = t_1; elseif (z <= 1.08e+82) 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]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -1.2e+94], (-z), If[LessEqual[z, -3.2e-40], t$95$2, If[LessEqual[z, -3.2e-58], t$95$1, If[LessEqual[z, 3.95e-10], t$95$2, If[LessEqual[z, 2.4e+52], t$95$1, If[LessEqual[z, 1.08e+82], (-y), (-z)]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+94}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+82}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.19999999999999991e94 or 1.08e82 < z Initial program 99.9%
Taylor expanded in z around inf 67.2%
neg-mul-167.2%
Simplified67.2%
if -1.19999999999999991e94 < z < -3.20000000000000002e-40 or -3.2000000000000001e-58 < z < 3.9499999999999998e-10Initial program 99.8%
Taylor expanded in z around 0 97.0%
Taylor expanded in x around 0 63.1%
if -3.20000000000000002e-40 < z < -3.2000000000000001e-58 or 3.9499999999999998e-10 < z < 2.4e52Initial program 99.3%
associate--l-99.3%
associate-+l-99.3%
*-commutative99.3%
add-cube-cbrt98.6%
associate-*l*98.8%
fma-neg98.8%
pow298.8%
Applied egg-rr98.8%
*-commutative98.8%
sub-neg98.8%
log-rec98.8%
distribute-neg-in98.8%
log-rec98.8%
remove-double-neg98.8%
+-commutative98.8%
sub-neg98.8%
Simplified98.8%
Taylor expanded in x around inf 68.8%
pow-base-168.8%
*-lft-identity68.8%
Simplified68.8%
if 2.4e52 < z < 1.08e82Initial program 99.6%
Taylor expanded in y around inf 75.4%
neg-mul-175.4%
Simplified75.4%
Final simplification65.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= y 2.4e-198)
t_1
(if (<= y 3.9e+39) (- z) (if (<= y 2.5e+81) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 2.4e-198) {
tmp = t_1;
} else if (y <= 3.9e+39) {
tmp = -z;
} else if (y <= 2.5e+81) {
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 = x * log(y)
if (y <= 2.4d-198) then
tmp = t_1
else if (y <= 3.9d+39) then
tmp = -z
else if (y <= 2.5d+81) 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 = x * Math.log(y);
double tmp;
if (y <= 2.4e-198) {
tmp = t_1;
} else if (y <= 3.9e+39) {
tmp = -z;
} else if (y <= 2.5e+81) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 2.4e-198: tmp = t_1 elif y <= 3.9e+39: tmp = -z elif y <= 2.5e+81: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 2.4e-198) tmp = t_1; elseif (y <= 3.9e+39) tmp = Float64(-z); elseif (y <= 2.5e+81) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 2.4e-198) tmp = t_1; elseif (y <= 3.9e+39) tmp = -z; elseif (y <= 2.5e+81) tmp = t_1; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.4e-198], t$95$1, If[LessEqual[y, 3.9e+39], (-z), If[LessEqual[y, 2.5e+81], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 2.4 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+39}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.39999999999999986e-198 or 3.9000000000000001e39 < y < 2.4999999999999999e81Initial program 99.7%
associate--l-99.7%
associate-+l-99.7%
*-commutative99.7%
add-cube-cbrt99.1%
associate-*l*99.1%
fma-neg99.1%
pow299.1%
Applied egg-rr99.1%
*-commutative99.1%
sub-neg99.1%
log-rec99.1%
distribute-neg-in99.1%
log-rec99.1%
remove-double-neg99.1%
+-commutative99.1%
sub-neg99.1%
Simplified99.1%
Taylor expanded in x around inf 53.5%
pow-base-153.5%
*-lft-identity53.5%
Simplified53.5%
if 2.39999999999999986e-198 < y < 3.9000000000000001e39Initial program 99.8%
Taylor expanded in z around inf 43.3%
neg-mul-143.3%
Simplified43.3%
if 2.4999999999999999e81 < y Initial program 99.9%
Taylor expanded in y around inf 68.9%
neg-mul-168.9%
Simplified68.9%
Final simplification55.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5e+188) (not (<= x 6.1e+187))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.5e+188) || !(x <= 6.1e+187)) {
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 <= (-2.5d+188)) .or. (.not. (x <= 6.1d+187))) 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 <= -2.5e+188) || !(x <= 6.1e+187)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.5e+188) or not (x <= 6.1e+187): 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 <= -2.5e+188) || !(x <= 6.1e+187)) 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 <= -2.5e+188) || ~((x <= 6.1e+187))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5e+188], N[Not[LessEqual[x, 6.1e+187]], $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 -2.5 \cdot 10^{+188} \lor \neg \left(x \leq 6.1 \cdot 10^{+187}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.5000000000000001e188 or 6.0999999999999996e187 < x Initial program 99.5%
associate--l-99.5%
associate-+l-99.5%
*-commutative99.5%
add-cube-cbrt98.6%
associate-*l*98.6%
fma-neg98.6%
pow298.6%
Applied egg-rr98.6%
*-commutative98.6%
sub-neg98.6%
log-rec98.6%
distribute-neg-in98.6%
log-rec98.6%
remove-double-neg98.6%
+-commutative98.6%
sub-neg98.6%
Simplified98.6%
Taylor expanded in x around inf 76.3%
pow-base-176.3%
*-lft-identity76.3%
Simplified76.3%
if -2.5000000000000001e188 < x < 6.0999999999999996e187Initial program 99.9%
Taylor expanded in x around 0 83.9%
Final simplification82.4%
(FPCore (x y z t) :precision binary64 (if (<= y 6.2e+42) (- (log t) z) (if (<= y 1.6e+81) (* x (log y)) (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e+42) {
tmp = log(t) - z;
} else if (y <= 1.6e+81) {
tmp = x * log(y);
} 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 <= 6.2d+42) then
tmp = log(t) - z
else if (y <= 1.6d+81) then
tmp = x * log(y)
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 <= 6.2e+42) {
tmp = Math.log(t) - z;
} else if (y <= 1.6e+81) {
tmp = x * Math.log(y);
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.2e+42: tmp = math.log(t) - z elif y <= 1.6e+81: tmp = x * math.log(y) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.2e+42) tmp = Float64(log(t) - z); elseif (y <= 1.6e+81) tmp = Float64(x * log(y)); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.2e+42) tmp = log(t) - z; elseif (y <= 1.6e+81) tmp = x * log(y); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e+42], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.6e+81], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-y)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+42}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+81}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 6.2000000000000003e42Initial program 99.8%
Taylor expanded in y around 0 97.0%
Taylor expanded in x around 0 62.0%
if 6.2000000000000003e42 < y < 1.6e81Initial program 99.5%
associate--l-99.5%
associate-+l-99.5%
*-commutative99.5%
add-cube-cbrt99.0%
associate-*l*98.9%
fma-neg98.9%
pow298.9%
Applied egg-rr98.9%
*-commutative98.9%
sub-neg98.9%
log-rec98.9%
distribute-neg-in98.9%
log-rec98.9%
remove-double-neg98.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in x around inf 57.5%
pow-base-157.5%
*-lft-identity57.5%
Simplified57.5%
if 1.6e81 < y Initial program 99.9%
Taylor expanded in y around inf 68.9%
neg-mul-168.9%
Simplified68.9%
Final simplification64.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.05e+86) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.05e+86) {
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 <= 2.05d+86) 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 <= 2.05e+86) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.05e+86: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.05e+86) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.05e+86) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.05e+86], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.05 \cdot 10^{+86}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.05e86Initial program 99.7%
Taylor expanded in z around inf 37.4%
neg-mul-137.4%
Simplified37.4%
if 2.05e86 < y Initial program 99.9%
Taylor expanded in y around inf 70.2%
neg-mul-170.2%
Simplified70.2%
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%
Taylor expanded in y around inf 30.3%
neg-mul-130.3%
Simplified30.3%
Final simplification30.3%
herbie shell --seed 2023176
(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)))