
(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 15 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(-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 (if (or (<= y -2.4e+38) (not (<= y 2e+47))) (+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -2.4e+38) || !(y <= 2e+47)) {
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 <= (-2.4d+38)) .or. (.not. (y <= 2d+47))) 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 <= -2.4e+38) || !(y <= 2e+47)) {
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 <= -2.4e+38) or not (y <= 2e+47): 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 <= -2.4e+38) || !(y <= 2e+47)) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.4e+38) || ~((y <= 2e+47))) 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, -2.4e+38], N[Not[LessEqual[y, 2e+47]], $MachinePrecision]], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+38} \lor \neg \left(y \leq 2 \cdot 10^{+47}\right):\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -2.40000000000000017e38 or 2.0000000000000001e47 < y Initial program 99.6%
sub-neg99.6%
*-commutative99.6%
associate-/r*99.5%
metadata-eval99.5%
distribute-frac-neg99.5%
neg-mul-199.5%
times-frac98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in x around inf 94.6%
if -2.40000000000000017e38 < y < 2.0000000000000001e47Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.5%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
expm1-log1p-u93.4%
expm1-undefine93.4%
log1p-undefine93.4%
add-exp-log97.5%
add-sqr-sqrt97.3%
sqrt-unprod76.4%
frac-times76.4%
metadata-eval76.4%
metadata-eval76.4%
frac-times76.4%
sqrt-unprod0.0%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
+-commutative45.5%
associate--l+45.5%
metadata-eval45.5%
Simplified45.5%
add-sqr-sqrt0.0%
sqrt-unprod76.4%
+-rgt-identity76.4%
+-rgt-identity76.4%
frac-times76.5%
metadata-eval76.5%
metadata-eval76.5%
frac-times76.4%
sqrt-unprod97.3%
add-sqr-sqrt97.6%
clear-num97.5%
div-inv97.6%
metadata-eval97.6%
Applied egg-rr97.6%
Final simplification96.4%
(FPCore (x y)
:precision binary64
(if (<= y -8.2e+40)
(+ 1.0 (/ -1.0 (* (sqrt x) (/ 3.0 y))))
(if (<= y 2.05e+47)
(+ 1.0 (/ -1.0 (* x 9.0)))
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))))))
double code(double x, double y) {
double tmp;
if (y <= -8.2e+40) {
tmp = 1.0 + (-1.0 / (sqrt(x) * (3.0 / y)));
} else if (y <= 2.05e+47) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + (-0.3333333333333333 * (y / 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 <= (-8.2d+40)) then
tmp = 1.0d0 + ((-1.0d0) / (sqrt(x) * (3.0d0 / y)))
else if (y <= 2.05d+47) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -8.2e+40) {
tmp = 1.0 + (-1.0 / (Math.sqrt(x) * (3.0 / y)));
} else if (y <= 2.05e+47) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -8.2e+40: tmp = 1.0 + (-1.0 / (math.sqrt(x) * (3.0 / y))) elif y <= 2.05e+47: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -8.2e+40) tmp = Float64(1.0 + Float64(-1.0 / Float64(sqrt(x) * Float64(3.0 / y)))); elseif (y <= 2.05e+47) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -8.2e+40) tmp = 1.0 + (-1.0 / (sqrt(x) * (3.0 / y))); elseif (y <= 2.05e+47) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -8.2e+40], N[(1.0 + N[(-1.0 / N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e+47], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{-1}{\sqrt{x} \cdot \frac{3}{y}}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+47}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -8.2000000000000003e40Initial program 99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
distribute-frac-neg99.4%
neg-mul-199.4%
times-frac97.7%
metadata-eval97.7%
Simplified97.7%
*-commutative97.7%
associate-*l/99.3%
associate-*r/99.3%
frac-2neg99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
div-inv99.5%
distribute-neg-frac299.5%
associate-/r*99.4%
clear-num99.1%
distribute-neg-frac99.1%
metadata-eval99.1%
*-commutative99.1%
associate-/l*99.4%
Applied egg-rr99.4%
Taylor expanded in x around inf 93.1%
if -8.2000000000000003e40 < y < 2.05000000000000005e47Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.5%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
expm1-log1p-u93.4%
expm1-undefine93.4%
log1p-undefine93.4%
add-exp-log97.5%
add-sqr-sqrt97.3%
sqrt-unprod76.4%
frac-times76.4%
metadata-eval76.4%
metadata-eval76.4%
frac-times76.4%
sqrt-unprod0.0%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
+-commutative45.5%
associate--l+45.5%
metadata-eval45.5%
Simplified45.5%
add-sqr-sqrt0.0%
sqrt-unprod76.4%
+-rgt-identity76.4%
+-rgt-identity76.4%
frac-times76.5%
metadata-eval76.5%
metadata-eval76.5%
frac-times76.4%
sqrt-unprod97.3%
add-sqr-sqrt97.6%
clear-num97.5%
div-inv97.6%
metadata-eval97.6%
Applied egg-rr97.6%
if 2.05000000000000005e47 < y Initial program 99.6%
sub-neg99.6%
*-commutative99.6%
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 97.8%
Final simplification96.8%
(FPCore (x y)
:precision binary64
(if (<= y -2e+38)
(- 1.0 (/ y (* 3.0 (sqrt x))))
(if (<= y 1e+46)
(+ 1.0 (/ -1.0 (* x 9.0)))
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))))))
double code(double x, double y) {
double tmp;
if (y <= -2e+38) {
tmp = 1.0 - (y / (3.0 * sqrt(x)));
} else if (y <= 1e+46) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + (-0.3333333333333333 * (y / 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 <= (-2d+38)) then
tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
else if (y <= 1d+46) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2e+38) {
tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
} else if (y <= 1e+46) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2e+38: tmp = 1.0 - (y / (3.0 * math.sqrt(x))) elif y <= 1e+46: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -2e+38) tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x)))); elseif (y <= 1e+46) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2e+38) tmp = 1.0 - (y / (3.0 * sqrt(x))); elseif (y <= 1e+46) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2e+38], N[(1.0 - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+46], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+38}:\\
\;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
\mathbf{elif}\;y \leq 10^{+46}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -1.99999999999999995e38Initial program 99.5%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around inf 93.0%
if -1.99999999999999995e38 < y < 9.9999999999999999e45Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.5%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
expm1-log1p-u93.4%
expm1-undefine93.4%
log1p-undefine93.4%
add-exp-log97.5%
add-sqr-sqrt97.3%
sqrt-unprod76.4%
frac-times76.4%
metadata-eval76.4%
metadata-eval76.4%
frac-times76.4%
sqrt-unprod0.0%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
+-commutative45.5%
associate--l+45.5%
metadata-eval45.5%
Simplified45.5%
add-sqr-sqrt0.0%
sqrt-unprod76.4%
+-rgt-identity76.4%
+-rgt-identity76.4%
frac-times76.5%
metadata-eval76.5%
metadata-eval76.5%
frac-times76.4%
sqrt-unprod97.3%
add-sqr-sqrt97.6%
clear-num97.5%
div-inv97.6%
metadata-eval97.6%
Applied egg-rr97.6%
if 9.9999999999999999e45 < y Initial program 99.6%
sub-neg99.6%
*-commutative99.6%
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 97.8%
Final simplification96.8%
(FPCore (x y) :precision binary64 (if (or (<= y -9.5e+40) (not (<= y 9e+103))) (* -0.3333333333333333 (/ y (sqrt x))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -9.5e+40) || !(y <= 9e+103)) {
tmp = -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 <= (-9.5d+40)) .or. (.not. (y <= 9d+103))) then
tmp = (-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 <= -9.5e+40) || !(y <= 9e+103)) {
tmp = -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 <= -9.5e+40) or not (y <= 9e+103): tmp = -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 <= -9.5e+40) || !(y <= 9e+103)) tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -9.5e+40) || ~((y <= 9e+103))) tmp = -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, -9.5e+40], N[Not[LessEqual[y, 9e+103]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+40} \lor \neg \left(y \leq 9 \cdot 10^{+103}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -9.5000000000000003e40 or 9.00000000000000002e103 < y Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-frac-neg99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/l*99.4%
fmm-def99.4%
associate-/r*99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 90.3%
*-commutative90.3%
sqrt-div90.2%
metadata-eval90.2%
un-div-inv90.4%
Applied egg-rr90.4%
if -9.5000000000000003e40 < y < 9.00000000000000002e103Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-def99.8%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 95.5%
associate-*r/95.5%
metadata-eval95.5%
Simplified95.5%
expm1-log1p-u91.6%
expm1-undefine91.6%
log1p-undefine91.6%
add-exp-log95.5%
add-sqr-sqrt95.2%
sqrt-unprod75.0%
frac-times75.0%
metadata-eval75.0%
metadata-eval75.0%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt45.7%
Applied egg-rr45.7%
+-commutative45.7%
associate--l+45.7%
metadata-eval45.7%
Simplified45.7%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
+-rgt-identity75.0%
+-rgt-identity75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod95.3%
add-sqr-sqrt95.5%
clear-num95.4%
div-inv95.6%
metadata-eval95.6%
Applied egg-rr95.6%
Final simplification93.8%
(FPCore (x y)
:precision binary64
(if (<= y -9.5e+40)
(* y (/ -0.3333333333333333 (sqrt x)))
(if (<= y 1.7e+104)
(+ 1.0 (/ -1.0 (* x 9.0)))
(* -0.3333333333333333 (/ y (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -9.5e+40) {
tmp = y * (-0.3333333333333333 / sqrt(x));
} else if (y <= 1.7e+104) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = -0.3333333333333333 * (y / 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 <= (-9.5d+40)) then
tmp = y * ((-0.3333333333333333d0) / sqrt(x))
else if (y <= 1.7d+104) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = (-0.3333333333333333d0) * (y / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -9.5e+40) {
tmp = y * (-0.3333333333333333 / Math.sqrt(x));
} else if (y <= 1.7e+104) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = -0.3333333333333333 * (y / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -9.5e+40: tmp = y * (-0.3333333333333333 / math.sqrt(x)) elif y <= 1.7e+104: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = -0.3333333333333333 * (y / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -9.5e+40) tmp = Float64(y * Float64(-0.3333333333333333 / sqrt(x))); elseif (y <= 1.7e+104) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -9.5e+40) tmp = y * (-0.3333333333333333 / sqrt(x)); elseif (y <= 1.7e+104) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = -0.3333333333333333 * (y / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -9.5e+40], N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+104], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+40}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+104}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -9.5000000000000003e40Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-frac-neg99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/l*99.4%
fmm-def99.3%
associate-/r*99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.3%
distribute-neg-frac99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 84.8%
associate-*r*86.5%
Simplified86.5%
sqrt-div86.5%
metadata-eval86.5%
un-div-inv86.6%
Applied egg-rr86.6%
if -9.5000000000000003e40 < y < 1.6999999999999998e104Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-def99.8%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 95.5%
associate-*r/95.5%
metadata-eval95.5%
Simplified95.5%
expm1-log1p-u91.6%
expm1-undefine91.6%
log1p-undefine91.6%
add-exp-log95.5%
add-sqr-sqrt95.2%
sqrt-unprod75.0%
frac-times75.0%
metadata-eval75.0%
metadata-eval75.0%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt45.7%
Applied egg-rr45.7%
+-commutative45.7%
associate--l+45.7%
metadata-eval45.7%
Simplified45.7%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
+-rgt-identity75.0%
+-rgt-identity75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod95.3%
add-sqr-sqrt95.5%
clear-num95.4%
div-inv95.6%
metadata-eval95.6%
Applied egg-rr95.6%
if 1.6999999999999998e104 < y Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-frac-neg99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/l*99.4%
fmm-def99.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 97.0%
*-commutative97.0%
sqrt-div96.8%
metadata-eval96.8%
un-div-inv97.1%
Applied egg-rr97.1%
Final simplification94.1%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (/ (- (* -0.3333333333333333 (* y (sqrt x))) 0.1111111111111111) x) (- 1.0 (/ y (* 3.0 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = ((-0.3333333333333333 * (y * sqrt(x))) - 0.1111111111111111) / x;
} 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 (x <= 0.11d0) then
tmp = (((-0.3333333333333333d0) * (y * sqrt(x))) - 0.1111111111111111d0) / x
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 (x <= 0.11) {
tmp = ((-0.3333333333333333 * (y * Math.sqrt(x))) - 0.1111111111111111) / x;
} else {
tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = ((-0.3333333333333333 * (y * math.sqrt(x))) - 0.1111111111111111) / x else: tmp = 1.0 - (y / (3.0 * math.sqrt(x))) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(Float64(Float64(-0.3333333333333333 * Float64(y * sqrt(x))) - 0.1111111111111111) / x); else tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = ((-0.3333333333333333 * (y * sqrt(x))) - 0.1111111111111111) / x; else tmp = 1.0 - (y / (3.0 * sqrt(x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(N[(N[(-0.3333333333333333 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.1111111111111111), $MachinePrecision] / x), $MachinePrecision], N[(1.0 - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(y \cdot \sqrt{x}\right) - 0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.5%
fmm-def99.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 x around 0 98.8%
if 0.110000000000000001 < x Initial program 99.8%
Taylor expanded in x around 0 99.8%
Taylor expanded in x around inf 98.3%
Final simplification98.5%
(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%
(FPCore (x y) :precision binary64 (+ (- 1.0 (/ 0.1111111111111111 x)) (/ -0.3333333333333333 (/ (sqrt x) y))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (sqrt(x) / y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) + ((-0.3333333333333333d0) / (sqrt(x) / y))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (Math.sqrt(x) / y));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (math.sqrt(x) / y))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(-0.3333333333333333 / Float64(sqrt(x) / y))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (sqrt(x) / y)); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) + \frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}
\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.3%
metadata-eval99.3%
Simplified99.3%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
(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.3%
metadata-eval99.3%
Simplified99.3%
(FPCore (x y)
:precision binary64
(if (<= y -7.2e+102)
(/
(- 1.0 (* (/ 0.1111111111111111 x) (/ 0.1111111111111111 x)))
(- 1.0 (/ 0.1111111111111111 x)))
(+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (y <= -7.2e+102) {
tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / 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 <= (-7.2d+102)) then
tmp = (1.0d0 - ((0.1111111111111111d0 / x) * (0.1111111111111111d0 / x))) / (1.0d0 - (0.1111111111111111d0 / 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 <= -7.2e+102) {
tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / x));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -7.2e+102: tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / x)) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -7.2e+102) tmp = Float64(Float64(1.0 - Float64(Float64(0.1111111111111111 / x) * Float64(0.1111111111111111 / x))) / Float64(1.0 - Float64(0.1111111111111111 / x))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -7.2e+102) tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / x)); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -7.2e+102], N[(N[(1.0 - N[(N[(0.1111111111111111 / x), $MachinePrecision] * N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+102}:\\
\;\;\;\;\frac{1 - \frac{0.1111111111111111}{x} \cdot \frac{0.1111111111111111}{x}}{1 - \frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -7.2000000000000003e102Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-frac-neg99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/l*99.3%
fmm-def99.3%
associate-/r*99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 6.2%
associate-*r/6.2%
metadata-eval6.2%
Simplified6.2%
expm1-log1p-u6.2%
expm1-undefine6.2%
log1p-undefine6.2%
add-exp-log6.2%
add-sqr-sqrt6.2%
sqrt-unprod6.1%
frac-times6.1%
metadata-eval6.1%
metadata-eval6.1%
frac-times6.1%
sqrt-unprod0.0%
add-sqr-sqrt8.2%
Applied egg-rr8.2%
+-commutative8.2%
associate--l+8.2%
metadata-eval8.2%
Simplified8.2%
+-rgt-identity8.2%
metadata-eval8.2%
distribute-neg-frac8.2%
clear-num8.2%
distribute-neg-frac8.2%
metadata-eval8.2%
div-inv8.2%
metadata-eval8.2%
Applied egg-rr8.2%
sub-neg8.2%
flip-+23.1%
metadata-eval23.1%
distribute-neg-frac23.1%
metadata-eval23.1%
*-commutative23.1%
associate-/r*23.1%
metadata-eval23.1%
distribute-neg-frac23.1%
metadata-eval23.1%
*-commutative23.1%
associate-/r*23.1%
metadata-eval23.1%
distribute-neg-frac23.1%
metadata-eval23.1%
*-commutative23.1%
associate-/r*23.1%
metadata-eval23.1%
Applied egg-rr23.1%
if -7.2000000000000003e102 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-def99.7%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 76.2%
associate-*r/76.2%
metadata-eval76.2%
Simplified76.2%
expm1-log1p-u73.1%
expm1-undefine73.1%
log1p-undefine73.1%
add-exp-log76.2%
add-sqr-sqrt76.0%
sqrt-unprod60.2%
frac-times60.2%
metadata-eval60.2%
metadata-eval60.2%
frac-times60.2%
sqrt-unprod0.0%
add-sqr-sqrt36.6%
Applied egg-rr36.6%
+-commutative36.6%
associate--l+36.6%
metadata-eval36.6%
Simplified36.6%
add-sqr-sqrt0.0%
sqrt-unprod60.2%
+-rgt-identity60.2%
+-rgt-identity60.2%
frac-times60.2%
metadata-eval60.2%
metadata-eval60.2%
frac-times60.2%
sqrt-unprod76.0%
add-sqr-sqrt76.2%
clear-num76.2%
div-inv76.3%
metadata-eval76.3%
Applied egg-rr76.3%
Final simplification68.4%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
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 <= 0.11d0) 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 <= 0.11) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(-0.1111111111111111 / x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.5%
fmm-def99.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 x around 0 98.8%
Taylor expanded in y around 0 71.8%
if 0.110000000000000001 < x Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.7%
fmm-def99.7%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 60.2%
associate-*r/60.2%
metadata-eval60.2%
Simplified60.2%
Taylor expanded in x around inf 58.8%
(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%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
fmm-def99.6%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 65.8%
associate-*r/65.8%
metadata-eval65.8%
Simplified65.8%
expm1-log1p-u63.2%
expm1-undefine63.2%
log1p-undefine63.2%
add-exp-log65.8%
add-sqr-sqrt65.7%
sqrt-unprod52.1%
frac-times52.2%
metadata-eval52.2%
metadata-eval52.2%
frac-times52.1%
sqrt-unprod0.0%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
+-commutative32.4%
associate--l+32.4%
metadata-eval32.4%
Simplified32.4%
add-sqr-sqrt0.0%
sqrt-unprod52.2%
+-rgt-identity52.2%
+-rgt-identity52.2%
frac-times52.2%
metadata-eval52.2%
metadata-eval52.2%
frac-times52.2%
sqrt-unprod65.7%
add-sqr-sqrt65.8%
clear-num65.8%
div-inv65.9%
metadata-eval65.9%
Applied egg-rr65.9%
Final simplification65.9%
(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%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
fmm-def99.6%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 65.8%
associate-*r/65.8%
metadata-eval65.8%
Simplified65.8%
(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%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.6%
fmm-def99.6%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 65.8%
associate-*r/65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in x around inf 32.4%
(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 2024157
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:alt
(! :herbie-platform default (- (- 1 (/ (/ 1 x) 9)) (/ y (* 3 (sqrt x)))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))