
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (1.0d0 / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (1.0d0 / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
(FPCore (x y) :precision binary64 (- (+ 1.0 (/ (/ -1.0 x) 9.0)) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 + ((-1.0 / x) / 9.0)) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + (((-1.0d0) / x) / 9.0d0)) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 + ((-1.0 / x) / 9.0)) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 + ((-1.0 / x) / 9.0)) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 + ((-1.0 / x) / 9.0)) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + \frac{\frac{-1}{x}}{9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 99.6%
div-inv99.6%
add-sqr-sqrt99.6%
associate-*r*99.5%
inv-pow99.5%
sqrt-pow199.5%
metadata-eval99.5%
inv-pow99.5%
sqrt-pow199.5%
metadata-eval99.5%
Applied egg-rr99.5%
associate-*l*99.6%
metadata-eval99.6%
pow-prod-up99.6%
metadata-eval99.6%
unpow-prod-down99.7%
*-commutative99.7%
unpow-199.7%
associate-/r*99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -1.26e+40) (not (<= y 5.9e+44))) (* y (* -0.3333333333333333 (sqrt (/ 1.0 x)))) (+ 1.0 (/ (/ -1.0 x) 9.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.26e+40) || !(y <= 5.9e+44)) {
tmp = y * (-0.3333333333333333 * sqrt((1.0 / x)));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.26d+40)) .or. (.not. (y <= 5.9d+44))) then
tmp = y * ((-0.3333333333333333d0) * sqrt((1.0d0 / x)))
else
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.26e+40) || !(y <= 5.9e+44)) {
tmp = y * (-0.3333333333333333 * Math.sqrt((1.0 / x)));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.26e+40) or not (y <= 5.9e+44): tmp = y * (-0.3333333333333333 * math.sqrt((1.0 / x))) else: tmp = 1.0 + ((-1.0 / x) / 9.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.26e+40) || !(y <= 5.9e+44)) tmp = Float64(y * Float64(-0.3333333333333333 * sqrt(Float64(1.0 / x)))); else tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.26e+40) || ~((y <= 5.9e+44))) tmp = y * (-0.3333333333333333 * sqrt((1.0 / x))); else tmp = 1.0 + ((-1.0 / x) / 9.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.26e+40], N[Not[LessEqual[y, 5.9e+44]], $MachinePrecision]], N[(y * N[(-0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+40} \lor \neg \left(y \leq 5.9 \cdot 10^{+44}\right):\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\end{array}
\end{array}
if y < -1.2599999999999999e40 or 5.89999999999999965e44 < y Initial program 99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 85.6%
associate-*r*85.7%
*-commutative85.7%
Simplified85.7%
if -1.2599999999999999e40 < y < 5.89999999999999965e44Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
Final simplification91.9%
(FPCore (x y) :precision binary64 (if (or (<= y -8e+39) (not (<= y 1.62e+40))) (+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))) (+ 1.0 (/ (/ -1.0 x) 9.0))))
double code(double x, double y) {
double tmp;
if ((y <= -8e+39) || !(y <= 1.62e+40)) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-8d+39)) .or. (.not. (y <= 1.62d+40))) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -8e+39) || !(y <= 1.62e+40)) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -8e+39) or not (y <= 1.62e+40): tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) else: tmp = 1.0 + ((-1.0 / x) / 9.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -8e+39) || !(y <= 1.62e+40)) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); else tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -8e+39) || ~((y <= 1.62e+40))) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); else tmp = 1.0 + ((-1.0 / x) / 9.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -8e+39], N[Not[LessEqual[y, 1.62e+40]], $MachinePrecision]], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+39} \lor \neg \left(y \leq 1.62 \cdot 10^{+40}\right):\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\end{array}
\end{array}
if y < -7.99999999999999952e39 or 1.62e40 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-neg99.5%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 92.9%
*-commutative92.9%
associate-*l*93.0%
*-commutative93.0%
Simplified93.0%
*-commutative93.0%
associate-*r*92.9%
sqrt-div92.9%
metadata-eval92.9%
div-inv93.0%
add-sqr-sqrt47.8%
unpow247.8%
expm1-log1p-u2.6%
expm1-udef2.6%
Applied egg-rr44.9%
expm1-def44.9%
expm1-log1p92.9%
associate-*r/93.0%
associate-*l/93.0%
*-commutative93.0%
Simplified93.0%
if -7.99999999999999952e39 < y < 1.62e40Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
Final simplification95.2%
(FPCore (x y) :precision binary64 (if (or (<= y -7.2e+39) (not (<= y 4.3e+43))) (+ 1.0 (/ y (* (sqrt x) -3.0))) (+ 1.0 (/ (/ -1.0 x) 9.0))))
double code(double x, double y) {
double tmp;
if ((y <= -7.2e+39) || !(y <= 4.3e+43)) {
tmp = 1.0 + (y / (sqrt(x) * -3.0));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-7.2d+39)) .or. (.not. (y <= 4.3d+43))) then
tmp = 1.0d0 + (y / (sqrt(x) * (-3.0d0)))
else
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -7.2e+39) || !(y <= 4.3e+43)) {
tmp = 1.0 + (y / (Math.sqrt(x) * -3.0));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7.2e+39) or not (y <= 4.3e+43): tmp = 1.0 + (y / (math.sqrt(x) * -3.0)) else: tmp = 1.0 + ((-1.0 / x) / 9.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -7.2e+39) || !(y <= 4.3e+43)) tmp = Float64(1.0 + Float64(y / Float64(sqrt(x) * -3.0))); else tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -7.2e+39) || ~((y <= 4.3e+43))) tmp = 1.0 + (y / (sqrt(x) * -3.0)); else tmp = 1.0 + ((-1.0 / x) / 9.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7.2e+39], N[Not[LessEqual[y, 4.3e+43]], $MachinePrecision]], N[(1.0 + N[(y / N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+39} \lor \neg \left(y \leq 4.3 \cdot 10^{+43}\right):\\
\;\;\;\;1 + \frac{y}{\sqrt{x} \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\end{array}
\end{array}
if y < -7.19999999999999969e39 or 4.3e43 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-neg99.5%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 92.9%
*-commutative92.9%
associate-*l*93.0%
*-commutative93.0%
Simplified93.0%
*-commutative93.0%
sqrt-div93.0%
metadata-eval93.0%
div-inv93.0%
*-commutative93.0%
associate-/l*93.0%
Applied egg-rr93.0%
add-log-exp14.5%
*-un-lft-identity14.5%
log-prod14.5%
metadata-eval14.5%
add-log-exp93.0%
div-inv93.1%
metadata-eval93.1%
Applied egg-rr93.1%
+-lft-identity93.1%
Simplified93.1%
if -7.19999999999999969e39 < y < 4.3e43Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
Final simplification95.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 x))))
(if (<= y -1.26e+40)
(* (* y -0.3333333333333333) t_0)
(if (<= y 3e+42)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(* y (* -0.3333333333333333 t_0))))))
double code(double x, double y) {
double t_0 = sqrt((1.0 / x));
double tmp;
if (y <= -1.26e+40) {
tmp = (y * -0.3333333333333333) * t_0;
} else if (y <= 3e+42) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = y * (-0.3333333333333333 * t_0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / x))
if (y <= (-1.26d+40)) then
tmp = (y * (-0.3333333333333333d0)) * t_0
else if (y <= 3d+42) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = y * ((-0.3333333333333333d0) * t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((1.0 / x));
double tmp;
if (y <= -1.26e+40) {
tmp = (y * -0.3333333333333333) * t_0;
} else if (y <= 3e+42) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = y * (-0.3333333333333333 * t_0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((1.0 / x)) tmp = 0 if y <= -1.26e+40: tmp = (y * -0.3333333333333333) * t_0 elif y <= 3e+42: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = y * (-0.3333333333333333 * t_0) return tmp
function code(x, y) t_0 = sqrt(Float64(1.0 / x)) tmp = 0.0 if (y <= -1.26e+40) tmp = Float64(Float64(y * -0.3333333333333333) * t_0); elseif (y <= 3e+42) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(y * Float64(-0.3333333333333333 * t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((1.0 / x)); tmp = 0.0; if (y <= -1.26e+40) tmp = (y * -0.3333333333333333) * t_0; elseif (y <= 3e+42) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = y * (-0.3333333333333333 * t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -1.26e+40], N[(N[(y * -0.3333333333333333), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 3e+42], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{x}}\\
\mathbf{if}\;y \leq -1.26 \cdot 10^{+40}:\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot t_0\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+42}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot t_0\right)\\
\end{array}
\end{array}
if y < -1.2599999999999999e40Initial program 99.6%
Taylor expanded in x around 0 99.6%
div-inv99.6%
add-sqr-sqrt99.6%
associate-*r*99.6%
inv-pow99.6%
sqrt-pow199.6%
metadata-eval99.6%
inv-pow99.6%
sqrt-pow199.6%
metadata-eval99.6%
Applied egg-rr99.6%
associate-*l*99.6%
metadata-eval99.6%
pow-prod-up99.6%
metadata-eval99.6%
unpow-prod-down99.6%
*-commutative99.6%
unpow-199.6%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 84.8%
*-commutative84.8%
associate-*l*84.9%
*-commutative84.9%
Simplified84.9%
if -1.2599999999999999e40 < y < 3.00000000000000029e42Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
if 3.00000000000000029e42 < y Initial program 99.6%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 86.4%
associate-*r*86.5%
*-commutative86.5%
Simplified86.5%
Final simplification91.9%
(FPCore (x y)
:precision binary64
(if (<= y -5.3e+39)
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x))))
(if (<= y 4.1e+40)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(+ 1.0 (/ -0.3333333333333333 (/ (sqrt x) y))))))
double code(double x, double y) {
double tmp;
if (y <= -5.3e+39) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else if (y <= 4.1e+40) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 + (-0.3333333333333333 / (sqrt(x) / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-5.3d+39)) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else if (y <= 4.1d+40) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = 1.0d0 + ((-0.3333333333333333d0) / (sqrt(x) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.3e+39) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else if (y <= 4.1e+40) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 + (-0.3333333333333333 / (Math.sqrt(x) / y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.3e+39: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) elif y <= 4.1e+40: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = 1.0 + (-0.3333333333333333 / (math.sqrt(x) / y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -5.3e+39) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); elseif (y <= 4.1e+40) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(1.0 + Float64(-0.3333333333333333 / Float64(sqrt(x) / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.3e+39) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); elseif (y <= 4.1e+40) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = 1.0 + (-0.3333333333333333 / (sqrt(x) / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.3e+39], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+40], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+39}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\
\end{array}
\end{array}
if y < -5.29999999999999979e39Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.4%
fma-neg99.4%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 92.4%
*-commutative92.4%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
*-commutative92.5%
associate-*r*92.4%
sqrt-div92.4%
metadata-eval92.4%
div-inv92.5%
add-sqr-sqrt0.0%
unpow20.0%
expm1-log1p-u0.0%
expm1-udef0.0%
Applied egg-rr86.8%
expm1-def86.8%
expm1-log1p92.4%
associate-*r/92.4%
associate-*l/92.5%
*-commutative92.5%
Simplified92.5%
if -5.29999999999999979e39 < y < 4.1000000000000002e40Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
if 4.1000000000000002e40 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-neg99.5%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 93.3%
*-commutative93.3%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
*-commutative93.5%
associate-*r*93.3%
sqrt-div93.4%
metadata-eval93.4%
div-inv93.4%
add-sqr-sqrt93.2%
unpow293.2%
expm1-log1p-u5.1%
expm1-udef5.1%
Applied egg-rr5.1%
expm1-def5.1%
expm1-log1p93.4%
*-commutative93.4%
associate-/r/93.5%
Simplified93.5%
Final simplification95.2%
(FPCore (x y)
:precision binary64
(if (<= y -1.06e+40)
(+ 1.0 (/ y (* (sqrt x) -3.0)))
(if (<= y 4.25e+40)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(+ 1.0 (/ (/ y -3.0) (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.06e+40) {
tmp = 1.0 + (y / (sqrt(x) * -3.0));
} else if (y <= 4.25e+40) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 + ((y / -3.0) / sqrt(x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.06d+40)) then
tmp = 1.0d0 + (y / (sqrt(x) * (-3.0d0)))
else if (y <= 4.25d+40) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = 1.0d0 + ((y / (-3.0d0)) / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.06e+40) {
tmp = 1.0 + (y / (Math.sqrt(x) * -3.0));
} else if (y <= 4.25e+40) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 + ((y / -3.0) / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.06e+40: tmp = 1.0 + (y / (math.sqrt(x) * -3.0)) elif y <= 4.25e+40: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = 1.0 + ((y / -3.0) / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.06e+40) tmp = Float64(1.0 + Float64(y / Float64(sqrt(x) * -3.0))); elseif (y <= 4.25e+40) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(1.0 + Float64(Float64(y / -3.0) / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.06e+40) tmp = 1.0 + (y / (sqrt(x) * -3.0)); elseif (y <= 4.25e+40) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = 1.0 + ((y / -3.0) / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.06e+40], N[(1.0 + N[(y / N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.25e+40], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(y / -3.0), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{y}{\sqrt{x} \cdot -3}\\
\mathbf{elif}\;y \leq 4.25 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{y}{-3}}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -1.05999999999999996e40Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.4%
fma-neg99.4%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 92.4%
*-commutative92.4%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
*-commutative92.5%
sqrt-div92.5%
metadata-eval92.5%
div-inv92.4%
*-commutative92.4%
associate-/l*92.5%
Applied egg-rr92.5%
add-log-exp14.4%
*-un-lft-identity14.4%
log-prod14.4%
metadata-eval14.4%
add-log-exp92.5%
div-inv92.6%
metadata-eval92.6%
Applied egg-rr92.6%
+-lft-identity92.6%
Simplified92.6%
if -1.05999999999999996e40 < y < 4.24999999999999998e40Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
if 4.24999999999999998e40 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-neg99.5%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 93.3%
*-commutative93.3%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
add-cbrt-cube86.0%
pow1/382.3%
add-sqr-sqrt82.3%
pow182.3%
pow1/282.3%
pow-prod-up82.3%
metadata-eval82.3%
Applied egg-rr82.3%
unpow1/386.1%
Simplified86.1%
pow1/382.3%
pow-pow93.5%
metadata-eval93.5%
pow1/293.5%
inv-pow93.5%
sqrt-pow193.6%
metadata-eval93.6%
sqr-pow93.2%
pow293.2%
metadata-eval93.2%
Applied egg-rr93.2%
*-commutative93.2%
associate-*l*93.3%
metadata-eval93.3%
pow-pow93.4%
metadata-eval93.4%
metadata-eval93.4%
sqrt-pow193.3%
inv-pow93.3%
sqrt-div93.4%
metadata-eval93.4%
div-inv93.4%
times-frac93.6%
*-un-lft-identity93.6%
associate-/r*93.6%
Applied egg-rr93.6%
Final simplification95.2%
(FPCore (x y)
:precision binary64
(if (<= y -4.5e+39)
(+ 1.0 (/ (/ y (sqrt x)) -3.0))
(if (<= y 9.2e+40)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(+ 1.0 (/ (/ y -3.0) (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -4.5e+39) {
tmp = 1.0 + ((y / sqrt(x)) / -3.0);
} else if (y <= 9.2e+40) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 + ((y / -3.0) / sqrt(x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-4.5d+39)) then
tmp = 1.0d0 + ((y / sqrt(x)) / (-3.0d0))
else if (y <= 9.2d+40) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = 1.0d0 + ((y / (-3.0d0)) / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.5e+39) {
tmp = 1.0 + ((y / Math.sqrt(x)) / -3.0);
} else if (y <= 9.2e+40) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 + ((y / -3.0) / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.5e+39: tmp = 1.0 + ((y / math.sqrt(x)) / -3.0) elif y <= 9.2e+40: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = 1.0 + ((y / -3.0) / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -4.5e+39) tmp = Float64(1.0 + Float64(Float64(y / sqrt(x)) / -3.0)); elseif (y <= 9.2e+40) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(1.0 + Float64(Float64(y / -3.0) / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.5e+39) tmp = 1.0 + ((y / sqrt(x)) / -3.0); elseif (y <= 9.2e+40) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = 1.0 + ((y / -3.0) / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.5e+39], N[(1.0 + N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e+40], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(y / -3.0), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+39}:\\
\;\;\;\;1 + \frac{\frac{y}{\sqrt{x}}}{-3}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{y}{-3}}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -4.49999999999999996e39Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.4%
fma-neg99.4%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 92.4%
*-commutative92.4%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
add-cbrt-cube83.8%
pow1/379.9%
add-sqr-sqrt79.9%
pow179.9%
pow1/279.9%
pow-prod-up79.8%
metadata-eval79.8%
Applied egg-rr79.8%
unpow1/383.8%
Simplified83.8%
associate-*r*83.8%
pow1/379.8%
pow-pow92.5%
metadata-eval92.5%
pow1/292.5%
sqrt-div92.4%
metadata-eval92.4%
associate-/r/92.4%
associate-/r/92.5%
clear-num92.5%
div-inv92.6%
associate-/r*92.6%
metadata-eval92.6%
Applied egg-rr92.6%
if -4.49999999999999996e39 < y < 9.19999999999999975e40Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
if 9.19999999999999975e40 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-neg99.5%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 93.3%
*-commutative93.3%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
add-cbrt-cube86.0%
pow1/382.3%
add-sqr-sqrt82.3%
pow182.3%
pow1/282.3%
pow-prod-up82.3%
metadata-eval82.3%
Applied egg-rr82.3%
unpow1/386.1%
Simplified86.1%
pow1/382.3%
pow-pow93.5%
metadata-eval93.5%
pow1/293.5%
inv-pow93.5%
sqrt-pow193.6%
metadata-eval93.6%
sqr-pow93.2%
pow293.2%
metadata-eval93.2%
Applied egg-rr93.2%
*-commutative93.2%
associate-*l*93.3%
metadata-eval93.3%
pow-pow93.4%
metadata-eval93.4%
metadata-eval93.4%
sqrt-pow193.3%
inv-pow93.3%
sqrt-div93.4%
metadata-eval93.4%
div-inv93.4%
times-frac93.6%
*-un-lft-identity93.6%
associate-/r*93.6%
Applied egg-rr93.6%
Final simplification95.2%
(FPCore (x y)
:precision binary64
(if (<= y -5.3e+39)
(+ 1.0 (/ (/ y (sqrt x)) -3.0))
(if (<= y 6.2e+42)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(- 1.0 (/ y (sqrt (* x 9.0)))))))
double code(double x, double y) {
double tmp;
if (y <= -5.3e+39) {
tmp = 1.0 + ((y / sqrt(x)) / -3.0);
} else if (y <= 6.2e+42) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 - (y / sqrt((x * 9.0)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-5.3d+39)) then
tmp = 1.0d0 + ((y / sqrt(x)) / (-3.0d0))
else if (y <= 6.2d+42) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = 1.0d0 - (y / sqrt((x * 9.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.3e+39) {
tmp = 1.0 + ((y / Math.sqrt(x)) / -3.0);
} else if (y <= 6.2e+42) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = 1.0 - (y / Math.sqrt((x * 9.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.3e+39: tmp = 1.0 + ((y / math.sqrt(x)) / -3.0) elif y <= 6.2e+42: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = 1.0 - (y / math.sqrt((x * 9.0))) return tmp
function code(x, y) tmp = 0.0 if (y <= -5.3e+39) tmp = Float64(1.0 + Float64(Float64(y / sqrt(x)) / -3.0)); elseif (y <= 6.2e+42) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(1.0 - Float64(y / sqrt(Float64(x * 9.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.3e+39) tmp = 1.0 + ((y / sqrt(x)) / -3.0); elseif (y <= 6.2e+42) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = 1.0 - (y / sqrt((x * 9.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.3e+39], N[(1.0 + N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+42], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+39}:\\
\;\;\;\;1 + \frac{\frac{y}{\sqrt{x}}}{-3}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+42}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{\sqrt{x \cdot 9}}\\
\end{array}
\end{array}
if y < -5.29999999999999979e39Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.4%
fma-neg99.4%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 92.4%
*-commutative92.4%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
add-cbrt-cube83.8%
pow1/379.9%
add-sqr-sqrt79.9%
pow179.9%
pow1/279.9%
pow-prod-up79.8%
metadata-eval79.8%
Applied egg-rr79.8%
unpow1/383.8%
Simplified83.8%
associate-*r*83.8%
pow1/379.8%
pow-pow92.5%
metadata-eval92.5%
pow1/292.5%
sqrt-div92.4%
metadata-eval92.4%
associate-/r/92.4%
associate-/r/92.5%
clear-num92.5%
div-inv92.6%
associate-/r*92.6%
metadata-eval92.6%
Applied egg-rr92.6%
if -5.29999999999999979e39 < y < 6.2000000000000003e42Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 96.8%
*-commutative96.8%
metadata-eval96.8%
div-inv97.0%
Applied egg-rr97.0%
if 6.2000000000000003e42 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-neg99.5%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 93.3%
*-commutative93.3%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
*-commutative93.5%
sqrt-div93.5%
metadata-eval93.5%
div-inv93.5%
*-commutative93.5%
associate-/l*93.4%
Applied egg-rr93.4%
add-log-exp14.5%
*-un-lft-identity14.5%
log-prod14.5%
metadata-eval14.5%
add-log-exp93.4%
div-inv93.6%
metadata-eval93.6%
Applied egg-rr93.6%
+-lft-identity93.6%
Simplified93.6%
frac-2neg93.6%
*-commutative93.6%
distribute-lft-neg-in93.6%
metadata-eval93.6%
distribute-frac-neg93.6%
neg-sub093.6%
add-sqr-sqrt93.1%
sqrt-unprod93.6%
*-commutative93.6%
*-commutative93.6%
swap-sqr93.5%
metadata-eval93.5%
metadata-eval93.5%
swap-sqr93.6%
swap-sqr93.5%
add-sqr-sqrt93.6%
metadata-eval93.6%
Applied egg-rr93.6%
neg-sub093.6%
distribute-frac-neg93.6%
Simplified93.6%
Final simplification95.3%
(FPCore (x y) :precision binary64 (- (+ 1.0 (/ -1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + ((-1.0d0) / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 + (-1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 + (-1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + \frac{-1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Initial program 99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (+ (- 1.0 (/ 0.1111111111111111 x)) (* -0.3333333333333333 (/ y (sqrt x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) + ((-0.3333333333333333d0) * (y / sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / Math.sqrt(x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (+ (/ (* y -0.3333333333333333) (sqrt x)) (+ 1.0 (/ -0.1111111111111111 x))))
double code(double x, double y) {
return ((y * -0.3333333333333333) / sqrt(x)) + (1.0 + (-0.1111111111111111 / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y * (-0.3333333333333333d0)) / sqrt(x)) + (1.0d0 + ((-0.1111111111111111d0) / x))
end function
public static double code(double x, double y) {
return ((y * -0.3333333333333333) / Math.sqrt(x)) + (1.0 + (-0.1111111111111111 / x));
}
def code(x, y): return ((y * -0.3333333333333333) / math.sqrt(x)) + (1.0 + (-0.1111111111111111 / x))
function code(x, y) return Float64(Float64(Float64(y * -0.3333333333333333) / sqrt(x)) + Float64(1.0 + Float64(-0.1111111111111111 / x))) end
function tmp = code(x, y) tmp = ((y * -0.3333333333333333) / sqrt(x)) + (1.0 + (-0.1111111111111111 / x)); end
code[x_, y_] := N[(N[(N[(y * -0.3333333333333333), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot -0.3333333333333333}{\sqrt{x}} + \left(1 + \frac{-0.1111111111111111}{x}\right)
\end{array}
Initial program 99.7%
associate--l-99.7%
metadata-eval99.7%
div-inv99.6%
clear-num99.6%
*-un-lft-identity99.6%
times-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
associate-+l-99.6%
+-commutative99.6%
div-inv99.5%
cancel-sign-sub-inv99.5%
metadata-eval99.5%
div-inv99.6%
associate-*r/99.6%
+-commutative99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (if (<= x 1.9) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 1.9) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.9d0) then
tmp = (-0.1111111111111111d0) / x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.9) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.9: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 1.9) tmp = Float64(-0.1111111111111111 / x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.9) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.9], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 1.8999999999999999Initial program 99.6%
Taylor expanded in x around 0 99.5%
Taylor expanded in x around 0 58.5%
if 1.8999999999999999 < x Initial program 99.8%
sub-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
distribute-frac-neg99.8%
neg-mul-199.8%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 58.4%
Final simplification58.5%
(FPCore (x y) :precision binary64 (+ 1.0 (/ -1.0 (* x 9.0))))
double code(double x, double y) {
return 1.0 + (-1.0 / (x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end function
public static double code(double x, double y) {
return 1.0 + (-1.0 / (x * 9.0));
}
def code(x, y): return 1.0 + (-1.0 / (x * 9.0))
function code(x, y) return Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) end
function tmp = code(x, y) tmp = 1.0 + (-1.0 / (x * 9.0)); end
code[x_, y_] := N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-1}{x \cdot 9}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 59.3%
un-div-inv59.3%
metadata-eval59.3%
associate-/r*59.3%
*-commutative59.3%
Applied egg-rr59.3%
Final simplification59.3%
(FPCore (x y) :precision binary64 (+ 1.0 (/ (/ -1.0 x) 9.0)))
double code(double x, double y) {
return 1.0 + ((-1.0 / x) / 9.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
end function
public static double code(double x, double y) {
return 1.0 + ((-1.0 / x) / 9.0);
}
def code(x, y): return 1.0 + ((-1.0 / x) / 9.0)
function code(x, y) return Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)) end
function tmp = code(x, y) tmp = 1.0 + ((-1.0 / x) / 9.0); end
code[x_, y_] := N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{\frac{-1}{x}}{9}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 59.3%
*-commutative59.3%
metadata-eval59.3%
div-inv59.4%
Applied egg-rr59.4%
Final simplification59.4%
(FPCore (x y) :precision binary64 (+ 1.0 (/ -0.1111111111111111 x)))
double code(double x, double y) {
return 1.0 + (-0.1111111111111111 / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((-0.1111111111111111d0) / x)
end function
public static double code(double x, double y) {
return 1.0 + (-0.1111111111111111 / x);
}
def code(x, y): return 1.0 + (-0.1111111111111111 / x)
function code(x, y) return Float64(1.0 + Float64(-0.1111111111111111 / x)) end
function tmp = code(x, y) tmp = 1.0 + (-0.1111111111111111 / x); end
code[x_, y_] := N[(1.0 + N[(-0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.1111111111111111}{x}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 59.3%
cancel-sign-sub-inv59.3%
metadata-eval59.3%
associate-*r/59.3%
metadata-eval59.3%
+-commutative59.3%
Simplified59.3%
Final simplification59.3%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 31.7%
Final simplification31.7%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - ((1.0d0 / x) / 9.0d0)) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(Float64(1.0 / x) / 9.0)) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(N[(1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{\frac{1}{x}}{9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
herbie shell --seed 2024020
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:herbie-target
(- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))