
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
(FPCore (x y) :precision binary64 (+ 1.0 (- (/ y (pow x -0.5)) x)))
double code(double x, double y) {
return 1.0 + ((y / pow(x, -0.5)) - x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((y / (x ** (-0.5d0))) - x)
end function
public static double code(double x, double y) {
return 1.0 + ((y / Math.pow(x, -0.5)) - x);
}
def code(x, y): return 1.0 + ((y / math.pow(x, -0.5)) - x)
function code(x, y) return Float64(1.0 + Float64(Float64(y / (x ^ -0.5)) - x)) end
function tmp = code(x, y) tmp = 1.0 + ((y / (x ^ -0.5)) - x); end
code[x_, y_] := N[(1.0 + N[(N[(y / N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(\frac{y}{{x}^{-0.5}} - x\right)
\end{array}
Initial program 99.8%
Taylor expanded in x around inf 93.1%
associate--l+93.1%
distribute-rgt-in93.1%
Simplified99.8%
+-commutative99.8%
associate-+l-99.8%
*-commutative99.8%
sqrt-div99.8%
metadata-eval99.8%
un-div-inv99.8%
Applied egg-rr99.8%
clear-num99.8%
un-div-inv99.9%
pow1/299.9%
pow199.9%
pow-div99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= y -7.2e+18) (not (<= y 2.1e+35))) (+ 1.0 (* y (sqrt x))) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if ((y <= -7.2e+18) || !(y <= 2.1e+35)) {
tmp = 1.0 + (y * sqrt(x));
} else {
tmp = 1.0 - x;
}
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+18)) .or. (.not. (y <= 2.1d+35))) then
tmp = 1.0d0 + (y * sqrt(x))
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -7.2e+18) || !(y <= 2.1e+35)) {
tmp = 1.0 + (y * Math.sqrt(x));
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7.2e+18) or not (y <= 2.1e+35): tmp = 1.0 + (y * math.sqrt(x)) else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -7.2e+18) || !(y <= 2.1e+35)) tmp = Float64(1.0 + Float64(y * sqrt(x))); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -7.2e+18) || ~((y <= 2.1e+35))) tmp = 1.0 + (y * sqrt(x)); else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7.2e+18], N[Not[LessEqual[y, 2.1e+35]], $MachinePrecision]], N[(1.0 + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+18} \lor \neg \left(y \leq 2.1 \cdot 10^{+35}\right):\\
\;\;\;\;1 + y \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -7.2e18 or 2.0999999999999999e35 < y Initial program 99.7%
Taylor expanded in x around 0 95.1%
if -7.2e18 < y < 2.0999999999999999e35Initial program 100.0%
add-sqr-sqrt100.0%
pow2100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.6%
Final simplification97.4%
(FPCore (x y) :precision binary64 (if (or (<= y -7e+52) (not (<= y 2.4e+45))) (* y (sqrt x)) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if ((y <= -7e+52) || !(y <= 2.4e+45)) {
tmp = y * sqrt(x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-7d+52)) .or. (.not. (y <= 2.4d+45))) then
tmp = y * sqrt(x)
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -7e+52) || !(y <= 2.4e+45)) {
tmp = y * Math.sqrt(x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7e+52) or not (y <= 2.4e+45): tmp = y * math.sqrt(x) else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -7e+52) || !(y <= 2.4e+45)) tmp = Float64(y * sqrt(x)); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -7e+52) || ~((y <= 2.4e+45))) tmp = y * sqrt(x); else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7e+52], N[Not[LessEqual[y, 2.4e+45]], $MachinePrecision]], N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+52} \lor \neg \left(y \leq 2.4 \cdot 10^{+45}\right):\\
\;\;\;\;y \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -7e52 or 2.39999999999999989e45 < y Initial program 99.7%
Taylor expanded in x around inf 84.5%
associate--l+84.5%
distribute-rgt-in84.5%
Simplified99.5%
+-commutative99.5%
associate-+l-99.5%
*-commutative99.5%
sqrt-div99.5%
metadata-eval99.5%
un-div-inv99.6%
Applied egg-rr99.6%
clear-num99.5%
un-div-inv99.7%
pow1/299.7%
pow199.7%
pow-div99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 89.8%
if -7e52 < y < 2.39999999999999989e45Initial program 100.0%
add-sqr-sqrt100.0%
pow2100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 97.5%
Final simplification94.1%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (sqrt x)))) (if (<= x 0.096) (+ 1.0 t_0) (- t_0 x))))
double code(double x, double y) {
double t_0 = y * sqrt(x);
double tmp;
if (x <= 0.096) {
tmp = 1.0 + t_0;
} else {
tmp = t_0 - x;
}
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 = y * sqrt(x)
if (x <= 0.096d0) then
tmp = 1.0d0 + t_0
else
tmp = t_0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * Math.sqrt(x);
double tmp;
if (x <= 0.096) {
tmp = 1.0 + t_0;
} else {
tmp = t_0 - x;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt(x) tmp = 0 if x <= 0.096: tmp = 1.0 + t_0 else: tmp = t_0 - x return tmp
function code(x, y) t_0 = Float64(y * sqrt(x)) tmp = 0.0 if (x <= 0.096) tmp = Float64(1.0 + t_0); else tmp = Float64(t_0 - x); end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt(x); tmp = 0.0; if (x <= 0.096) tmp = 1.0 + t_0; else tmp = t_0 - x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.096], N[(1.0 + t$95$0), $MachinePrecision], N[(t$95$0 - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 0.096:\\
\;\;\;\;1 + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 - x\\
\end{array}
\end{array}
if x < 0.096000000000000002Initial program 99.8%
Taylor expanded in x around 0 99.0%
if 0.096000000000000002 < x Initial program 99.9%
Taylor expanded in x around inf 98.6%
Taylor expanded in x around 0 98.7%
neg-mul-198.7%
+-commutative98.7%
fma-define98.7%
fmm-def98.7%
Simplified98.7%
Final simplification98.8%
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Initial program 99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (* x x))))
(if (<= y -1.15e+156)
(/ t_0 (+ 1.0 x))
(if (<= y 7.5e+35) (- 1.0 x) (/ t_0 (+ 1.0 (/ 1.0 (/ -1.0 x))))))))
double code(double x, double y) {
double t_0 = 1.0 - (x * x);
double tmp;
if (y <= -1.15e+156) {
tmp = t_0 / (1.0 + x);
} else if (y <= 7.5e+35) {
tmp = 1.0 - x;
} else {
tmp = t_0 / (1.0 + (1.0 / (-1.0 / x)));
}
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 = 1.0d0 - (x * x)
if (y <= (-1.15d+156)) then
tmp = t_0 / (1.0d0 + x)
else if (y <= 7.5d+35) then
tmp = 1.0d0 - x
else
tmp = t_0 / (1.0d0 + (1.0d0 / ((-1.0d0) / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (x * x);
double tmp;
if (y <= -1.15e+156) {
tmp = t_0 / (1.0 + x);
} else if (y <= 7.5e+35) {
tmp = 1.0 - x;
} else {
tmp = t_0 / (1.0 + (1.0 / (-1.0 / x)));
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x * x) tmp = 0 if y <= -1.15e+156: tmp = t_0 / (1.0 + x) elif y <= 7.5e+35: tmp = 1.0 - x else: tmp = t_0 / (1.0 + (1.0 / (-1.0 / x))) return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x * x)) tmp = 0.0 if (y <= -1.15e+156) tmp = Float64(t_0 / Float64(1.0 + x)); elseif (y <= 7.5e+35) tmp = Float64(1.0 - x); else tmp = Float64(t_0 / Float64(1.0 + Float64(1.0 / Float64(-1.0 / x)))); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x * x); tmp = 0.0; if (y <= -1.15e+156) tmp = t_0 / (1.0 + x); elseif (y <= 7.5e+35) tmp = 1.0 - x; else tmp = t_0 / (1.0 + (1.0 / (-1.0 / x))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+156], N[(t$95$0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+35], N[(1.0 - x), $MachinePrecision], N[(t$95$0 / N[(1.0 + N[(1.0 / N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - x \cdot x\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+156}:\\
\;\;\;\;\frac{t\_0}{1 + x}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+35}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{1 + \frac{1}{\frac{-1}{x}}}\\
\end{array}
\end{array}
if y < -1.1499999999999999e156Initial program 99.7%
add-sqr-sqrt99.6%
pow299.6%
pow1/299.6%
sqrt-pow199.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 4.5%
sub-neg4.5%
flip-+26.7%
metadata-eval26.7%
Applied egg-rr26.7%
Taylor expanded in x around 0 26.7%
if -1.1499999999999999e156 < y < 7.4999999999999999e35Initial program 99.9%
add-sqr-sqrt99.9%
pow299.9%
pow1/299.9%
sqrt-pow199.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 84.8%
if 7.4999999999999999e35 < y Initial program 99.6%
add-sqr-sqrt99.3%
pow299.3%
pow1/299.3%
sqrt-pow199.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 9.8%
sub-neg9.8%
flip-+9.8%
metadata-eval9.8%
Applied egg-rr9.8%
add-sqr-sqrt0.0%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-unprod25.6%
pow225.6%
pow1/225.6%
metadata-eval25.6%
pow-div25.6%
pow125.6%
pow1/225.6%
pow225.6%
clear-num25.6%
clear-num25.6%
frac-times25.6%
metadata-eval25.6%
pow1/225.6%
pow125.6%
pow-div25.6%
metadata-eval25.6%
pow1/225.6%
pow125.6%
pow-div25.6%
metadata-eval25.6%
Applied egg-rr25.6%
pow-sqr25.6%
metadata-eval25.6%
unpow-125.6%
Simplified25.6%
Final simplification65.0%
(FPCore (x y) :precision binary64 (if (<= y -1.05e+148) (/ (- 1.0 (* x x)) (+ 1.0 x)) (if (<= y 2.4e+45) (- 1.0 x) (/ (+ 1.0 (* x x)) (+ 1.0 x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.05e+148) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else if (y <= 2.4e+45) {
tmp = 1.0 - x;
} else {
tmp = (1.0 + (x * x)) / (1.0 + 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.05d+148)) then
tmp = (1.0d0 - (x * x)) / (1.0d0 + x)
else if (y <= 2.4d+45) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 + (x * x)) / (1.0d0 + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.05e+148) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else if (y <= 2.4e+45) {
tmp = 1.0 - x;
} else {
tmp = (1.0 + (x * x)) / (1.0 + x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.05e+148: tmp = (1.0 - (x * x)) / (1.0 + x) elif y <= 2.4e+45: tmp = 1.0 - x else: tmp = (1.0 + (x * x)) / (1.0 + x) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.05e+148) tmp = Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)); elseif (y <= 2.4e+45) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 + Float64(x * x)) / Float64(1.0 + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.05e+148) tmp = (1.0 - (x * x)) / (1.0 + x); elseif (y <= 2.4e+45) tmp = 1.0 - x; else tmp = (1.0 + (x * x)) / (1.0 + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.05e+148], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+45], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+148}:\\
\;\;\;\;\frac{1 - x \cdot x}{1 + x}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+45}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + x \cdot x}{1 + x}\\
\end{array}
\end{array}
if y < -1.04999999999999999e148Initial program 99.7%
add-sqr-sqrt99.5%
pow299.5%
pow1/299.5%
sqrt-pow199.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 4.4%
sub-neg4.4%
flip-+24.5%
metadata-eval24.5%
Applied egg-rr24.5%
Taylor expanded in x around 0 24.5%
if -1.04999999999999999e148 < y < 2.39999999999999989e45Initial program 100.0%
add-sqr-sqrt99.9%
pow299.9%
pow1/299.9%
sqrt-pow199.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 86.3%
if 2.39999999999999989e45 < y Initial program 99.6%
add-sqr-sqrt99.3%
pow299.3%
pow1/299.3%
sqrt-pow199.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 7.1%
sub-neg7.1%
flip-+7.0%
metadata-eval7.0%
Applied egg-rr7.0%
neg-sub07.0%
sub-neg7.0%
add-sqr-sqrt0.0%
sqrt-unprod23.4%
sqr-neg23.4%
sqrt-unprod23.4%
add-sqr-sqrt23.4%
Applied egg-rr23.4%
Final simplification65.0%
(FPCore (x y) :precision binary64 (if (<= y -1.35e+154) (/ (- 1.0 (* x x)) (+ 1.0 x)) (- 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.35e+154) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else {
tmp = 1.0 - 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.35d+154)) then
tmp = (1.0d0 - (x * x)) / (1.0d0 + x)
else
tmp = 1.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.35e+154) {
tmp = (1.0 - (x * x)) / (1.0 + x);
} else {
tmp = 1.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.35e+154: tmp = (1.0 - (x * x)) / (1.0 + x) else: tmp = 1.0 - x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.35e+154) tmp = Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)); else tmp = Float64(1.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.35e+154) tmp = (1.0 - (x * x)) / (1.0 + x); else tmp = 1.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.35e+154], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 - x \cdot x}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;1 - x\\
\end{array}
\end{array}
if y < -1.35000000000000003e154Initial program 99.7%
add-sqr-sqrt99.6%
pow299.6%
pow1/299.6%
sqrt-pow199.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 4.5%
sub-neg4.5%
flip-+26.0%
metadata-eval26.0%
Applied egg-rr26.0%
Taylor expanded in x around 0 26.0%
if -1.35000000000000003e154 < y Initial program 99.9%
add-sqr-sqrt99.7%
pow299.7%
pow1/299.7%
sqrt-pow199.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 66.2%
Final simplification61.5%
(FPCore (x y) :precision binary64 (if (<= x 0.096) 1.0 (- x)))
double code(double x, double y) {
double tmp;
if (x <= 0.096) {
tmp = 1.0;
} else {
tmp = -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.096d0) then
tmp = 1.0d0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.096) {
tmp = 1.0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.096: tmp = 1.0 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if (x <= 0.096) tmp = 1.0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.096) tmp = 1.0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.096], 1.0, (-x)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.096:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if x < 0.096000000000000002Initial program 99.8%
Taylor expanded in x around 0 99.0%
Taylor expanded in y around 0 64.1%
if 0.096000000000000002 < x Initial program 99.9%
Taylor expanded in x around inf 98.6%
Taylor expanded in y around 0 52.5%
neg-mul-152.5%
Simplified52.5%
(FPCore (x y) :precision binary64 (- 1.0 x))
double code(double x, double y) {
return 1.0 - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - x
end function
public static double code(double x, double y) {
return 1.0 - x;
}
def code(x, y): return 1.0 - x
function code(x, y) return Float64(1.0 - x) end
function tmp = code(x, y) tmp = 1.0 - x; end
code[x_, y_] := N[(1.0 - x), $MachinePrecision]
\begin{array}{l}
\\
1 - x
\end{array}
Initial program 99.8%
add-sqr-sqrt99.7%
pow299.7%
pow1/299.7%
sqrt-pow199.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 59.0%
(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.8%
Taylor expanded in x around 0 71.9%
Taylor expanded in y around 0 31.3%
herbie shell --seed 2024186
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
:precision binary64
(+ (- 1.0 x) (* y (sqrt x))))