VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.3%
Time: 6.3s
Alternatives: 19
Speedup: 1.6×

Specification

?
\[\begin{array}{l} \\ \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)} \end{array} \]
(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))))))
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
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)));
}
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)))
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 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
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]
\begin{array}{l}

\\
\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)}
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 19 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 76.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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)} \end{array} \]
(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))))))
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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
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)));
}
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)))
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 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
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]
\begin{array}{l}

\\
\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)}
\end{array}

Alternative 1: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+86}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.6e+86)
   (/ (- (fma (cos B) x 1.0)) (sin B))
   (if (<= F 100000000.0)
     (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (/ (- x) (tan B)))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.6e+86) {
		tmp = -fma(cos(B), x, 1.0) / sin(B);
	} else if (F <= 100000000.0) {
		tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.6e+86)
		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
	elseif (F <= 100000000.0)
		tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / tan(B)));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -2.6e+86], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+86}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.5999999999999998e86

    1. Initial program 47.5%

      \[\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. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
    4. Applied rewrites34.1%

      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
    5. Taylor expanded in F around 0

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
      2. lift-neg.f6426.1

        \[\leadsto \frac{-x}{B} \]
    7. Applied rewrites26.1%

      \[\leadsto \frac{-x}{B} \]
    8. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{\cos B \cdot x}{\sin B}\right)\right) \]
      3. div-addN/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{-\left(1 + \cos B \cdot x\right)}{\sin \color{blue}{B}} \]
      7. +-commutativeN/A

        \[\leadsto \frac{-\left(\cos B \cdot x + 1\right)}{\sin B} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      9. lower-cos.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      10. lift-sin.f6499.7

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    10. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

    if -2.5999999999999998e86 < F < 1e8

    1. Initial program 98.8%

      \[\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. Applied rewrites98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \left(-x\right) \cdot {\tan B}^{-1}\right)} \]
    3. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot {\tan B}^{-1}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot {\tan B}^{-1}}\right) \]
      3. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{{\tan B}^{-1}}\right) \]
      4. lift-tan.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot {\color{blue}{\tan B}}^{-1}\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\mathsf{neg}\left(x \cdot {\tan B}^{-1}\right)}\right) \]
      6. inv-powN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) \]
      8. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}}\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B}\right) \]
      10. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}}\right) \]
      11. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\color{blue}{-x}}{\tan B}\right) \]
      12. lift-tan.f6499.0

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\color{blue}{\tan B}}\right) \]
    4. Applied rewrites99.0%

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

    if 1e8 < F

    1. Initial program 57.3%

      \[\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. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    3. Step-by-step derivation
      1. sub-divN/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6499.7

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+86}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.6e+86)
   (/ (- (fma (cos B) x 1.0)) (sin B))
   (if (<= F 100000000.0)
     (fma
      (/ 1.0 (sqrt (fma F F (fma x 2.0 2.0))))
      (/ F (sin B))
      (/ (- x) (tan B)))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.6e+86) {
		tmp = -fma(cos(B), x, 1.0) / sin(B);
	} else if (F <= 100000000.0) {
		tmp = fma((1.0 / sqrt(fma(F, F, fma(x, 2.0, 2.0)))), (F / sin(B)), (-x / tan(B)));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.6e+86)
		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
	elseif (F <= 100000000.0)
		tmp = fma(Float64(1.0 / sqrt(fma(F, F, fma(x, 2.0, 2.0)))), Float64(F / sin(B)), Float64(Float64(-x) / tan(B)));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -2.6e+86], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+86}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.5999999999999998e86

    1. Initial program 47.5%

      \[\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. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
    4. Applied rewrites34.1%

      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
    5. Taylor expanded in F around 0

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
      2. lift-neg.f6426.1

        \[\leadsto \frac{-x}{B} \]
    7. Applied rewrites26.1%

      \[\leadsto \frac{-x}{B} \]
    8. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{\cos B \cdot x}{\sin B}\right)\right) \]
      3. div-addN/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{-\left(1 + \cos B \cdot x\right)}{\sin \color{blue}{B}} \]
      7. +-commutativeN/A

        \[\leadsto \frac{-\left(\cos B \cdot x + 1\right)}{\sin B} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      9. lower-cos.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      10. lift-sin.f6499.7

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    10. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

    if -2.5999999999999998e86 < F < 1e8

    1. Initial program 98.8%

      \[\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. Applied rewrites98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \left(-x\right) \cdot {\tan B}^{-1}\right)} \]
    3. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot {\tan B}^{-1}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot {\tan B}^{-1}}\right) \]
      3. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{{\tan B}^{-1}}\right) \]
      4. lift-tan.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot {\color{blue}{\tan B}}^{-1}\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\mathsf{neg}\left(x \cdot {\tan B}^{-1}\right)}\right) \]
      6. inv-powN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) \]
      8. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}}\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B}\right) \]
      10. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}}\right) \]
      11. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\color{blue}{-x}}{\tan B}\right) \]
      12. lift-tan.f6499.0

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\color{blue}{\tan B}}\right) \]
    4. Applied rewrites99.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      2. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left({\color{blue}{\left(2 \cdot x + \mathsf{fma}\left(F, F, 2\right)\right)}}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      3. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(2 \cdot x + \color{blue}{\left(F \cdot F + 2\right)}\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      4. pow2N/A

        \[\leadsto \mathsf{fma}\left({\left(2 \cdot x + \left(\color{blue}{{F}^{2}} + 2\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      5. associate-+r+N/A

        \[\leadsto \mathsf{fma}\left({\color{blue}{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left({\left(\left(2 \cdot x + \color{blue}{F \cdot F}\right) + 2\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left({\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      8. sqrt-pow1N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\sqrt{{\left(\left(2 \cdot x + \color{blue}{{F}^{2}}\right) + 2\right)}^{-1}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\sqrt{{\color{blue}{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}}^{-1}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      11. inv-powN/A

        \[\leadsto \mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      12. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\sqrt{1}}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{1}}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      14. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      15. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      16. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt{\left(2 \cdot x + \color{blue}{F \cdot F}\right) + 2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      17. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt{\left(2 \cdot x + F \cdot F\right) + 2}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
    6. Applied rewrites98.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]

    if 1e8 < F

    1. Initial program 57.3%

      \[\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. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    3. Step-by-step derivation
      1. sub-divN/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6499.7

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 91.6% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -92000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 40000:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -92000.0)
   (/ (- (fma (cos B) x 1.0)) (sin B))
   (if (<= F 40000.0)
     (+
      (- (/ (* x 1.0) (tan B)))
      (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -92000.0) {
		tmp = -fma(cos(B), x, 1.0) / sin(B);
	} else if (F <= 40000.0) {
		tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -92000.0)
		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
	elseif (F <= 40000.0)
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -92000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 40000.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -92000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 40000:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -92000

    1. Initial program 58.0%

      \[\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. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
    5. Taylor expanded in F around 0

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
      2. lift-neg.f6424.4

        \[\leadsto \frac{-x}{B} \]
    7. Applied rewrites24.4%

      \[\leadsto \frac{-x}{B} \]
    8. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{\cos B \cdot x}{\sin B}\right)\right) \]
      3. div-addN/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{-\left(1 + \cos B \cdot x\right)}{\sin \color{blue}{B}} \]
      7. +-commutativeN/A

        \[\leadsto \frac{-\left(\cos B \cdot x + 1\right)}{\sin B} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      9. lower-cos.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      10. lift-sin.f6499.7

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    10. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

    if -92000 < F < 4e4

    1. Initial program 99.4%

      \[\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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

        \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
      3. lift-tan.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      4. associate-*r/N/A

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      6. lower-*.f64N/A

        \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
      7. lift-tan.f6499.6

        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied rewrites99.6%

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
    4. Taylor expanded in B around 0

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lift-/.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      3. sqrt-divN/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. metadata-evalN/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      6. lower-sqrt.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
      7. pow2N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
      8. lower-+.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
      9. lift-*.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
      10. lift-fma.f6482.0

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
    6. Applied rewrites82.0%

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]

    if 4e4 < F

    1. Initial program 57.5%

      \[\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. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    3. Step-by-step derivation
      1. sub-divN/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      2. lower-/.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\color{blue}{\sin B}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{1 - x \cdot \cos B}{\sin \color{blue}{B}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      6. lower-cos.f64N/A

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      7. lift-sin.f6499.7

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 79.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -92000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{+77}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\sin B}^{-1}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -92000.0)
   (/ (- (fma (cos B) x 1.0)) (sin B))
   (if (<= F 1.95e+77)
     (+
      (- (/ (* x 1.0) (tan B)))
      (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
     (pow (sin B) -1.0))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -92000.0) {
		tmp = -fma(cos(B), x, 1.0) / sin(B);
	} else if (F <= 1.95e+77) {
		tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
	} else {
		tmp = pow(sin(B), -1.0);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -92000.0)
		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
	elseif (F <= 1.95e+77)
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))));
	else
		tmp = sin(B) ^ -1.0;
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -92000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e+77], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -92000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\

\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -92000

    1. Initial program 58.0%

      \[\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. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
    5. Taylor expanded in F around 0

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
      2. lift-neg.f6424.4

        \[\leadsto \frac{-x}{B} \]
    7. Applied rewrites24.4%

      \[\leadsto \frac{-x}{B} \]
    8. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{\cos B \cdot x}{\sin B}\right)\right) \]
      3. div-addN/A

        \[\leadsto \mathsf{neg}\left(\frac{1 + \cos B \cdot x}{\sin B}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(1 + \cos B \cdot x\right)\right)}{\color{blue}{\sin B}} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{-\left(1 + \cos B \cdot x\right)}{\sin \color{blue}{B}} \]
      7. +-commutativeN/A

        \[\leadsto \frac{-\left(\cos B \cdot x + 1\right)}{\sin B} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      9. lower-cos.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
      10. lift-sin.f6499.7

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B} \]
    10. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

    if -92000 < F < 1.9499999999999999e77

    1. Initial program 98.9%

      \[\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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

        \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
      3. lift-tan.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      4. associate-*r/N/A

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      6. lower-*.f64N/A

        \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
      7. lift-tan.f6499.1

        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Applied rewrites99.1%

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
    4. Taylor expanded in B around 0

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      2. lift-/.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      3. sqrt-divN/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      4. metadata-evalN/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      5. lower-/.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      6. lower-sqrt.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
      7. pow2N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
      8. lower-+.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
      9. lift-*.f64N/A

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
      10. lift-fma.f6480.5

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
    6. Applied rewrites80.5%

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]

    if 1.9499999999999999e77 < F

    1. Initial program 48.2%

      \[\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. Applied rewrites48.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \left(-x\right) \cdot {\tan B}^{-1}\right)} \]
    3. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot {\tan B}^{-1}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot {\tan B}^{-1}}\right) \]
      3. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{{\tan B}^{-1}}\right) \]
      4. lift-tan.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot {\color{blue}{\tan B}}^{-1}\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\mathsf{neg}\left(x \cdot {\tan B}^{-1}\right)}\right) \]
      6. inv-powN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) \]
      8. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}}\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B}\right) \]
      10. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}}\right) \]
      11. lift-neg.f64N/A

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\color{blue}{-x}}{\tan B}\right) \]
      12. lift-tan.f6448.2

        \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\color{blue}{\tan B}}\right) \]
    4. Applied rewrites48.2%

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
      2. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
      4. inv-powN/A

        \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
      5. lower-pow.f64N/A

        \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
      6. +-commutativeN/A

        \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
      7. pow2N/A

        \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
      8. lift-fma.f64N/A

        \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
      9. lift-sin.f64N/A

        \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
      10. lift-/.f6414.4

        \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\color{blue}{\sin B}} \]
    7. Applied rewrites14.4%

      \[\leadsto \color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}} \]
    8. Taylor expanded in F around inf

      \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
    9. Step-by-step derivation
      1. inv-powN/A

        \[\leadsto {\sin B}^{-1} \]
      2. lower-pow.f64N/A

        \[\leadsto {\sin B}^{-1} \]
      3. lift-sin.f6451.6

        \[\leadsto {\sin B}^{-1} \]
    10. Applied rewrites51.6%

      \[\leadsto {\sin B}^{\color{blue}{-1}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 74.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1150000:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{+77}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\sin B}^{-1}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1150000.0)
   (- (/ (+ 1.0 x) (sin B)))
   (if (<= F 1.95e+77)
     (+
      (- (/ (* x 1.0) (tan B)))
      (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
     (pow (sin B) -1.0))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1150000.0) {
		tmp = -((1.0 + x) / sin(B));
	} else if (F <= 1.95e+77) {
		tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
	} else {
		tmp = pow(sin(B), -1.0);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -1150000.0)
		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
	elseif (F <= 1.95e+77)
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))));
	else
		tmp = sin(B) ^ -1.0;
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -1150000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.95e+77], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1150000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\

