VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.3% → 99.6%
Time: 10.1s
Alternatives: 20
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}

Sampling outcomes in binary64 precision:

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 20 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.3% 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.6% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\


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

    1. Initial program 39.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. Add Preprocessing
    3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.84999999999999997e154 < F < 2.1e12

    1. Initial program 98.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

    if 2.1e12 < F

    1. Initial program 46.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
      5. *-commutativeN/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{+154}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 2100000000000:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 77.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\ t_1 := \frac{F}{\sin B}\\ t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_1\\ t_3 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ \mathbf{if}\;t\_3 \leq -1000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-26}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 10^{-12}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_3 \leq 100:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 10^{+302}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ (/ F B) (sqrt (fma x 2.0 (fma F F 2.0)))) (/ x (tan B))))
        (t_1 (/ F (sin B)))
        (t_2 (* (sqrt (/ 1.0 (fma F F 2.0))) t_1))
        (t_3
         (+
          (* x (/ -1.0 (tan B)))
          (* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
   (if (<= t_3 -1000000.0)
     t_0
     (if (<= t_3 -5e-26)
       t_2
       (if (<= t_3 1e-12)
         t_0
         (if (<= t_3 100.0) t_2 (if (<= t_3 1e+302) t_0 (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
	double t_0 = ((F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (x / tan(B));
	double t_1 = F / sin(B);
	double t_2 = sqrt((1.0 / fma(F, F, 2.0))) * t_1;
	double t_3 = (x * (-1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
	double tmp;
	if (t_3 <= -1000000.0) {
		tmp = t_0;
	} else if (t_3 <= -5e-26) {
		tmp = t_2;
	} else if (t_3 <= 1e-12) {
		tmp = t_0;
	} else if (t_3 <= 100.0) {
		tmp = t_2;
	} else if (t_3 <= 1e+302) {
		tmp = t_0;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(Float64(Float64(F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(x / tan(B)))
	t_1 = Float64(F / sin(B))
	t_2 = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * t_1)
	t_3 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_1 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
	tmp = 0.0
	if (t_3 <= -1000000.0)
		tmp = t_0;
	elseif (t_3 <= -5e-26)
		tmp = t_2;
	elseif (t_3 <= 1e-12)
		tmp = t_0;
	elseif (t_3 <= 100.0)
		tmp = t_2;
	elseif (t_3 <= 1e+302)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / B), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * 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]}, If[LessEqual[t$95$3, -1000000.0], t$95$0, If[LessEqual[t$95$3, -5e-26], t$95$2, If[LessEqual[t$95$3, 1e-12], t$95$0, If[LessEqual[t$95$3, 100.0], t$95$2, If[LessEqual[t$95$3, 1e+302], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_1\\
t_3 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_3 \leq -1000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 10^{-12}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_3 \leq 100:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 10^{+302}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1e6 or -5.00000000000000019e-26 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 9.9999999999999998e-13 or 100 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.0000000000000001e302

    1. Initial program 85.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. Add Preprocessing
    3. 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)}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\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)}}} \]
      2. lower-/.f64N/A

        \[\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. lower-sqrt.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)}}} \]
      4. 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)}}} \]
      5. associate-+r+N/A

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

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

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

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

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

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

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

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

    if -1e6 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -5.00000000000000019e-26 or 9.9999999999999998e-13 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 100

    1. Initial program 95.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. Add Preprocessing
    3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{\sin B}} \]
      9. lower-sin.f6483.9

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

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

    if 1.0000000000000001e302 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

    1. Initial program 14.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. Add Preprocessing
    3. 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}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1 - x}{B} \]
    7. Step-by-step derivation
      1. Applied rewrites90.2%

        \[\leadsto \frac{1 - x}{B} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification80.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq -1000000:\\ \;\;\;\;\frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq -5 \cdot 10^{-26}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 10^{-12}:\\ \;\;\;\;\frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 100:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 10^{+302}:\\ \;\;\;\;\frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 3: 99.6% accurate, 1.3× speedup?

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

      1. Initial program 39.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. Add Preprocessing
      3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.84999999999999997e154 < F < 2.1e12

      1. Initial program 98.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.1e12 < F

      1. Initial program 46.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
        5. *-commutativeN/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification99.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{+154}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 2100000000000:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 99.6% accurate, 1.4× speedup?

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

      1. Initial program 39.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. Add Preprocessing
      3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.84999999999999997e154 < F < 2.1e12

      1. Initial program 98.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.1e12 < F

      1. Initial program 46.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
        5. *-commutativeN/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification99.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{+154}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 2100000000000:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 98.9% accurate, 1.5× speedup?

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

      1. Initial program 60.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. Add Preprocessing
      3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

      if -10500 < F < 1.3999999999999999

      1. Initial program 99.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(F, \frac{\sqrt{\frac{1}{2}}}{\sin B}, \frac{-x}{\tan B}\right) \]
      9. Step-by-step derivation
        1. Applied rewrites98.9%

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

        if 1.3999999999999999 < F

        1. Initial program 47.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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
        6. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
          5. *-commutativeN/A

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

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

            \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\cos B} \cdot x, 1\right)}{\sin B} \]
          8. lower-sin.f6499.0

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

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification99.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -10500:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
      12. Add Preprocessing

      Alternative 6: 92.4% accurate, 1.6× speedup?

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

        1. Initial program 62.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. Add Preprocessing
        3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
        5. Applied rewrites98.2%

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

        if -0.14499999999999999 < F < 3850

        1. Initial program 99.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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 3850 < F

        1. Initial program 47.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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
        6. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
          5. *-commutativeN/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification92.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3850:\\ \;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 84.5% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (if (<= F -0.145)
         (/ (- (fma (cos B) x 1.0)) (sin B))
         (if (<= F 8e-11)
           (fma
            F
            (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ 1.0 B))
            (/ (- x) (tan B)))
           (if (<= F 1.7e+48)
             (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
             (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))
      double code(double F, double B, double x) {
      	double tmp;
      	if (F <= -0.145) {
      		tmp = -fma(cos(B), x, 1.0) / sin(B);
      	} else if (F <= 8e-11) {
      		tmp = fma(F, (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (1.0 / B)), (-x / tan(B)));
      	} else if (F <= 1.7e+48) {
      		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
      	} else {
      		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	tmp = 0.0
      	if (F <= -0.145)
      		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
      	elseif (F <= 8e-11)
      		tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(1.0 / B)), Float64(Float64(-x) / tan(B)));
      	elseif (F <= 1.7e+48)
      		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B)));
      	else
      		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := If[LessEqual[F, -0.145], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-11], N[(F * N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e+48], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $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}
      \mathbf{if}\;F \leq -0.145:\\
      \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
      
      \mathbf{elif}\;F \leq 8 \cdot 10^{-11}:\\
      \;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\
      
      \mathbf{elif}\;F \leq 1.7 \cdot 10^{+48}:\\
      \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if F < -0.14499999999999999

        1. Initial program 62.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. Add Preprocessing
        3. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
        5. Applied rewrites98.2%

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

        if -0.14499999999999999 < F < 7.99999999999999952e-11

        1. Initial program 99.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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 7.99999999999999952e-11 < F < 1.7000000000000002e48

        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. Add Preprocessing
        3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

            \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{\sin B}} \]
          9. lower-sin.f6499.4

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

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

        if 1.7000000000000002e48 < F

        1. Initial program 43.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. Add Preprocessing
        3. 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)}}} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

            \[\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)}}} \]
          2. lower-/.f64N/A

            \[\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. lower-sqrt.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)}}} \]
          4. 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)}}} \]
          5. associate-+r+N/A

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
        7. Step-by-step derivation
          1. Applied rewrites75.0%

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
        8. Recombined 4 regimes into one program.
        9. Final simplification86.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 8: 73.7% accurate, 2.1× speedup?

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

          1. Initial program 85.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. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 7.99999999999999952e-11 < F < 1.7000000000000002e48

          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. Add Preprocessing
          3. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{\sin B}} \]
            9. lower-sin.f6499.4

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

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

          if 1.7000000000000002e48 < F

          1. Initial program 43.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. Add Preprocessing
          3. 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)}}} \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

              \[\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)}}} \]
            2. lower-/.f64N/A

              \[\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. lower-sqrt.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)}}} \]
            4. 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)}}} \]
            5. associate-+r+N/A

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
          7. Step-by-step derivation
            1. Applied rewrites75.0%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification77.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 8 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+48}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
          10. Add Preprocessing

          Alternative 9: 56.0% accurate, 2.4× speedup?

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

            1. Initial program 72.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. Add Preprocessing
            3. 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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
            4. Applied rewrites55.4%

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

            if 0.048000000000000001 < B

            1. Initial program 82.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. Add Preprocessing
            3. 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)}}} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\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)}}} \]
              2. lower-/.f64N/A

                \[\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. lower-sqrt.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)}}} \]
              4. 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)}}} \]
              5. associate-+r+N/A

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
            7. Step-by-step derivation
              1. Applied rewrites57.1%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
            8. Recombined 2 regimes into one program.
            9. Final simplification55.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.048:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \mathsf{fma}\left(\mathsf{fma}\left(\left(--0.019444444444444445\right) \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, 0.022222222222222223 \cdot x\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
            10. Add Preprocessing

            Alternative 10: 56.0% accurate, 2.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.042:\\ \;\;\;\;\frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (if (<= B 0.042)
               (+
                (/
                 (-
                  (*
                   (fma (* x 0.022222222222222223) (* B B) (* 0.3333333333333333 x))
                   (* B B))
                  x)
                 B)
                (/
                 (fma (* 0.16666666666666666 F) (* B B) F)
                 (* (sqrt (fma 2.0 x (fma F F 2.0))) B)))
               (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
            double code(double F, double B, double x) {
            	double tmp;
            	if (B <= 0.042) {
            		tmp = (((fma((x * 0.022222222222222223), (B * B), (0.3333333333333333 * x)) * (B * B)) - x) / B) + (fma((0.16666666666666666 * F), (B * B), F) / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * B));
            	} else {
            		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	tmp = 0.0
            	if (B <= 0.042)
            		tmp = Float64(Float64(Float64(Float64(fma(Float64(x * 0.022222222222222223), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B)) - x) / B) + Float64(fma(Float64(0.16666666666666666 * F), Float64(B * B), F) / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)));
            	else
            		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := If[LessEqual[B, 0.042], N[(N[(N[(N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision] / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $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}
            \mathbf{if}\;B \leq 0.042:\\
            \;\;\;\;\frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B}\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if B < 0.0420000000000000026

              1. Initial program 72.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. Add Preprocessing
              3. Taylor expanded in B around 0

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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)\right)}{B}} \]
              5. Applied rewrites59.1%

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x, {B}^{2}, \frac{1}{3} \cdot x\right)} \cdot {B}^{2} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                8. distribute-rgt-outN/A

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x \cdot \frac{1}{45}}, {B}^{2}, \frac{1}{3} \cdot x\right) \cdot {B}^{2} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                11. unpow2N/A

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(x \cdot \frac{1}{45}, B \cdot B, \color{blue}{\frac{1}{3} \cdot x}\right) \cdot {B}^{2} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                14. unpow2N/A

                  \[\leadsto \frac{\mathsf{fma}\left(x \cdot \frac{1}{45}, B \cdot B, \frac{1}{3} \cdot x\right) \cdot \color{blue}{\left(B \cdot B\right)} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                15. lower-*.f6455.2

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

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]
              9. Step-by-step derivation
                1. Applied rewrites55.2%

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

                if 0.0420000000000000026 < B

                1. Initial program 82.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. Add Preprocessing
                3. 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)}}} \]
                4. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\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)}}} \]
                  2. lower-/.f64N/A

                    \[\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. lower-sqrt.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)}}} \]
                  4. 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)}}} \]
                  5. associate-+r+N/A

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                7. Step-by-step derivation
                  1. Applied rewrites57.1%

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                8. Recombined 2 regimes into one program.
                9. Final simplification55.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.042:\\ \;\;\;\;\frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
                10. Add Preprocessing

                Alternative 11: 51.7% accurate, 2.9× speedup?

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

                  1. Initial program 41.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. Add Preprocessing
                  3. 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}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                  5. Applied rewrites29.4%

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

                    \[\leadsto \frac{-1 - x}{B} \]
                  7. Step-by-step derivation
                    1. Applied rewrites41.3%

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

                    if -6.4999999999999997e152 < F < 3.3999999999999999e105

                    1. Initial program 96.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. Add Preprocessing
                    3. 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}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                    6. 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}} \]
                    7. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\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}} \]
                    8. Applied rewrites50.5%

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

                    if 3.3999999999999999e105 < F

                    1. Initial program 34.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. Add Preprocessing
                    3. 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}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{1 - x}{B} \]
                    7. Step-by-step derivation
                      1. Applied rewrites48.1%

                        \[\leadsto \frac{1 - x}{B} \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification48.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{+152}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{+105}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 12: 51.5% accurate, 3.8× speedup?

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

                      1. Initial program 41.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. Add Preprocessing
                      3. 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}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                      5. Applied rewrites29.4%

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

                        \[\leadsto \frac{-1 - x}{B} \]
                      7. Step-by-step derivation
                        1. Applied rewrites41.3%

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

                        if -6.4999999999999997e152 < F < 1.14999999999999994e82

                        1. Initial program 97.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. Add Preprocessing
                        3. 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}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\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. Applied rewrites49.9%

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

                        if 1.14999999999999994e82 < F

                        1. Initial program 38.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. Add Preprocessing
                        3. 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}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                        7. Step-by-step derivation
                          1. Applied rewrites49.2%

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B} \]
                        8. Recombined 3 regimes into one program.
                        9. Final simplification48.3%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{+152}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+82}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \left(0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot x\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 13: 51.7% accurate, 4.4× speedup?

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

                          1. Initial program 62.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. Add Preprocessing
                          3. 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}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                          5. Applied rewrites36.8%

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

                            \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                          7. Step-by-step derivation
                            1. Applied rewrites43.8%

                              \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]
                            2. Taylor expanded in x around 0

                              \[\leadsto \frac{\left(\frac{1}{{F}^{2}} - 1\right) - x}{B} \]
                            3. Step-by-step derivation
                              1. Applied rewrites43.8%

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

                              if -0.14499999999999999 < F < 7.19999999999999967e48

                              1. Initial program 99.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. Add Preprocessing
                              3. 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}} \]
                              4. Step-by-step derivation
                                1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 7.19999999999999967e48 < F

                              1. Initial program 43.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. Add Preprocessing
                              3. Taylor expanded in B around 0

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

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

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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)\right)}{B}} \]
                              5. Applied rewrites41.4%

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x, {B}^{2}, \frac{1}{3} \cdot x\right)} \cdot {B}^{2} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                                8. distribute-rgt-outN/A

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

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

                                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x \cdot \frac{1}{45}}, {B}^{2}, \frac{1}{3} \cdot x\right) \cdot {B}^{2} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                                11. unpow2N/A

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

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

                                  \[\leadsto \frac{\mathsf{fma}\left(x \cdot \frac{1}{45}, B \cdot B, \color{blue}{\frac{1}{3} \cdot x}\right) \cdot {B}^{2} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                                14. unpow2N/A

                                  \[\leadsto \frac{\mathsf{fma}\left(x \cdot \frac{1}{45}, B \cdot B, \frac{1}{3} \cdot x\right) \cdot \color{blue}{\left(B \cdot B\right)} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                                15. lower-*.f6438.4

                                  \[\leadsto \frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \color{blue}{\left(B \cdot B\right)} - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]
                              8. Applied rewrites38.4%

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

                                \[\leadsto \frac{\mathsf{fma}\left(x \cdot \frac{1}{45}, B \cdot B, \frac{1}{3} \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{1 + \frac{1}{6} \cdot {B}^{2}}{\color{blue}{B}} \]
                              10. Step-by-step derivation
                                1. Applied rewrites51.7%

                                  \[\leadsto \frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{\color{blue}{B}} \]
                              11. Recombined 3 regimes into one program.
                              12. Final simplification48.2%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{+48}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x \cdot 0.022222222222222223, B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \]
                              13. Add Preprocessing

                              Alternative 14: 51.8% accurate, 5.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 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 -0.145)
                                 (/ (- (- (/ 1.0 (* F F)) 1.0) x) B)
                                 (if (<= F 100000000.0)
                                   (/ (- (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F) x) B)
                                   (/ (- 1.0 x) B))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (F <= -0.145) {
                              		tmp = (((1.0 / (F * F)) - 1.0) - x) / B;
                              	} else if (F <= 100000000.0) {
                              		tmp = ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
                              	} else {
                              		tmp = (1.0 - x) / B;
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (F <= -0.145)
                              		tmp = Float64(Float64(Float64(Float64(1.0 / Float64(F * F)) - 1.0) - x) / B);
                              	elseif (F <= 100000000.0)
                              		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B);
                              	else
                              		tmp = Float64(Float64(1.0 - x) / B);
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := If[LessEqual[F, -0.145], N[(N[(N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 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 -0.145:\\
                              \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\
                              
                              \mathbf{elif}\;F \leq 100000000:\\
                              \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 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 < -0.14499999999999999

                                1. Initial program 62.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. Add Preprocessing
                                3. 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}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                5. Applied rewrites36.8%

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

                                  \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites43.8%

                                    \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]
                                  2. Taylor expanded in x around 0

                                    \[\leadsto \frac{\left(\frac{1}{{F}^{2}} - 1\right) - x}{B} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites43.8%

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

                                    if -0.14499999999999999 < F < 1e8

                                    1. Initial program 99.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. Add Preprocessing
                                    3. 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}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 1e8 < F

                                    1. Initial program 46.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. Add Preprocessing
                                    3. 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}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{1 - x}{B} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites51.7%

                                        \[\leadsto \frac{1 - x}{B} \]
                                    8. Recombined 3 regimes into one program.
                                    9. Final simplification48.2%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 15: 44.1% accurate, 5.9× speedup?

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

                                      1. Initial program 68.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. Add Preprocessing
                                      3. 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}} \]
                                      4. Step-by-step derivation
                                        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{-1 - x}{B} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites39.2%

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

                                        if -7.5000000000000002e-60 < F < 1.5e-124

                                        1. Initial program 99.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. Add Preprocessing
                                        3. 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}} \]
                                        4. Step-by-step derivation
                                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites40.5%

                                            \[\leadsto \frac{-x}{B} \]

                                          if 1.5e-124 < F < 1.8e-72

                                          1. Initial program 99.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. Add Preprocessing
                                          3. 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}} \]
                                          4. Step-by-step derivation
                                            1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                          5. Applied rewrites43.3%

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

                                            \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites43.6%

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

                                            if 1.8e-72 < F

                                            1. Initial program 55.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. Add Preprocessing
                                            3. 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}} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                            5. Applied rewrites42.8%

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

                                              \[\leadsto \frac{1 - x}{B} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites48.9%

                                                \[\leadsto \frac{1 - x}{B} \]
                                            8. Recombined 4 regimes into one program.
                                            9. Final simplification43.0%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.8 \cdot 10^{-72}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                            10. Add Preprocessing

                                            Alternative 16: 51.3% accurate, 6.2× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -0.145)
                                               (/ (- (- (/ 1.0 (* F F)) 1.0) x) B)
                                               (if (<= F 3.8e-10)
                                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                                                 (/ (- 1.0 x) B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -0.145) {
                                            		tmp = (((1.0 / (F * F)) - 1.0) - x) / B;
                                            	} else if (F <= 3.8e-10) {
                                            		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                                            	} else {
                                            		tmp = (1.0 - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -0.145)
                                            		tmp = Float64(Float64(Float64(Float64(1.0 / Float64(F * F)) - 1.0) - x) / B);
                                            	elseif (F <= 3.8e-10)
                                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                                            	else
                                            		tmp = Float64(Float64(1.0 - x) / B);
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -0.145], N[(N[(N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.8e-10], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 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 -0.145:\\
                                            \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 3.8 \cdot 10^{-10}:\\
                                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\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 < -0.14499999999999999

                                              1. Initial program 62.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. Add Preprocessing
                                              3. 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}} \]
                                              4. Step-by-step derivation
                                                1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                              5. Applied rewrites36.8%

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

                                                \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites43.8%

                                                  \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]
                                                2. Taylor expanded in x around 0

                                                  \[\leadsto \frac{\left(\frac{1}{{F}^{2}} - 1\right) - x}{B} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites43.8%

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

                                                  if -0.14499999999999999 < F < 3.7999999999999998e-10

                                                  1. Initial program 99.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. Add Preprocessing
                                                  3. 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}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites49.1%

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

                                                    if 3.7999999999999998e-10 < F

                                                    1. Initial program 48.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. Add Preprocessing
                                                    3. 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}} \]
                                                    4. Step-by-step derivation
                                                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \frac{1 - x}{B} \]
                                                    8. Recombined 3 regimes into one program.
                                                    9. Final simplification48.0%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                    10. Add Preprocessing

                                                    Alternative 17: 51.8% accurate, 6.8× speedup?

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

                                                      1. Initial program 62.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. Add Preprocessing
                                                      3. 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}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                      5. Applied rewrites36.8%

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

                                                        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites43.8%

                                                          \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]
                                                        2. Taylor expanded in x around 0

                                                          \[\leadsto \frac{\left(\frac{1}{{F}^{2}} - 1\right) - x}{B} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites43.8%

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

                                                          if -0.14499999999999999 < F < 1e8

                                                          1. Initial program 99.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. Add Preprocessing
                                                          3. 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}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites48.7%

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

                                                              \[\leadsto \frac{\frac{F \cdot 1}{\sqrt{2 + {F}^{2}}} - x}{B} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites48.6%

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

                                                              if 1e8 < F

                                                              1. Initial program 46.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. Add Preprocessing
                                                              3. 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}} \]
                                                              4. Step-by-step derivation
                                                                1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \frac{1 - x}{B} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites51.7%

                                                                  \[\leadsto \frac{1 - x}{B} \]
                                                              8. Recombined 3 regimes into one program.
                                                              9. Final simplification48.1%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.145:\\ \;\;\;\;\frac{\left(\frac{1}{F \cdot F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 100000000:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                              10. Add Preprocessing

                                                              Alternative 18: 44.4% accurate, 13.6× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-10}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                              (FPCore (F B x)
                                                               :precision binary64
                                                               (if (<= F -7.5e-60)
                                                                 (/ (- -1.0 x) B)
                                                                 (if (<= F 2.2e-10) (/ (- x) B) (/ (- 1.0 x) B))))
                                                              double code(double F, double B, double x) {
                                                              	double tmp;
                                                              	if (F <= -7.5e-60) {
                                                              		tmp = (-1.0 - x) / B;
                                                              	} else if (F <= 2.2e-10) {
                                                              		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 <= (-7.5d-60)) then
                                                                      tmp = ((-1.0d0) - x) / b
                                                                  else if (f <= 2.2d-10) 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 <= -7.5e-60) {
                                                              		tmp = (-1.0 - x) / B;
                                                              	} else if (F <= 2.2e-10) {
                                                              		tmp = -x / B;
                                                              	} else {
                                                              		tmp = (1.0 - x) / B;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              def code(F, B, x):
                                                              	tmp = 0
                                                              	if F <= -7.5e-60:
                                                              		tmp = (-1.0 - x) / B
                                                              	elif F <= 2.2e-10:
                                                              		tmp = -x / B
                                                              	else:
                                                              		tmp = (1.0 - x) / B
                                                              	return tmp
                                                              
                                                              function code(F, B, x)
                                                              	tmp = 0.0
                                                              	if (F <= -7.5e-60)
                                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                                              	elseif (F <= 2.2e-10)
                                                              		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 <= -7.5e-60)
                                                              		tmp = (-1.0 - x) / B;
                                                              	elseif (F <= 2.2e-10)
                                                              		tmp = -x / B;
                                                              	else
                                                              		tmp = (1.0 - x) / B;
                                                              	end
                                                              	tmp_2 = tmp;
                                                              end
                                                              
                                                              code[F_, B_, x_] := If[LessEqual[F, -7.5e-60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e-10], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\
                                                              \;\;\;\;\frac{-1 - x}{B}\\
                                                              
                                                              \mathbf{elif}\;F \leq 2.2 \cdot 10^{-10}:\\
                                                              \;\;\;\;\frac{-x}{B}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\frac{1 - x}{B}\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if F < -7.5000000000000002e-60

                                                                1. Initial program 68.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. Add Preprocessing
                                                                3. 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}} \]
                                                                4. Step-by-step derivation
                                                                  1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites39.2%

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

                                                                  if -7.5000000000000002e-60 < F < 2.1999999999999999e-10

                                                                  1. Initial program 99.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. Add Preprocessing
                                                                  3. 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}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites36.2%

                                                                      \[\leadsto \frac{-x}{B} \]

                                                                    if 2.1999999999999999e-10 < F

                                                                    1. Initial program 48.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. Add Preprocessing
                                                                    3. 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}} \]
                                                                    4. Step-by-step derivation
                                                                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \frac{1 - x}{B} \]
                                                                    8. Recombined 3 regimes into one program.
                                                                    9. Final simplification41.3%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-10}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                                    10. Add Preprocessing

                                                                    Alternative 19: 37.4% accurate, 17.5× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                    (FPCore (F B x)
                                                                     :precision binary64
                                                                     (if (<= F -7.5e-60) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                    double code(double F, double B, double x) {
                                                                    	double tmp;
                                                                    	if (F <= -7.5e-60) {
                                                                    		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 <= (-7.5d-60)) 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 <= -7.5e-60) {
                                                                    		tmp = (-1.0 - x) / B;
                                                                    	} else {
                                                                    		tmp = -x / B;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(F, B, x):
                                                                    	tmp = 0
                                                                    	if F <= -7.5e-60:
                                                                    		tmp = (-1.0 - x) / B
                                                                    	else:
                                                                    		tmp = -x / B
                                                                    	return tmp
                                                                    
                                                                    function code(F, B, x)
                                                                    	tmp = 0.0
                                                                    	if (F <= -7.5e-60)
                                                                    		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 <= -7.5e-60)
                                                                    		tmp = (-1.0 - x) / B;
                                                                    	else
                                                                    		tmp = -x / B;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    code[F_, B_, x_] := If[LessEqual[F, -7.5e-60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\
                                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\frac{-x}{B}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if F < -7.5000000000000002e-60

                                                                      1. Initial program 68.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. Add Preprocessing
                                                                      3. 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}} \]
                                                                      4. Step-by-step derivation
                                                                        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \frac{-1 - x}{B} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites39.2%

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

                                                                        if -7.5000000000000002e-60 < F

                                                                        1. Initial program 77.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. Add Preprocessing
                                                                        3. 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}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites32.4%

                                                                            \[\leadsto \frac{-x}{B} \]
                                                                        8. Recombined 2 regimes into one program.
                                                                        9. Final simplification34.6%

                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
                                                                        10. Add Preprocessing

                                                                        Alternative 20: 30.2% 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 74.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. Add Preprocessing
                                                                        3. 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}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites30.1%

                                                                            \[\leadsto \frac{-x}{B} \]
                                                                          2. Final simplification30.1%

                                                                            \[\leadsto \frac{-x}{B} \]
                                                                          3. Add Preprocessing

                                                                          Reproduce

                                                                          ?
                                                                          herbie shell --seed 2025016 
                                                                          (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))))))