Average Error: 13.6 → 0.3
Time: 9.4s
Precision: binary64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
\[\frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)} - \frac{x}{\tan B} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(FPCore (F B x)
 :precision binary64
 (- (/ F (* (sin B) (hypot F (sqrt 2.0)))) (/ x (tan B))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
double code(double F, double B, double x) {
	return (F / (sin(B) * hypot(F, sqrt(2.0)))) - (x / tan(B));
}
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
public static double code(double F, double B, double x) {
	return (F / (Math.sin(B) * Math.hypot(F, Math.sqrt(2.0)))) - (x / Math.tan(B));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
def code(F, B, x):
	return (F / (math.sin(B) * math.hypot(F, math.sqrt(2.0)))) - (x / math.tan(B))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function code(F, B, x)
	return Float64(Float64(F / Float64(sin(B) * hypot(F, sqrt(2.0)))) - Float64(x / tan(B)))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
function tmp = code(F, B, x)
	tmp = (F / (sin(B) * hypot(F, sqrt(2.0)))) - (x / tan(B));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[F_, B_, x_] := N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[F ^ 2 + N[Sqrt[2.0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)} - \frac{x}{\tan B}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.6

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Simplified10.3

    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
  3. Applied egg-rr10.3

    \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
  4. Taylor expanded in B around inf 10.3

    \[\leadsto \frac{F}{\color{blue}{\sin B \cdot \sqrt{{F}^{2} + \left(2 + 2 \cdot x\right)}}} - \frac{x}{\tan B} \]
  5. Simplified6.5

    \[\leadsto \frac{F}{\color{blue}{\mathsf{hypot}\left(F, \sqrt{\mathsf{fma}\left(2, x, 2\right)}\right) \cdot \sin B}} - \frac{x}{\tan B} \]
  6. Taylor expanded in x around 0 10.3

    \[\leadsto \frac{F}{\color{blue}{\sqrt{{F}^{2} + {\left(\sqrt{2}\right)}^{2}} \cdot \sin B}} - \frac{x}{\tan B} \]
  7. Simplified0.3

    \[\leadsto \frac{F}{\color{blue}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)}} - \frac{x}{\tan B} \]
  8. Final simplification0.3

    \[\leadsto \frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)} - \frac{x}{\tan B} \]

Reproduce

herbie shell --seed 2022212 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  :precision binary64
  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))