\mathbf{elif}\;F \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\

\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.15e6

    1. Initial program 57.9%

      \[\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. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
      2. lower-neg.f64N/A

        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
      3. div-add-revN/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      4. lower-/.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      5. lower-+.f64N/A

        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      7. lower-*.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      8. lower-cos.f64N/A

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.7

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    5. Taylor expanded in B around 0

      \[\leadsto -\frac{1 + x}{\sin B} \]
    6. Step-by-step derivation
      1. Applied rewrites79.4%

        \[\leadsto -\frac{1 + x}{\sin B} \]

      if -1.15e6 < F < 1.9499999999999999e77

      1. Initial program 98.9%

        \[\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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

          \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
        3. lift-tan.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        4. associate-*r/N/A

          \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
        5. lower-/.f64N/A

          \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
        6. lower-*.f64N/A

          \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
        7. lift-tan.f6499.1

          \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. Applied rewrites99.1%

        \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
      4. Taylor expanded in B around 0

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        3. sqrt-divN/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        4. metadata-evalN/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        5. lower-/.f64N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        6. lower-sqrt.f64N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
        7. pow2N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
        8. lower-+.f64N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
        9. lift-*.f64N/A

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
        10. lift-fma.f6480.5

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
      6. Applied rewrites80.5%

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]

      if 1.9499999999999999e77 < F

      1. Initial program 48.2%

        \[\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. Applied rewrites48.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \left(-x\right) \cdot {\tan B}^{-1}\right)} \]
      3. Step-by-step derivation
        1. lift-neg.f64N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot {\tan B}^{-1}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot {\tan B}^{-1}}\right) \]
        3. lift-pow.f64N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{{\tan B}^{-1}}\right) \]
        4. lift-tan.f64N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot {\color{blue}{\tan B}}^{-1}\right) \]
        5. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\mathsf{neg}\left(x \cdot {\tan B}^{-1}\right)}\right) \]
        6. inv-powN/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
        7. associate-*r/N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) \]
        8. distribute-neg-fracN/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}}\right) \]
        9. *-rgt-identityN/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}}\right) \]
        11. lift-neg.f64N/A

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\color{blue}{-x}}{\tan B}\right) \]
        12. lift-tan.f6448.2

          \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\color{blue}{\tan B}}\right) \]
      4. Applied rewrites48.2%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
        4. inv-powN/A

          \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        5. lower-pow.f64N/A

          \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        6. +-commutativeN/A

          \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        7. pow2N/A

          \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        8. lift-fma.f64N/A

          \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        9. lift-sin.f64N/A

          \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        10. lift-/.f6414.4

          \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\color{blue}{\sin B}} \]
      7. Applied rewrites14.4%

        \[\leadsto \color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}} \]
      8. Taylor expanded in F around inf

        \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
      9. Step-by-step derivation
        1. inv-powN/A

          \[\leadsto {\sin B}^{-1} \]
        2. lower-pow.f64N/A

          \[\leadsto {\sin B}^{-1} \]
        3. lift-sin.f6451.6

          \[\leadsto {\sin B}^{-1} \]
      10. Applied rewrites51.6%

        \[\leadsto {\sin B}^{\color{blue}{-1}} \]
    7. Recombined 3 regimes into one program.
    8. Add Preprocessing

    Alternative 6: 73.7% accurate, 2.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1150000:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+75}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -1150000.0)
       (- (/ (+ 1.0 x) (sin B)))
       (if (<= F 1.2e+75)
         (+
          (- (/ (* x 1.0) (tan B)))
          (* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
         (/ (- 1.0 x) B))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -1150000.0) {
    		tmp = -((1.0 + x) / sin(B));
    	} else if (F <= 1.2e+75) {
    		tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
    	} else {
    		tmp = (1.0 - x) / B;
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -1150000.0)
    		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
    	elseif (F <= 1.2e+75)
    		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))));
    	else
    		tmp = Float64(Float64(1.0 - x) / B);
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -1150000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.2e+75], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -1150000:\\
    \;\;\;\;-\frac{1 + x}{\sin B}\\
    
    \mathbf{elif}\;F \leq 1.2 \cdot 10^{+75}:\\
    \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - x}{B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -1.15e6

      1. Initial program 57.9%

        \[\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. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
        2. lower-neg.f64N/A

          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
        3. div-add-revN/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        4. lower-/.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        5. lower-+.f64N/A

          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
        6. *-commutativeN/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        7. lower-*.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        8. lower-cos.f64N/A

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6499.7

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      5. Taylor expanded in B around 0

        \[\leadsto -\frac{1 + x}{\sin B} \]
      6. Step-by-step derivation
        1. Applied rewrites79.4%

          \[\leadsto -\frac{1 + x}{\sin B} \]

        if -1.15e6 < F < 1.2e75

        1. Initial program 99.0%

          \[\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. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

            \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
          3. lift-tan.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          4. associate-*r/N/A

            \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
          5. lower-/.f64N/A

            \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
          6. lower-*.f64N/A

            \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
          7. lift-tan.f6499.1

            \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        3. Applied rewrites99.1%

          \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
        4. Taylor expanded in B around 0

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          2. lift-/.f64N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          3. sqrt-divN/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          4. metadata-evalN/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\color{blue}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          5. lower-/.f64N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\color{blue}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          6. lower-sqrt.f64N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
          7. pow2N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
          8. lower-+.f64N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
          9. lift-*.f64N/A

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \left(2 \cdot x + F \cdot F\right)}} \]
          10. lift-fma.f6480.6

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}} \]
        6. Applied rewrites80.6%

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}} \]

        if 1.2e75 < F

        1. Initial program 48.9%

          \[\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. Taylor expanded in B around 0

          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
        4. Applied rewrites32.3%

          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
        5. Taylor expanded in F around inf

          \[\leadsto \frac{1 - x}{B} \]
        6. Step-by-step derivation
          1. Applied rewrites50.5%

            \[\leadsto \frac{1 - x}{B} \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 7: 73.6% accurate, 2.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1150000:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{+75}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (if (<= F -1150000.0)
           (- (/ (+ 1.0 x) (sin B)))
           (if (<= F 1.2e+75)
             (+
              (- (* x (/ 1.0 (tan B))))
              (* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
             (/ (- 1.0 x) B))))
        double code(double F, double B, double x) {
        	double tmp;
        	if (F <= -1150000.0) {
        		tmp = -((1.0 + x) / sin(B));
        	} else if (F <= 1.2e+75) {
        		tmp = -(x * (1.0 / tan(B))) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
        	} else {
        		tmp = (1.0 - x) / B;
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	tmp = 0.0
        	if (F <= -1150000.0)
        		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
        	elseif (F <= 1.2e+75)
        		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0))))));
        	else
        		tmp = Float64(Float64(1.0 - x) / B);
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := If[LessEqual[F, -1150000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.2e+75], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;F \leq -1150000:\\
        \;\;\;\;-\frac{1 + x}{\sin B}\\
        
        \mathbf{elif}\;F \leq 1.2 \cdot 10^{+75}:\\
        \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1 - x}{B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if F < -1.15e6

          1. Initial program 57.9%

            \[\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. Taylor expanded in F around -inf

            \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
          3. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
            2. lower-neg.f64N/A

              \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
            3. div-add-revN/A

              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
            4. lower-/.f64N/A

              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
            5. lower-+.f64N/A

              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
            6. *-commutativeN/A

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            7. lower-*.f64N/A

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            8. lower-cos.f64N/A

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
            9. lift-sin.f6499.7

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          4. Applied rewrites99.7%

            \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
          5. Taylor expanded in B around 0

            \[\leadsto -\frac{1 + x}{\sin B} \]
          6. Step-by-step derivation
            1. Applied rewrites79.4%

              \[\leadsto -\frac{1 + x}{\sin B} \]

            if -1.15e6 < F < 1.2e75

            1. Initial program 99.0%

              \[\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. Taylor expanded in B around 0

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              2. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
              4. inv-powN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
              5. lower-pow.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
              6. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
              7. lower-+.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
              8. lower-fma.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
              9. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              10. lift-*.f6480.5

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
            4. Applied rewrites80.5%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}} \]
            5. Step-by-step derivation
              1. lift-pow.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              2. lift-+.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              3. lift-fma.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \]
              4. lift-*.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \]
              5. unpow-1N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \]
              6. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \]
              7. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \]
              8. associate-+r+N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \]
              9. pow2N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \]
              10. lift-fma.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \]
              11. lift-fma.f6480.5

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \]
            6. Applied rewrites80.5%

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

            if 1.2e75 < F

            1. Initial program 48.9%

              \[\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. Taylor expanded in B around 0

              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
            4. Applied rewrites32.3%

              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
            5. Taylor expanded in F around inf

              \[\leadsto \frac{1 - x}{B} \]
            6. Step-by-step derivation
              1. Applied rewrites50.5%

                \[\leadsto \frac{1 - x}{B} \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 8: 55.6% accurate, 2.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{if}\;B \leq 0.16:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{elif}\;B \leq 3 \cdot 10^{+210}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;B \leq 3.1 \cdot 10^{+243}:\\ \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F))))))
                    (t_1 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (/ -1.0 F)))))
               (if (<= B 0.16)
                 (/
                  (-
                   (fma
                    F
                    t_0
                    (*
                     (* B B)
                     (fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
                   x)
                  B)
                 (if (<= B 3e+210)
                   t_1
                   (if (<= B 3.1e+243)
                     (* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
                     t_1)))))
            double code(double F, double B, double x) {
            	double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
            	double t_1 = -(x * (1.0 / tan(B))) + ((F / B) * (-1.0 / F));
            	double tmp;
            	if (B <= 0.16) {
            		tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
            	} else if (B <= 3e+210) {
            		tmp = t_1;
            	} else if (B <= 3.1e+243) {
            		tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))
            	t_1 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * Float64(-1.0 / F)))
            	tmp = 0.0
            	if (B <= 0.16)
            		tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B);
            	elseif (B <= 3e+210)
            		tmp = t_1;
            	elseif (B <= 3.1e+243)
            		tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B)));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.16], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 3e+210], t$95$1, If[LessEqual[B, 3.1e+243], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
            t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\\
            \mathbf{if}\;B \leq 0.16:\\
            \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
            
            \mathbf{elif}\;B \leq 3 \cdot 10^{+210}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;B \leq 3.1 \cdot 10^{+243}:\\
            \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if B < 0.160000000000000003

              1. Initial program 73.5%

                \[\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. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

                  \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
                3. lift-tan.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                4. associate-*r/N/A

                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
                5. lower-/.f64N/A

                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
                6. lower-*.f64N/A

                  \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
                7. lift-tan.f6473.6

                  \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Applied rewrites73.6%

                \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
              4. Taylor expanded in B around 0

                \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
              5. Step-by-step derivation
                1. associate-*r/N/A

                  \[\leadsto \frac{\left(\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
              6. Applied rewrites56.7%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right)\right) - x}{B}} \]

              if 0.160000000000000003 < B < 3.00000000000000022e210 or 3.1e243 < B

              1. Initial program 86.4%

                \[\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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. inv-powN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                5. lower-pow.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                6. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                7. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                8. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                9. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                10. lift-*.f6456.7

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              4. Applied rewrites56.7%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{\color{blue}{F}} \]
              6. Step-by-step derivation
                1. lower-/.f6454.2

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F} \]
              7. Applied rewrites54.2%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{\color{blue}{F}} \]

              if 3.00000000000000022e210 < B < 3.1e243

              1. Initial program 84.4%

                \[\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. Applied rewrites84.4%

                \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \left(-x\right) \cdot {\tan B}^{-1}\right)} \]
              3. Step-by-step derivation
                1. lift-neg.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot {\tan B}^{-1}\right) \]
                2. lift-*.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot {\tan B}^{-1}}\right) \]
                3. lift-pow.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{{\tan B}^{-1}}\right) \]
                4. lift-tan.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot {\color{blue}{\tan B}}^{-1}\right) \]
                5. distribute-lft-neg-inN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\mathsf{neg}\left(x \cdot {\tan B}^{-1}\right)}\right) \]
                6. inv-powN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                7. associate-*r/N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) \]
                8. distribute-neg-fracN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}}\right) \]
                9. *-rgt-identityN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B}\right) \]
                10. lower-/.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}}\right) \]
                11. lift-neg.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\color{blue}{-x}}{\tan B}\right) \]
                12. lift-tan.f6484.6

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\color{blue}{\tan B}}\right) \]
              4. Applied rewrites84.6%

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

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
              6. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                4. inv-powN/A

                  \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                5. lower-pow.f64N/A

                  \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                6. +-commutativeN/A

                  \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                7. pow2N/A

                  \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                8. lift-fma.f64N/A

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                9. lift-sin.f64N/A

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                10. lift-/.f6435.1

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\color{blue}{\sin B}} \]
              7. Applied rewrites35.1%

                \[\leadsto \color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}} \]
              8. Step-by-step derivation
                1. lift-pow.f64N/A

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                2. lift-fma.f64N/A

                  \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                4. unpow-1N/A

                  \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                5. pow2N/A

                  \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                6. +-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                7. sqrt-divN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                8. metadata-evalN/A

                  \[\leadsto \frac{1}{\sqrt{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                9. lower-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                10. lower-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                11. +-commutativeN/A

                  \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                12. pow2N/A

                  \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                13. lift-fma.f6435.1

                  \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
              9. Applied rewrites35.1%

                \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{\color{blue}{F}}{\sin B} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 9: 54.9% accurate, 2.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{if}\;B \leq 0.16:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{elif}\;B \leq 2.4 \cdot 10^{+210}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;B \leq 3.1 \cdot 10^{+243}:\\ \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F))))))
                    (t_1 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
               (if (<= B 0.16)
                 (/
                  (-
                   (fma
                    F
                    t_0
                    (*
                     (* B B)
                     (fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
                   x)
                  B)
                 (if (<= B 2.4e+210)
                   t_1
                   (if (<= B 3.1e+243)
                     (* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
                     t_1)))))
            double code(double F, double B, double x) {
            	double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
            	double t_1 = -(x * (1.0 / tan(B))) + (-1.0 / B);
            	double tmp;
            	if (B <= 0.16) {
            		tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
            	} else if (B <= 2.4e+210) {
            		tmp = t_1;
            	} else if (B <= 3.1e+243) {
            		tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))
            	t_1 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B))
            	tmp = 0.0
            	if (B <= 0.16)
            		tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B);
            	elseif (B <= 2.4e+210)
            		tmp = t_1;
            	elseif (B <= 3.1e+243)
            		tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B)));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.16], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 2.4e+210], t$95$1, If[LessEqual[B, 3.1e+243], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
            t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
            \mathbf{if}\;B \leq 0.16:\\
            \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
            
            \mathbf{elif}\;B \leq 2.4 \cdot 10^{+210}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;B \leq 3.1 \cdot 10^{+243}:\\
            \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if B < 0.160000000000000003

              1. Initial program 73.5%

                \[\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. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

                  \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
                3. lift-tan.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                4. associate-*r/N/A

                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
                5. lower-/.f64N/A

                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
                6. lower-*.f64N/A

                  \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
                7. lift-tan.f6473.6

                  \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Applied rewrites73.6%

                \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
              4. Taylor expanded in B around 0

                \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
              5. Step-by-step derivation
                1. associate-*r/N/A

                  \[\leadsto \frac{\left(\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
              6. Applied rewrites56.7%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right)\right) - x}{B}} \]

              if 0.160000000000000003 < B < 2.39999999999999988e210 or 3.1e243 < B

              1. Initial program 86.4%

                \[\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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. inv-powN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                5. lower-pow.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                6. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                7. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                8. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                9. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                10. lift-*.f6456.7

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              4. Applied rewrites56.7%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
              6. Step-by-step derivation
                1. lower-/.f6451.0

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
              7. Applied rewrites51.0%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]

              if 2.39999999999999988e210 < B < 3.1e243

              1. Initial program 84.4%

                \[\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. Applied rewrites84.4%

                \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \left(-x\right) \cdot {\tan B}^{-1}\right)} \]
              3. Step-by-step derivation
                1. lift-neg.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot {\tan B}^{-1}\right) \]
                2. lift-*.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot {\tan B}^{-1}}\right) \]
                3. lift-pow.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{{\tan B}^{-1}}\right) \]
                4. lift-tan.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \left(\mathsf{neg}\left(x\right)\right) \cdot {\color{blue}{\tan B}}^{-1}\right) \]
                5. distribute-lft-neg-inN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\mathsf{neg}\left(x \cdot {\tan B}^{-1}\right)}\right) \]
                6. inv-powN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                7. associate-*r/N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \mathsf{neg}\left(\color{blue}{\frac{x \cdot 1}{\tan B}}\right)\right) \]
                8. distribute-neg-fracN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x \cdot 1\right)}{\tan B}}\right) \]
                9. *-rgt-identityN/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\mathsf{neg}\left(\color{blue}{x}\right)}{\tan B}\right) \]
                10. lower-/.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{\tan B}}\right) \]
                11. lift-neg.f64N/A

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{F}{\sin B}, \frac{\color{blue}{-x}}{\tan B}\right) \]
                12. lift-tan.f6484.6

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\color{blue}{\tan B}}\right) \]
              4. Applied rewrites84.6%

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

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
              6. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                4. inv-powN/A

                  \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                5. lower-pow.f64N/A

                  \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                6. +-commutativeN/A

                  \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                7. pow2N/A

                  \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                8. lift-fma.f64N/A

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                9. lift-sin.f64N/A

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                10. lift-/.f6435.1

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\color{blue}{\sin B}} \]
              7. Applied rewrites35.1%

                \[\leadsto \color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}} \]
              8. Step-by-step derivation
                1. lift-pow.f64N/A

                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                2. lift-fma.f64N/A

                  \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                4. unpow-1N/A

                  \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                5. pow2N/A

                  \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                6. +-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                7. sqrt-divN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                8. metadata-evalN/A

                  \[\leadsto \frac{1}{\sqrt{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                9. lower-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                10. lower-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                11. +-commutativeN/A

                  \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                12. pow2N/A

                  \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                13. lift-fma.f6435.1

                  \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
              9. Applied rewrites35.1%

                \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{\color{blue}{F}}{\sin B} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 10: 55.3% accurate, 2.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\ \mathbf{if}\;B \leq 0.16:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
               (if (<= B 0.16)
                 (/
                  (-
                   (fma
                    F
                    t_0
                    (*
                     (* B B)
                     (fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
                   x)
                  B)
                 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B)))))
            double code(double F, double B, double x) {
            	double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
            	double tmp;
            	if (B <= 0.16) {
            		tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
            	} else {
            		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F)))))
            	tmp = 0.0
            	if (B <= 0.16)
            		tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B);
            	else
            		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.16], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
            \mathbf{if}\;B \leq 0.16:\\
            \;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if B < 0.160000000000000003

              1. Initial program 73.5%

                \[\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. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(-\color{blue}{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. lift-/.f64N/A

                  \[\leadsto \left(-x \cdot \color{blue}{\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)} \]
                3. lift-tan.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                4. associate-*r/N/A

                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
                5. lower-/.f64N/A

                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
                6. lower-*.f64N/A

                  \[\leadsto \left(-\frac{\color{blue}{x \cdot 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)} \]
                7. lift-tan.f6473.6

                  \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Applied rewrites73.6%

                \[\leadsto \left(-\color{blue}{\frac{x \cdot 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)} \]
              4. Taylor expanded in B around 0

                \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
              5. Step-by-step derivation
                1. associate-*r/N/A

                  \[\leadsto \frac{\left(\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{\color{blue}{B}} \]
              6. Applied rewrites56.7%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right)\right) - x}{B}} \]

              if 0.160000000000000003 < B

              1. Initial program 86.2%

                \[\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. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \]
                4. inv-powN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                5. lower-pow.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \]
                6. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                7. lower-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \]
                8. lower-fma.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, {F}^{2}\right) + 2\right)}^{-1}} \]
                9. pow2N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
                10. lift-*.f6456.2

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
              4. Applied rewrites56.2%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
              6. Step-by-step derivation
                1. lower-/.f6450.9

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
              7. Applied rewrites50.9%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 11: 58.6% accurate, 3.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -92000:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (if (<= F -92000.0)
               (- (/ (+ 1.0 x) (sin B)))
               (if (<= F 200000000.0)
                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                 (/ (- (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 1.0) x) B))))
            double code(double F, double B, double x) {
            	double tmp;
            	if (F <= -92000.0) {
            		tmp = -((1.0 + x) / sin(B));
            	} else if (F <= 200000000.0) {
            		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
            	} else {
            		tmp = (fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, 1.0) - x) / B;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	tmp = 0.0
            	if (F <= -92000.0)
            		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
            	elseif (F <= 200000000.0)
            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
            	else
            		tmp = Float64(Float64(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, 1.0) - x) / B);
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := If[LessEqual[F, -92000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 200000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;F \leq -92000:\\
            \;\;\;\;-\frac{1 + x}{\sin B}\\
            
            \mathbf{elif}\;F \leq 200000000:\\
            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if F < -92000

              1. Initial program 58.0%

                \[\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. Taylor expanded in F around -inf

                \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
              3. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                2. lower-neg.f64N/A

                  \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                3. div-add-revN/A

                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                4. lower-/.f64N/A

                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                5. lower-+.f64N/A

                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                6. *-commutativeN/A

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                7. lower-*.f64N/A

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                8. lower-cos.f64N/A

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                9. lift-sin.f6499.7

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
              4. Applied rewrites99.7%

                \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
              5. Taylor expanded in B around 0

                \[\leadsto -\frac{1 + x}{\sin B} \]
              6. Step-by-step derivation
                1. Applied rewrites79.3%

                  \[\leadsto -\frac{1 + x}{\sin B} \]

                if -92000 < F < 2e8

                1. Initial program 99.4%

                  \[\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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites50.6%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                5. Step-by-step derivation
                  1. lift-pow.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  2. lift-+.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  3. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  5. unpow-1N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  6. lower-/.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  7. pow2N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                  8. associate-+r+N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                  9. pow2N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                  10. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                  11. lift-fma.f6450.6

                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                6. Applied rewrites50.6%

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

                if 2e8 < F

                1. Initial program 57.2%

                  \[\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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites36.0%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                5. Taylor expanded in x around inf

                  \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                6. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  2. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  3. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{-1 \cdot \frac{-1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  4. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  5. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  6. sqrt-unprodN/A

                    \[\leadsto \frac{\left(F \cdot \left(\sqrt{-1} \cdot \sqrt{\mathsf{neg}\left(\frac{1}{2}\right)}\right)\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  7. lower-*.f64N/A

                    \[\leadsto \frac{\left(F \cdot \left(\sqrt{-1} \cdot \sqrt{\mathsf{neg}\left(\frac{1}{2}\right)}\right)\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                7. Applied rewrites9.7%

                  \[\leadsto \frac{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sqrt{x}} - x}{B} \]
                8. Taylor expanded in F around inf

                  \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                9. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                  2. *-commutativeN/A

                    \[\leadsto \frac{\left(\frac{2 + 2 \cdot x}{{F}^{2}} \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  3. div-addN/A

                    \[\leadsto \frac{\left(\left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  4. metadata-evalN/A

                    \[\leadsto \frac{\left(\left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  5. associate-*r/N/A

                    \[\leadsto \frac{\left(\left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  6. associate-*r/N/A

                    \[\leadsto \frac{\left(\left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  7. +-commutativeN/A

                    \[\leadsto \frac{\left(\left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  8. lower-fma.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, \frac{-1}{2}, 1\right) - x}{B} \]
                10. Applied rewrites50.8%

                  \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B} \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 12: 52.1% accurate, 3.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -300000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= F -300000.0)
                 (/ -1.0 (sin B))
                 (if (<= F 200000000.0)
                   (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                   (/ (- (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 1.0) x) B))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (F <= -300000.0) {
              		tmp = -1.0 / sin(B);
              	} else if (F <= 200000000.0) {
              		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
              	} else {
              		tmp = (fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, 1.0) - x) / B;
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (F <= -300000.0)
              		tmp = Float64(-1.0 / sin(B));
              	elseif (F <= 200000000.0)
              		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
              	else
              		tmp = Float64(Float64(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, 1.0) - x) / B);
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := If[LessEqual[F, -300000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;F \leq -300000:\\
              \;\;\;\;\frac{-1}{\sin B}\\
              
              \mathbf{elif}\;F \leq 200000000:\\
              \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if F < -3e5

                1. Initial program 58.0%

                  \[\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. Taylor expanded in F around -inf

                  \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                3. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                  2. lower-neg.f64N/A

                    \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                  3. div-add-revN/A

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  5. lower-+.f64N/A

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  6. *-commutativeN/A

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  7. lower-*.f64N/A

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  8. lower-cos.f64N/A

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  9. lift-sin.f6499.7

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                4. Applied rewrites99.7%

                  \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                5. Taylor expanded in x around 0

                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                6. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{-1}{\sin B} \]
                  2. lift-sin.f6455.7

                    \[\leadsto \frac{-1}{\sin B} \]
                7. Applied rewrites55.7%

                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]

                if -3e5 < F < 2e8

                1. Initial program 99.4%

                  \[\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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites50.7%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                5. Step-by-step derivation
                  1. lift-pow.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  2. lift-+.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  3. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  5. unpow-1N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  6. lower-/.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  7. pow2N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                  8. associate-+r+N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                  9. pow2N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                  10. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                  11. lift-fma.f6450.7

                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                6. Applied rewrites50.7%

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

                if 2e8 < F

                1. Initial program 57.2%

                  \[\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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites36.0%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                5. Taylor expanded in x around inf

                  \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                6. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  2. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{\frac{1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  3. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{-1 \cdot \frac{-1}{2}}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  4. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  5. metadata-evalN/A

                    \[\leadsto \frac{\left(F \cdot \sqrt{-1 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  6. sqrt-unprodN/A

                    \[\leadsto \frac{\left(F \cdot \left(\sqrt{-1} \cdot \sqrt{\mathsf{neg}\left(\frac{1}{2}\right)}\right)\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                  7. lower-*.f64N/A

                    \[\leadsto \frac{\left(F \cdot \left(\sqrt{-1} \cdot \sqrt{\mathsf{neg}\left(\frac{1}{2}\right)}\right)\right) \cdot \sqrt{\frac{1}{x}} - x}{B} \]
                7. Applied rewrites9.7%

                  \[\leadsto \frac{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sqrt{x}} - x}{B} \]
                8. Taylor expanded in F around inf

                  \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                9. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                  2. *-commutativeN/A

                    \[\leadsto \frac{\left(\frac{2 + 2 \cdot x}{{F}^{2}} \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  3. div-addN/A

                    \[\leadsto \frac{\left(\left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  4. metadata-evalN/A

                    \[\leadsto \frac{\left(\left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  5. associate-*r/N/A

                    \[\leadsto \frac{\left(\left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  6. associate-*r/N/A

                    \[\leadsto \frac{\left(\left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  7. +-commutativeN/A

                    \[\leadsto \frac{\left(\left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) \cdot \frac{-1}{2} + 1\right) - x}{B} \]
                  8. lower-fma.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, \frac{-1}{2}, 1\right) - x}{B} \]
                10. Applied rewrites50.8%

                  \[\leadsto \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B} \]
              3. Recombined 3 regimes into one program.
              4. Add Preprocessing

              Alternative 13: 50.5% accurate, 4.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.6 \cdot 10^{+25}:\\ \;\;\;\;\frac{\left(B \cdot B\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x, \left(B \cdot B\right) \cdot \left(\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - 0.019444444444444445\right) - 0.041666666666666664 \cdot x\right) - \left(0.16666666666666666 + -0.5 \cdot x\right)\right) - \left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-18}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= F -4.6e+25)
                 (/
                  (-
                   (*
                    (* B B)
                    (fma
                     -0.16666666666666666
                     x
                     (-
                      (*
                       (* B B)
                       (-
                        (-
                         (fma
                          -0.16666666666666666
                          (* x -0.3333333333333333)
                          (* 0.008333333333333333 x))
                         0.019444444444444445)
                        (* 0.041666666666666664 x)))
                      (+ 0.16666666666666666 (* -0.5 x)))))
                   (+ 1.0 x))
                  B)
                 (if (<= F 9.5e-18)
                   (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                   (/ (- 1.0 x) B))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (F <= -4.6e+25) {
              		tmp = (((B * B) * fma(-0.16666666666666666, x, (((B * B) * ((fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - 0.019444444444444445) - (0.041666666666666664 * x))) - (0.16666666666666666 + (-0.5 * x))))) - (1.0 + x)) / B;
              	} else if (F <= 9.5e-18) {
              		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
              	} else {
              		tmp = (1.0 - x) / B;
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (F <= -4.6e+25)
              		tmp = Float64(Float64(Float64(Float64(B * B) * fma(-0.16666666666666666, x, Float64(Float64(Float64(B * B) * Float64(Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - 0.019444444444444445) - Float64(0.041666666666666664 * x))) - Float64(0.16666666666666666 + Float64(-0.5 * x))))) - Float64(1.0 + x)) / B);
              	elseif (F <= 9.5e-18)
              		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
              	else
              		tmp = Float64(Float64(1.0 - x) / B);
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := If[LessEqual[F, -4.6e+25], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(-0.16666666666666666 * x + N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - 0.019444444444444445), $MachinePrecision] - N[(0.041666666666666664 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.16666666666666666 + N[(-0.5 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-18], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;F \leq -4.6 \cdot 10^{+25}:\\
              \;\;\;\;\frac{\left(B \cdot B\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x, \left(B \cdot B\right) \cdot \left(\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - 0.019444444444444445\right) - 0.041666666666666664 \cdot x\right) - \left(0.16666666666666666 + -0.5 \cdot x\right)\right) - \left(1 + x\right)}{B}\\
              
              \mathbf{elif}\;F \leq 9.5 \cdot 10^{-18}:\\
              \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{1 - x}{B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if F < -4.5999999999999996e25

                1. Initial program 55.9%

                  \[\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. Taylor expanded in F around -inf

                  \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                3. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                  2. lower-neg.f64N/A

                    \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                  3. div-add-revN/A

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  5. lower-+.f64N/A

                    \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                  6. *-commutativeN/A

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  7. lower-*.f64N/A

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  8. lower-cos.f64N/A

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  9. lift-sin.f6499.8

                    \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                4. Applied rewrites99.8%

                  \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                5. Taylor expanded in B around 0

                  \[\leadsto \frac{{B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot x + {B}^{2} \cdot \left(\left(\frac{-1}{6} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + \frac{1}{120} \cdot x\right) - \left(\frac{7}{360} + \frac{1}{24} \cdot x\right)\right)\right) - \left(\frac{1}{6} + \frac{-1}{2} \cdot x\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]
                6. Applied rewrites51.4%

                  \[\leadsto \frac{\left(B \cdot B\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x, \left(B \cdot B\right) \cdot \left(\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - 0.019444444444444445\right) - 0.041666666666666664 \cdot x\right) - \left(0.16666666666666666 + -0.5 \cdot x\right)\right) - \left(1 + x\right)}{\color{blue}{B}} \]

                if -4.5999999999999996e25 < F < 9.5000000000000003e-18

                1. Initial program 99.4%

                  \[\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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites50.7%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                5. Step-by-step derivation
                  1. lift-pow.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  2. lift-+.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  3. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                  5. unpow-1N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  6. lower-/.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                  7. pow2N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                  8. associate-+r+N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                  9. pow2N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                  10. lift-fma.f64N/A

                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                  11. lift-fma.f6450.7

                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                6. Applied rewrites50.7%

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

                if 9.5000000000000003e-18 < F

                1. Initial program 59.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. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                3. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                4. Applied rewrites36.7%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                5. Taylor expanded in F around inf

                  \[\leadsto \frac{1 - x}{B} \]
                6. Step-by-step derivation
                  1. Applied rewrites49.4%

                    \[\leadsto \frac{1 - x}{B} \]
                7. Recombined 3 regimes into one program.
                8. Add Preprocessing

                Alternative 14: 50.6% accurate, 5.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.25 \cdot 10^{+18}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-18}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -2.25e+18)
                   (-
                    (/
                     (+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
                     B))
                   (if (<= F 9.5e-18)
                     (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                     (/ (- 1.0 x) B))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -2.25e+18) {
                		tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
                	} else if (F <= 9.5e-18) {
                		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                	} else {
                		tmp = (1.0 - x) / B;
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -2.25e+18)
                		tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B));
                	elseif (F <= 9.5e-18)
                		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                	else
                		tmp = Float64(Float64(1.0 - x) / B);
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -2.25e+18], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 9.5e-18], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -2.25 \cdot 10^{+18}:\\
                \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
                
                \mathbf{elif}\;F \leq 9.5 \cdot 10^{-18}:\\
                \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -2.25e18

                  1. Initial program 56.7%

                    \[\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. Taylor expanded in F around -inf

                    \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                  3. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                    2. lower-neg.f64N/A

                      \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                    3. div-add-revN/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    4. lower-/.f64N/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    5. lower-+.f64N/A

                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    6. *-commutativeN/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    7. lower-*.f64N/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    8. lower-cos.f64N/A

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    9. lift-sin.f6499.8

                      \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                  4. Applied rewrites99.8%

                    \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                  5. Taylor expanded in x around 0

                    \[\leadsto -\frac{1}{\sin B} \]
                  6. Step-by-step derivation
                    1. inv-powN/A

                      \[\leadsto -{\sin B}^{-1} \]
                    2. lower-pow.f64N/A

                      \[\leadsto -{\sin B}^{-1} \]
                    3. lift-sin.f6455.5

                      \[\leadsto -{\sin B}^{-1} \]
                  7. Applied rewrites55.5%

                    \[\leadsto -{\sin B}^{-1} \]
                  8. Taylor expanded in B around 0

                    \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                  9. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                    2. +-commutativeN/A

                      \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                    3. lower-+.f64N/A

                      \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                    4. +-commutativeN/A

                      \[\leadsto -\frac{\left({B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) + x\right) + 1}{B} \]
                    5. *-commutativeN/A

                      \[\leadsto -\frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) \cdot {B}^{2} + x\right) + 1}{B} \]
                    6. lower-fma.f64N/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                    7. fp-cancel-sub-sign-invN/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x + \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                    8. lower-fma.f64N/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                    9. metadata-evalN/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                    10. lower-*.f64N/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                    11. lower-+.f64N/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                    12. unpow2N/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                    13. lower-*.f6451.7

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                  10. Applied rewrites51.7%

                    \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]

                  if -2.25e18 < F < 9.5000000000000003e-18

                  1. Initial program 99.4%

                    \[\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. Taylor expanded in B around 0

                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                  4. Applied rewrites50.6%

                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                  5. Step-by-step derivation
                    1. lift-pow.f64N/A

                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                    2. lift-+.f64N/A

                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                    3. lift-fma.f64N/A

                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                    4. lift-*.f64N/A

                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                    5. unpow-1N/A

                      \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                    6. lower-/.f64N/A

                      \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                    7. pow2N/A

                      \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                    8. associate-+r+N/A

                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                    9. pow2N/A

                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                    10. lift-fma.f64N/A

                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                    11. lift-fma.f6450.6

                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                  6. Applied rewrites50.6%

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

                  if 9.5000000000000003e-18 < F

                  1. Initial program 59.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. Taylor expanded in B around 0

                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                  4. Applied rewrites36.7%

                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                  5. Taylor expanded in F around inf

                    \[\leadsto \frac{1 - x}{B} \]
                  6. Step-by-step derivation
                    1. Applied rewrites49.4%

                      \[\leadsto \frac{1 - x}{B} \]
                  7. Recombined 3 regimes into one program.
                  8. Add Preprocessing

                  Alternative 15: 50.2% accurate, 6.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{+21}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\ \mathbf{elif}\;F \leq 620000000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{x \cdot 2 + 2}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -3.3e+21)
                     (-
                      (/
                       (+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
                       B))
                     (if (<= F 620000000.0)
                       (/ (- (* (sqrt (/ 1.0 (+ (* x 2.0) 2.0))) F) x) B)
                       (/ (- 1.0 x) B))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -3.3e+21) {
                  		tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
                  	} else if (F <= 620000000.0) {
                  		tmp = ((sqrt((1.0 / ((x * 2.0) + 2.0))) * F) - x) / B;
                  	} else {
                  		tmp = (1.0 - x) / B;
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -3.3e+21)
                  		tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B));
                  	elseif (F <= 620000000.0)
                  		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(Float64(x * 2.0) + 2.0))) * F) - x) / B);
                  	else
                  		tmp = Float64(Float64(1.0 - x) / B);
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -3.3e+21], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 620000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(N[(x * 2.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -3.3 \cdot 10^{+21}:\\
                  \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
                  
                  \mathbf{elif}\;F \leq 620000000:\\
                  \;\;\;\;\frac{\sqrt{\frac{1}{x \cdot 2 + 2}} \cdot F - x}{B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1 - x}{B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -3.3e21

                    1. Initial program 56.4%

                      \[\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. Taylor expanded in F around -inf

                      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                    3. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                      2. lower-neg.f64N/A

                        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                      3. div-add-revN/A

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                      4. lower-/.f64N/A

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                      5. lower-+.f64N/A

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                      6. *-commutativeN/A

                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      7. lower-*.f64N/A

                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      8. lower-cos.f64N/A

                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      9. lift-sin.f6499.8

                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                    4. Applied rewrites99.8%

                      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                    5. Taylor expanded in x around 0

                      \[\leadsto -\frac{1}{\sin B} \]
                    6. Step-by-step derivation
                      1. inv-powN/A

                        \[\leadsto -{\sin B}^{-1} \]
                      2. lower-pow.f64N/A

                        \[\leadsto -{\sin B}^{-1} \]
                      3. lift-sin.f6455.4

                        \[\leadsto -{\sin B}^{-1} \]
                    7. Applied rewrites55.4%

                      \[\leadsto -{\sin B}^{-1} \]
                    8. Taylor expanded in B around 0

                      \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                    9. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                      2. +-commutativeN/A

                        \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                      3. lower-+.f64N/A

                        \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                      4. +-commutativeN/A

                        \[\leadsto -\frac{\left({B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) + x\right) + 1}{B} \]
                      5. *-commutativeN/A

                        \[\leadsto -\frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) \cdot {B}^{2} + x\right) + 1}{B} \]
                      6. lower-fma.f64N/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                      7. fp-cancel-sub-sign-invN/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x + \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                      8. lower-fma.f64N/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                      9. metadata-evalN/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                      10. lower-*.f64N/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                      11. lower-+.f64N/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                      12. unpow2N/A

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                      13. lower-*.f6451.7

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                    10. Applied rewrites51.7%

                      \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]

                    if -3.3e21 < F < 6.2e8

                    1. Initial program 99.4%

                      \[\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. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                    4. Applied rewrites50.6%

                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                    5. Taylor expanded in F around 0

                      \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                    6. Step-by-step derivation
                      1. lift-*.f6448.9

                        \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                    7. Applied rewrites48.9%

                      \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                    8. Step-by-step derivation
                      1. lift-pow.f64N/A

                        \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                      2. unpow-1N/A

                        \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                      3. lower-/.f6448.9

                        \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                      4. lift-*.f64N/A

                        \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                      5. *-commutativeN/A

                        \[\leadsto \frac{\sqrt{\frac{1}{x \cdot 2 + 2}} \cdot F - x}{B} \]
                      6. lower-*.f6448.9

                        \[\leadsto \frac{\sqrt{\frac{1}{x \cdot 2 + 2}} \cdot F - x}{B} \]
                    9. Applied rewrites48.9%

                      \[\leadsto \frac{\sqrt{\frac{1}{x \cdot 2 + 2}} \cdot F - x}{B} \]

                    if 6.2e8 < F

                    1. Initial program 57.1%

                      \[\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. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                    4. Applied rewrites35.9%

                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                    5. Taylor expanded in F around inf

                      \[\leadsto \frac{1 - x}{B} \]
                    6. Step-by-step derivation
                      1. Applied rewrites50.9%

                        \[\leadsto \frac{1 - x}{B} \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 16: 43.7% accurate, 7.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.9 \cdot 10^{-79}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-20}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -3.9e-79)
                       (-
                        (/
                         (+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
                         B))
                       (if (<= F 1.05e-20) (/ (- x) B) (/ (- 1.0 x) B))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -3.9e-79) {
                    		tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
                    	} else if (F <= 1.05e-20) {
                    		tmp = -x / B;
                    	} else {
                    		tmp = (1.0 - x) / B;
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -3.9e-79)
                    		tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B));
                    	elseif (F <= 1.05e-20)
                    		tmp = Float64(Float64(-x) / B);
                    	else
                    		tmp = Float64(Float64(1.0 - x) / B);
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -3.9e-79], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 1.05e-20], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -3.9 \cdot 10^{-79}:\\
                    \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
                    
                    \mathbf{elif}\;F \leq 1.05 \cdot 10^{-20}:\\
                    \;\;\;\;\frac{-x}{B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1 - x}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -3.90000000000000006e-79

                      1. Initial program 65.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. Taylor expanded in F around -inf

                        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                      3. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                        2. lower-neg.f64N/A

                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                        3. div-add-revN/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        4. lower-/.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        5. lower-+.f64N/A

                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        6. *-commutativeN/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        7. lower-*.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        8. lower-cos.f64N/A

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                        9. lift-sin.f6488.8

                          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                      4. Applied rewrites88.8%

                        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                      5. Taylor expanded in x around 0

                        \[\leadsto -\frac{1}{\sin B} \]
                      6. Step-by-step derivation
                        1. inv-powN/A

                          \[\leadsto -{\sin B}^{-1} \]
                        2. lower-pow.f64N/A

                          \[\leadsto -{\sin B}^{-1} \]
                        3. lift-sin.f6447.1

                          \[\leadsto -{\sin B}^{-1} \]
                      7. Applied rewrites47.1%

                        \[\leadsto -{\sin B}^{-1} \]
                      8. Taylor expanded in B around 0

                        \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                      9. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                        2. +-commutativeN/A

                          \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                        3. lower-+.f64N/A

                          \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                        4. +-commutativeN/A

                          \[\leadsto -\frac{\left({B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) + x\right) + 1}{B} \]
                        5. *-commutativeN/A

                          \[\leadsto -\frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) \cdot {B}^{2} + x\right) + 1}{B} \]
                        6. lower-fma.f64N/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                        7. fp-cancel-sub-sign-invN/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x + \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                        8. lower-fma.f64N/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                        9. metadata-evalN/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                        10. lower-*.f64N/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                        11. lower-+.f64N/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                        12. unpow2N/A

                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                        13. lower-*.f6445.7

                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                      10. Applied rewrites45.7%

                        \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]

                      if -3.90000000000000006e-79 < F < 1.0499999999999999e-20

                      1. Initial program 99.4%

                        \[\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. Taylor expanded in B around 0

                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                      4. Applied rewrites50.5%

                        \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                      5. Taylor expanded in F around 0

                        \[\leadsto \frac{-1 \cdot x}{B} \]
                      6. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                        2. lift-neg.f6437.6

                          \[\leadsto \frac{-x}{B} \]
                      7. Applied rewrites37.6%

                        \[\leadsto \frac{-x}{B} \]

                      if 1.0499999999999999e-20 < F

                      1. Initial program 60.0%

                        \[\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. Taylor expanded in B around 0

                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                      4. Applied rewrites36.9%

                        \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                      5. Taylor expanded in F around inf

                        \[\leadsto \frac{1 - x}{B} \]
                      6. Step-by-step derivation
                        1. Applied rewrites49.2%

                          \[\leadsto \frac{1 - x}{B} \]
                      7. Recombined 3 regimes into one program.
                      8. Add Preprocessing

                      Alternative 17: 43.7% accurate, 13.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-88}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-20}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= F -1.25e-88)
                         (/ (- -1.0 x) B)
                         (if (<= F 1.05e-20) (/ (- x) B) (/ (- 1.0 x) B))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -1.25e-88) {
                      		tmp = (-1.0 - x) / B;
                      	} else if (F <= 1.05e-20) {
                      		tmp = -x / B;
                      	} else {
                      		tmp = (1.0 - x) / B;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(f, b, x)
                      use fmin_fmax_functions
                          real(8), intent (in) :: f
                          real(8), intent (in) :: b
                          real(8), intent (in) :: x
                          real(8) :: tmp
                          if (f <= (-1.25d-88)) then
                              tmp = ((-1.0d0) - x) / b
                          else if (f <= 1.05d-20) then
                              tmp = -x / b
                          else
                              tmp = (1.0d0 - x) / b
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -1.25e-88) {
                      		tmp = (-1.0 - x) / B;
                      	} else if (F <= 1.05e-20) {
                      		tmp = -x / B;
                      	} else {
                      		tmp = (1.0 - x) / B;
                      	}
                      	return tmp;
                      }
                      
                      def code(F, B, x):
                      	tmp = 0
                      	if F <= -1.25e-88:
                      		tmp = (-1.0 - x) / B
                      	elif F <= 1.05e-20:
                      		tmp = -x / B
                      	else:
                      		tmp = (1.0 - x) / B
                      	return tmp
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (F <= -1.25e-88)
                      		tmp = Float64(Float64(-1.0 - x) / B);
                      	elseif (F <= 1.05e-20)
                      		tmp = Float64(Float64(-x) / B);
                      	else
                      		tmp = Float64(Float64(1.0 - x) / B);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(F, B, x)
                      	tmp = 0.0;
                      	if (F <= -1.25e-88)
                      		tmp = (-1.0 - x) / B;
                      	elseif (F <= 1.05e-20)
                      		tmp = -x / B;
                      	else
                      		tmp = (1.0 - x) / B;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[F_, B_, x_] := If[LessEqual[F, -1.25e-88], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.05e-20], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;F \leq -1.25 \cdot 10^{-88}:\\
                      \;\;\;\;\frac{-1 - x}{B}\\
                      
                      \mathbf{elif}\;F \leq 1.05 \cdot 10^{-20}:\\
                      \;\;\;\;\frac{-x}{B}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{1 - x}{B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if F < -1.25000000000000002e-88

                        1. Initial program 66.3%

                          \[\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. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                        4. Applied rewrites40.9%

                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                        5. Taylor expanded in F around -inf

                          \[\leadsto \frac{-1 - x}{B} \]
                        6. Step-by-step derivation
                          1. Applied rewrites45.5%

                            \[\leadsto \frac{-1 - x}{B} \]

                          if -1.25000000000000002e-88 < F < 1.0499999999999999e-20

                          1. Initial program 99.4%

                            \[\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. Taylor expanded in B around 0

                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                          4. Applied rewrites50.5%

                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                          5. Taylor expanded in F around 0

                            \[\leadsto \frac{-1 \cdot x}{B} \]
                          6. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                            2. lift-neg.f6437.6

                              \[\leadsto \frac{-x}{B} \]
                          7. Applied rewrites37.6%

                            \[\leadsto \frac{-x}{B} \]

                          if 1.0499999999999999e-20 < F

                          1. Initial program 60.0%

                            \[\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. Taylor expanded in B around 0

                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                          4. Applied rewrites36.9%

                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                          5. Taylor expanded in F around inf

                            \[\leadsto \frac{1 - x}{B} \]
                          6. Step-by-step derivation
                            1. Applied rewrites49.2%

                              \[\leadsto \frac{1 - x}{B} \]
                          7. Recombined 3 regimes into one program.
                          8. Add Preprocessing

                          Alternative 18: 36.3% accurate, 17.5× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-88}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (if (<= F -1.25e-88) (/ (- -1.0 x) B) (/ (- x) B)))
                          double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -1.25e-88) {
                          		tmp = (-1.0 - x) / B;
                          	} else {
                          		tmp = -x / B;
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(f, b, x)
                          use fmin_fmax_functions
                              real(8), intent (in) :: f
                              real(8), intent (in) :: b
                              real(8), intent (in) :: x
                              real(8) :: tmp
                              if (f <= (-1.25d-88)) then
                                  tmp = ((-1.0d0) - x) / b
                              else
                                  tmp = -x / b
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -1.25e-88) {
                          		tmp = (-1.0 - x) / B;
                          	} else {
                          		tmp = -x / B;
                          	}
                          	return tmp;
                          }
                          
                          def code(F, B, x):
                          	tmp = 0
                          	if F <= -1.25e-88:
                          		tmp = (-1.0 - x) / B
                          	else:
                          		tmp = -x / B
                          	return tmp
                          
                          function code(F, B, x)
                          	tmp = 0.0
                          	if (F <= -1.25e-88)
                          		tmp = Float64(Float64(-1.0 - x) / B);
                          	else
                          		tmp = Float64(Float64(-x) / B);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(F, B, x)
                          	tmp = 0.0;
                          	if (F <= -1.25e-88)
                          		tmp = (-1.0 - x) / B;
                          	else
                          		tmp = -x / B;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[F_, B_, x_] := If[LessEqual[F, -1.25e-88], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;F \leq -1.25 \cdot 10^{-88}:\\
                          \;\;\;\;\frac{-1 - x}{B}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{-x}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if F < -1.25000000000000002e-88

                            1. Initial program 66.3%

                              \[\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. Taylor expanded in B around 0

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            3. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                            4. Applied rewrites40.9%

                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                            5. Taylor expanded in F around -inf

                              \[\leadsto \frac{-1 - x}{B} \]
                            6. Step-by-step derivation
                              1. Applied rewrites45.5%

                                \[\leadsto \frac{-1 - x}{B} \]

                              if -1.25000000000000002e-88 < F

                              1. Initial program 82.2%

                                \[\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. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                              4. Applied rewrites44.5%

                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around 0

                                \[\leadsto \frac{-1 \cdot x}{B} \]
                              6. Step-by-step derivation
                                1. mul-1-negN/A

                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                2. lift-neg.f6431.5

                                  \[\leadsto \frac{-x}{B} \]
                              7. Applied rewrites31.5%

                                \[\leadsto \frac{-x}{B} \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 19: 29.0% accurate, 26.3× speedup?

                            \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                            (FPCore (F B x) :precision binary64 (/ (- x) B))
                            double code(double F, double B, double x) {
                            	return -x / B;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(f, b, x)
                            use fmin_fmax_functions
                                real(8), intent (in) :: f
                                real(8), intent (in) :: b
                                real(8), intent (in) :: x
                                code = -x / b
                            end function
                            
                            public static double code(double F, double B, double x) {
                            	return -x / B;
                            }
                            
                            def code(F, B, x):
                            	return -x / B
                            
                            function code(F, B, x)
                            	return Float64(Float64(-x) / B)
                            end
                            
                            function tmp = code(F, B, x)
                            	tmp = -x / B;
                            end
                            
                            code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{-x}{B}
                            \end{array}
                            
                            Derivation
                            1. Initial program 76.7%

                              \[\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. Taylor expanded in B around 0

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            3. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                            4. Applied rewrites43.3%

                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                            5. Taylor expanded in F around 0

                              \[\leadsto \frac{-1 \cdot x}{B} \]
                            6. Step-by-step derivation
                              1. mul-1-negN/A

                                \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                              2. lift-neg.f6429.0

                                \[\leadsto \frac{-x}{B} \]
                            7. Applied rewrites29.0%

                              \[\leadsto \frac{-x}{B} \]
                            8. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2025107 
                            (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))))))