
(FPCore (p x) :precision binary64 (sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))
double code(double p, double x) {
return sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x)))))));
}
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
code = sqrt((0.5d0 * (1.0d0 + (x / sqrt((((4.0d0 * p) * p) + (x * x)))))))
end function
public static double code(double p, double x) {
return Math.sqrt((0.5 * (1.0 + (x / Math.sqrt((((4.0 * p) * p) + (x * x)))))));
}
def code(p, x): return math.sqrt((0.5 * (1.0 + (x / math.sqrt((((4.0 * p) * p) + (x * x)))))))
function code(p, x) return sqrt(Float64(0.5 * Float64(1.0 + Float64(x / sqrt(Float64(Float64(Float64(4.0 * p) * p) + Float64(x * x))))))) end
function tmp = code(p, x) tmp = sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x))))))); end
code[p_, x_] := N[Sqrt[N[(0.5 * N[(1.0 + N[(x / N[Sqrt[N[(N[(N[(4.0 * p), $MachinePrecision] * p), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (p x) :precision binary64 (sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))
double code(double p, double x) {
return sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x)))))));
}
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
code = sqrt((0.5d0 * (1.0d0 + (x / sqrt((((4.0d0 * p) * p) + (x * x)))))))
end function
public static double code(double p, double x) {
return Math.sqrt((0.5 * (1.0 + (x / Math.sqrt((((4.0 * p) * p) + (x * x)))))));
}
def code(p, x): return math.sqrt((0.5 * (1.0 + (x / math.sqrt((((4.0 * p) * p) + (x * x)))))))
function code(p, x) return sqrt(Float64(0.5 * Float64(1.0 + Float64(x / sqrt(Float64(Float64(Float64(4.0 * p) * p) + Float64(x * x))))))) end
function tmp = code(p, x) tmp = sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x))))))); end
code[p_, x_] := N[Sqrt[N[(0.5 * N[(1.0 + N[(x / N[Sqrt[N[(N[(N[(4.0 * p), $MachinePrecision] * p), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}
\end{array}
NOTE: p should be positive before calling this function (FPCore (p x) :precision binary64 (if (<= (/ x (sqrt (+ (* p (* 4.0 p)) (* x x)))) -0.9999995) (/ (- p) x) (sqrt (* 0.5 (+ 1.0 (pow (/ (hypot x (* p 2.0)) x) -1.0))))))
p = abs(p);
double code(double p, double x) {
double tmp;
if ((x / sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995) {
tmp = -p / x;
} else {
tmp = sqrt((0.5 * (1.0 + pow((hypot(x, (p * 2.0)) / x), -1.0))));
}
return tmp;
}
p = Math.abs(p);
public static double code(double p, double x) {
double tmp;
if ((x / Math.sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995) {
tmp = -p / x;
} else {
tmp = Math.sqrt((0.5 * (1.0 + Math.pow((Math.hypot(x, (p * 2.0)) / x), -1.0))));
}
return tmp;
}
p = abs(p) def code(p, x): tmp = 0 if (x / math.sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995: tmp = -p / x else: tmp = math.sqrt((0.5 * (1.0 + math.pow((math.hypot(x, (p * 2.0)) / x), -1.0)))) return tmp
p = abs(p) function code(p, x) tmp = 0.0 if (Float64(x / sqrt(Float64(Float64(p * Float64(4.0 * p)) + Float64(x * x)))) <= -0.9999995) tmp = Float64(Float64(-p) / x); else tmp = sqrt(Float64(0.5 * Float64(1.0 + (Float64(hypot(x, Float64(p * 2.0)) / x) ^ -1.0)))); end return tmp end
p = abs(p) function tmp_2 = code(p, x) tmp = 0.0; if ((x / sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995) tmp = -p / x; else tmp = sqrt((0.5 * (1.0 + ((hypot(x, (p * 2.0)) / x) ^ -1.0)))); end tmp_2 = tmp; end
NOTE: p should be positive before calling this function code[p_, x_] := If[LessEqual[N[(x / N[Sqrt[N[(N[(p * N[(4.0 * p), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.9999995], N[((-p) / x), $MachinePrecision], N[Sqrt[N[(0.5 * N[(1.0 + N[Power[N[(N[Sqrt[x ^ 2 + N[(p * 2.0), $MachinePrecision] ^ 2], $MachinePrecision] / x), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
p = |p|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}} \leq -0.9999995:\\
\;\;\;\;\frac{-p}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + {\left(\frac{\mathsf{hypot}\left(x, p \cdot 2\right)}{x}\right)}^{-1}\right)}\\
\end{array}
\end{array}
if (/.f64 x (sqrt.f64 (+.f64 (*.f64 (*.f64 4 p) p) (*.f64 x x)))) < -0.999999500000000041Initial program 16.2%
Taylor expanded in x around -inf 47.1%
unpow247.1%
unpow247.1%
Simplified47.1%
Taylor expanded in p around -inf 53.6%
associate-*r/53.6%
neg-mul-153.6%
Simplified53.6%
if -0.999999500000000041 < (/.f64 x (sqrt.f64 (+.f64 (*.f64 (*.f64 4 p) p) (*.f64 x x)))) Initial program 99.8%
clear-num99.9%
inv-pow99.9%
+-commutative99.9%
add-sqr-sqrt99.9%
hypot-def99.9%
associate-*l*99.9%
sqrt-prod99.9%
metadata-eval99.9%
sqrt-unprod43.2%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification86.1%
NOTE: p should be positive before calling this function (FPCore (p x) :precision binary64 (if (<= (/ x (sqrt (+ (* p (* 4.0 p)) (* x x)))) -0.9999995) (/ (- p) x) (sqrt (* 0.5 (+ 1.0 (/ x (hypot (* p 2.0) x)))))))
p = abs(p);
double code(double p, double x) {
double tmp;
if ((x / sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995) {
tmp = -p / x;
} else {
tmp = sqrt((0.5 * (1.0 + (x / hypot((p * 2.0), x)))));
}
return tmp;
}
p = Math.abs(p);
public static double code(double p, double x) {
double tmp;
if ((x / Math.sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995) {
tmp = -p / x;
} else {
tmp = Math.sqrt((0.5 * (1.0 + (x / Math.hypot((p * 2.0), x)))));
}
return tmp;
}
p = abs(p) def code(p, x): tmp = 0 if (x / math.sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995: tmp = -p / x else: tmp = math.sqrt((0.5 * (1.0 + (x / math.hypot((p * 2.0), x))))) return tmp
p = abs(p) function code(p, x) tmp = 0.0 if (Float64(x / sqrt(Float64(Float64(p * Float64(4.0 * p)) + Float64(x * x)))) <= -0.9999995) tmp = Float64(Float64(-p) / x); else tmp = sqrt(Float64(0.5 * Float64(1.0 + Float64(x / hypot(Float64(p * 2.0), x))))); end return tmp end
p = abs(p) function tmp_2 = code(p, x) tmp = 0.0; if ((x / sqrt(((p * (4.0 * p)) + (x * x)))) <= -0.9999995) tmp = -p / x; else tmp = sqrt((0.5 * (1.0 + (x / hypot((p * 2.0), x))))); end tmp_2 = tmp; end
NOTE: p should be positive before calling this function code[p_, x_] := If[LessEqual[N[(x / N[Sqrt[N[(N[(p * N[(4.0 * p), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.9999995], N[((-p) / x), $MachinePrecision], N[Sqrt[N[(0.5 * N[(1.0 + N[(x / N[Sqrt[N[(p * 2.0), $MachinePrecision] ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
p = |p|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}} \leq -0.9999995:\\
\;\;\;\;\frac{-p}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{x}{\mathsf{hypot}\left(p \cdot 2, x\right)}\right)}\\
\end{array}
\end{array}
if (/.f64 x (sqrt.f64 (+.f64 (*.f64 (*.f64 4 p) p) (*.f64 x x)))) < -0.999999500000000041Initial program 16.2%
Taylor expanded in x around -inf 47.1%
unpow247.1%
unpow247.1%
Simplified47.1%
Taylor expanded in p around -inf 53.6%
associate-*r/53.6%
neg-mul-153.6%
Simplified53.6%
if -0.999999500000000041 < (/.f64 x (sqrt.f64 (+.f64 (*.f64 (*.f64 4 p) p) (*.f64 x x)))) Initial program 99.8%
add-sqr-sqrt99.8%
hypot-def99.8%
associate-*l*99.8%
sqrt-prod99.8%
metadata-eval99.8%
sqrt-unprod43.2%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification86.1%
NOTE: p should be positive before calling this function
(FPCore (p x)
:precision binary64
(let* ((t_0 (/ (- p) x)))
(if (<= p 2.3e-258)
1.0
(if (<= p 1.7e-204)
t_0
(if (<= p 3.5e-145) 1.0 (if (<= p 1.12e-41) t_0 (sqrt 0.5)))))))p = abs(p);
double code(double p, double x) {
double t_0 = -p / x;
double tmp;
if (p <= 2.3e-258) {
tmp = 1.0;
} else if (p <= 1.7e-204) {
tmp = t_0;
} else if (p <= 3.5e-145) {
tmp = 1.0;
} else if (p <= 1.12e-41) {
tmp = t_0;
} else {
tmp = sqrt(0.5);
}
return tmp;
}
NOTE: p should be positive before calling this function
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -p / x
if (p <= 2.3d-258) then
tmp = 1.0d0
else if (p <= 1.7d-204) then
tmp = t_0
else if (p <= 3.5d-145) then
tmp = 1.0d0
else if (p <= 1.12d-41) then
tmp = t_0
else
tmp = sqrt(0.5d0)
end if
code = tmp
end function
p = Math.abs(p);
public static double code(double p, double x) {
double t_0 = -p / x;
double tmp;
if (p <= 2.3e-258) {
tmp = 1.0;
} else if (p <= 1.7e-204) {
tmp = t_0;
} else if (p <= 3.5e-145) {
tmp = 1.0;
} else if (p <= 1.12e-41) {
tmp = t_0;
} else {
tmp = Math.sqrt(0.5);
}
return tmp;
}
p = abs(p) def code(p, x): t_0 = -p / x tmp = 0 if p <= 2.3e-258: tmp = 1.0 elif p <= 1.7e-204: tmp = t_0 elif p <= 3.5e-145: tmp = 1.0 elif p <= 1.12e-41: tmp = t_0 else: tmp = math.sqrt(0.5) return tmp
p = abs(p) function code(p, x) t_0 = Float64(Float64(-p) / x) tmp = 0.0 if (p <= 2.3e-258) tmp = 1.0; elseif (p <= 1.7e-204) tmp = t_0; elseif (p <= 3.5e-145) tmp = 1.0; elseif (p <= 1.12e-41) tmp = t_0; else tmp = sqrt(0.5); end return tmp end
p = abs(p) function tmp_2 = code(p, x) t_0 = -p / x; tmp = 0.0; if (p <= 2.3e-258) tmp = 1.0; elseif (p <= 1.7e-204) tmp = t_0; elseif (p <= 3.5e-145) tmp = 1.0; elseif (p <= 1.12e-41) tmp = t_0; else tmp = sqrt(0.5); end tmp_2 = tmp; end
NOTE: p should be positive before calling this function
code[p_, x_] := Block[{t$95$0 = N[((-p) / x), $MachinePrecision]}, If[LessEqual[p, 2.3e-258], 1.0, If[LessEqual[p, 1.7e-204], t$95$0, If[LessEqual[p, 3.5e-145], 1.0, If[LessEqual[p, 1.12e-41], t$95$0, N[Sqrt[0.5], $MachinePrecision]]]]]]
\begin{array}{l}
p = |p|\\
\\
\begin{array}{l}
t_0 := \frac{-p}{x}\\
\mathbf{if}\;p \leq 2.3 \cdot 10^{-258}:\\
\;\;\;\;1\\
\mathbf{elif}\;p \leq 1.7 \cdot 10^{-204}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;p \leq 3.5 \cdot 10^{-145}:\\
\;\;\;\;1\\
\mathbf{elif}\;p \leq 1.12 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5}\\
\end{array}
\end{array}
if p < 2.29999999999999993e-258 or 1.7000000000000001e-204 < p < 3.49999999999999997e-145Initial program 73.4%
Taylor expanded in x around inf 36.6%
if 2.29999999999999993e-258 < p < 1.7000000000000001e-204 or 3.49999999999999997e-145 < p < 1.11999999999999999e-41Initial program 56.8%
Taylor expanded in x around -inf 24.3%
unpow224.3%
unpow224.3%
Simplified24.3%
Taylor expanded in p around -inf 58.8%
associate-*r/58.8%
neg-mul-158.8%
Simplified58.8%
if 1.11999999999999999e-41 < p Initial program 90.2%
Taylor expanded in x around 0 79.1%
Final simplification49.4%
NOTE: p should be positive before calling this function (FPCore (p x) :precision binary64 (if (<= p 2e-39) (/ (- p) x) (sqrt 0.5)))
p = abs(p);
double code(double p, double x) {
double tmp;
if (p <= 2e-39) {
tmp = -p / x;
} else {
tmp = sqrt(0.5);
}
return tmp;
}
NOTE: p should be positive before calling this function
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
real(8) :: tmp
if (p <= 2d-39) then
tmp = -p / x
else
tmp = sqrt(0.5d0)
end if
code = tmp
end function
p = Math.abs(p);
public static double code(double p, double x) {
double tmp;
if (p <= 2e-39) {
tmp = -p / x;
} else {
tmp = Math.sqrt(0.5);
}
return tmp;
}
p = abs(p) def code(p, x): tmp = 0 if p <= 2e-39: tmp = -p / x else: tmp = math.sqrt(0.5) return tmp
p = abs(p) function code(p, x) tmp = 0.0 if (p <= 2e-39) tmp = Float64(Float64(-p) / x); else tmp = sqrt(0.5); end return tmp end
p = abs(p) function tmp_2 = code(p, x) tmp = 0.0; if (p <= 2e-39) tmp = -p / x; else tmp = sqrt(0.5); end tmp_2 = tmp; end
NOTE: p should be positive before calling this function code[p_, x_] := If[LessEqual[p, 2e-39], N[((-p) / x), $MachinePrecision], N[Sqrt[0.5], $MachinePrecision]]
\begin{array}{l}
p = |p|\\
\\
\begin{array}{l}
\mathbf{if}\;p \leq 2 \cdot 10^{-39}:\\
\;\;\;\;\frac{-p}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5}\\
\end{array}
\end{array}
if p < 1.99999999999999986e-39Initial program 70.4%
Taylor expanded in x around -inf 18.1%
unpow218.1%
unpow218.1%
Simplified18.1%
Taylor expanded in p around -inf 20.1%
associate-*r/20.1%
neg-mul-120.1%
Simplified20.1%
if 1.99999999999999986e-39 < p Initial program 90.2%
Taylor expanded in x around 0 79.1%
Final simplification33.7%
NOTE: p should be positive before calling this function (FPCore (p x) :precision binary64 (if (<= x -4e-311) (/ (- p) x) (* x p)))
p = abs(p);
double code(double p, double x) {
double tmp;
if (x <= -4e-311) {
tmp = -p / x;
} else {
tmp = x * p;
}
return tmp;
}
NOTE: p should be positive before calling this function
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-4d-311)) then
tmp = -p / x
else
tmp = x * p
end if
code = tmp
end function
p = Math.abs(p);
public static double code(double p, double x) {
double tmp;
if (x <= -4e-311) {
tmp = -p / x;
} else {
tmp = x * p;
}
return tmp;
}
p = abs(p) def code(p, x): tmp = 0 if x <= -4e-311: tmp = -p / x else: tmp = x * p return tmp
p = abs(p) function code(p, x) tmp = 0.0 if (x <= -4e-311) tmp = Float64(Float64(-p) / x); else tmp = Float64(x * p); end return tmp end
p = abs(p) function tmp_2 = code(p, x) tmp = 0.0; if (x <= -4e-311) tmp = -p / x; else tmp = x * p; end tmp_2 = tmp; end
NOTE: p should be positive before calling this function code[p_, x_] := If[LessEqual[x, -4e-311], N[((-p) / x), $MachinePrecision], N[(x * p), $MachinePrecision]]
\begin{array}{l}
p = |p|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\frac{-p}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot p\\
\end{array}
\end{array}
if x < -3.99999999999979e-311Initial program 52.3%
Taylor expanded in x around -inf 28.9%
unpow228.9%
unpow228.9%
Simplified28.9%
Taylor expanded in p around -inf 32.1%
associate-*r/32.1%
neg-mul-132.1%
Simplified32.1%
if -3.99999999999979e-311 < x Initial program 100.0%
Taylor expanded in x around -inf 4.6%
unpow24.6%
unpow24.6%
Simplified4.6%
Applied egg-rr3.0%
expm1-def3.1%
expm1-log1p3.3%
*-commutative3.3%
Simplified3.3%
Final simplification18.4%
NOTE: p should be positive before calling this function (FPCore (p x) :precision binary64 (* x p))
p = abs(p);
double code(double p, double x) {
return x * p;
}
NOTE: p should be positive before calling this function
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
code = x * p
end function
p = Math.abs(p);
public static double code(double p, double x) {
return x * p;
}
p = abs(p) def code(p, x): return x * p
p = abs(p) function code(p, x) return Float64(x * p) end
p = abs(p) function tmp = code(p, x) tmp = x * p; end
NOTE: p should be positive before calling this function code[p_, x_] := N[(x * p), $MachinePrecision]
\begin{array}{l}
p = |p|\\
\\
x \cdot p
\end{array}
Initial program 75.0%
Taylor expanded in x around -inf 17.3%
unpow217.3%
unpow217.3%
Simplified17.3%
Applied egg-rr6.4%
expm1-def3.3%
expm1-log1p3.5%
*-commutative3.5%
Simplified3.5%
Final simplification3.5%
NOTE: p should be positive before calling this function (FPCore (p x) :precision binary64 (/ p x))
p = abs(p);
double code(double p, double x) {
return p / x;
}
NOTE: p should be positive before calling this function
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
code = p / x
end function
p = Math.abs(p);
public static double code(double p, double x) {
return p / x;
}
p = abs(p) def code(p, x): return p / x
p = abs(p) function code(p, x) return Float64(p / x) end
p = abs(p) function tmp = code(p, x) tmp = p / x; end
NOTE: p should be positive before calling this function code[p_, x_] := N[(p / x), $MachinePrecision]
\begin{array}{l}
p = |p|\\
\\
\frac{p}{x}
\end{array}
Initial program 75.0%
Taylor expanded in x around -inf 17.3%
unpow217.3%
unpow217.3%
Simplified17.3%
Taylor expanded in p around 0 20.2%
Final simplification20.2%
(FPCore (p x) :precision binary64 (sqrt (+ 0.5 (/ (copysign 0.5 x) (hypot 1.0 (/ (* 2.0 p) x))))))
double code(double p, double x) {
return sqrt((0.5 + (copysign(0.5, x) / hypot(1.0, ((2.0 * p) / x)))));
}
public static double code(double p, double x) {
return Math.sqrt((0.5 + (Math.copySign(0.5, x) / Math.hypot(1.0, ((2.0 * p) / x)))));
}
def code(p, x): return math.sqrt((0.5 + (math.copysign(0.5, x) / math.hypot(1.0, ((2.0 * p) / x)))))
function code(p, x) return sqrt(Float64(0.5 + Float64(copysign(0.5, x) / hypot(1.0, Float64(Float64(2.0 * p) / x))))) end
function tmp = code(p, x) tmp = sqrt((0.5 + ((sign(x) * abs(0.5)) / hypot(1.0, ((2.0 * p) / x))))); end
code[p_, x_] := N[Sqrt[N[(0.5 + N[(N[With[{TMP1 = Abs[0.5], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(2.0 * p), $MachinePrecision] / x), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{0.5 + \frac{\mathsf{copysign}\left(0.5, x\right)}{\mathsf{hypot}\left(1, \frac{2 \cdot p}{x}\right)}}
\end{array}
herbie shell --seed 2023278
(FPCore (p x)
:name "Given's Rotation SVD example"
:precision binary64
:pre (and (< 1e-150 (fabs x)) (< (fabs x) 1e+150))
:herbie-target
(sqrt (+ 0.5 (/ (copysign 0.5 x) (hypot 1.0 (/ (* 2.0 p) x)))))
(sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))