VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.7% → 99.1%
Time: 13.1s
Alternatives: 25
Speedup: 2.2×

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 25 alternatives:

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

Initial Program: 76.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 99.1% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 32.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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. Applied rewrites100.0%

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

      if -3.1000000000000001e154 < F < 3.65000000000000024e164

      1. Initial program 94.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 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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. 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) \]
        21. 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) \]
        22. *-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) \]
        23. 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) \]
      7. Applied rewrites99.7%

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

      if 3.65000000000000024e164 < F

      1. Initial program 30.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2} \cdot \sin B} + \frac{1}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

    Alternative 2: 91.8% accurate, 1.0× speedup?

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

      1. Initial program 49.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.1e43 < F < -7.6000000000000004e-107

      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. 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.4%

        \[\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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. lower-sqrt.f6499.4

          \[\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) \]
        21. 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) \]
        22. *-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) \]
        23. lower-fma.f6499.4

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

        \[\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) \]
      7. Applied rewrites99.6%

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

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      9. Step-by-step derivation
        1. lower-/.f6488.8

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      10. Applied rewrites88.8%

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

      if -7.6000000000000004e-107 < F < 19

      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.7%

        \[\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-/.f6489.1

          \[\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 rewrites89.1%

        \[\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 19 < F

      1. Initial program 56.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 rewrites71.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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. lower-sqrt.f6471.7

          \[\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) \]
        21. 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) \]
        22. *-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) \]
        23. lower-fma.f6471.7

          \[\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 rewrites71.7%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
      8. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

    Alternative 3: 78.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{-73} \lor \neg \left(x \leq 1.5 \cdot 10^{-73}\right):\\ \;\;\;\;\mathsf{fma}\left(F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot {B}^{-1}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (or (<= x -2.05e-73) (not (<= x 1.5e-73)))
       (fma
        F
        (* (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (pow B -1.0))
        (/ (- x) (tan B)))
       (- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))))
    double code(double F, double B, double x) {
    	double tmp;
    	if ((x <= -2.05e-73) || !(x <= 1.5e-73)) {
    		tmp = fma(F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) * pow(B, -1.0)), (-x / tan(B)));
    	} else {
    		tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if ((x <= -2.05e-73) || !(x <= 1.5e-73))
    		tmp = fma(F, Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) * (B ^ -1.0)), Float64(Float64(-x) / tan(B)));
    	else
    		tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[Or[LessEqual[x, -2.05e-73], N[Not[LessEqual[x, 1.5e-73]], $MachinePrecision]], N[(F * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -2.05 \cdot 10^{-73} \lor \neg \left(x \leq 1.5 \cdot 10^{-73}\right):\\
    \;\;\;\;\mathsf{fma}\left(F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot {B}^{-1}, \frac{-x}{\tan B}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.05000000000000008e-73 or 1.5e-73 < x

      1. Initial program 79.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 rewrites94.4%

        \[\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-/.f6489.6

          \[\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 rewrites89.6%

        \[\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 -2.05000000000000008e-73 < x < 1.5e-73

      1. Initial program 70.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. 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 rewrites74.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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. lower-sqrt.f6474.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) \]
        21. 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) \]
        22. *-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) \]
        23. lower-fma.f6474.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 rewrites74.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) \]
      7. Applied rewrites74.8%

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

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      9. Step-by-step derivation
        1. lower-/.f6466.0

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      10. Applied rewrites66.0%

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification78.2%

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

    Alternative 4: 81.1% accurate, 1.0× speedup?

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

      1. Initial program 49.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.1e43 < F < -7.6000000000000004e-107

      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. 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.4%

        \[\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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. lower-sqrt.f6499.4

          \[\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) \]
        21. 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) \]
        22. *-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) \]
        23. lower-fma.f6499.4

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

        \[\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) \]
      7. Applied rewrites99.6%

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

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      9. Step-by-step derivation
        1. lower-/.f6488.8

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      10. Applied rewrites88.8%

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

      if -7.6000000000000004e-107 < F

      1. Initial program 80.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. 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 rewrites87.2%

        \[\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-/.f6475.9

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

        \[\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) \]
    3. Recombined 3 regimes into one program.
    4. Final simplification83.3%

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

    Alternative 5: 99.1% accurate, 1.0× speedup?

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

      1. Initial program 55.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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.69999999999999996 < F < 0.95999999999999996

      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 F around 0

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - \frac{x \cdot \cos B}{\sin B}} \]
      4. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
        2. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}}{\sin B}} + \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B} \]
        4. distribute-lft-neg-inN/A

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

          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right)\right) \]
        6. mul-1-negN/A

          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}}{\sin B} + \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
        7. associate-*r/N/A

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

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

          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
      5. Applied rewrites98.5%

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

      if 0.95999999999999996 < F

      1. Initial program 57.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. 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 rewrites72.4%

        \[\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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. lower-sqrt.f6472.4

          \[\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) \]
        21. 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) \]
        22. *-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) \]
        23. lower-fma.f6472.4

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
      8. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

    Alternative 6: 99.1% accurate, 1.4× speedup?

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

      1. Initial program 32.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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.1000000000000001e154 < F < 3.65000000000000024e164

      1. Initial program 94.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 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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. 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) \]
        21. 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) \]
        22. *-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) \]
        23. 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) \]
      7. Applied rewrites99.7%

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

      if 3.65000000000000024e164 < F

      1. Initial program 30.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2} \cdot \sin B} + \frac{1}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

    Alternative 7: 99.7% accurate, 1.4× speedup?

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

      1. Initial program 51.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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.99999999999999991e37 < F < 2e5

      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. 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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. 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) \]
        21. 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) \]
        22. *-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) \]
        23. 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) \]
      7. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{F}{\sqrt{\color{blue}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        13. lift-sqrt.f6499.7

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

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

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

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

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

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

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

      if 2e5 < F

      1. Initial program 55.9%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

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

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

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

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

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

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

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

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

    Alternative 8: 99.7% accurate, 1.4× speedup?

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

      1. Initial program 51.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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.99999999999999991e37 < F < 1e8

      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. 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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. 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) \]
        21. 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) \]
        22. *-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) \]
        23. 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) \]
      7. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{F}{\sqrt{\color{blue}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        13. lift-sqrt.f6499.7

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

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

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

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

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

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

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

      if 1e8 < F

      1. Initial program 55.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.8%

        \[\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-pow2N/A

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
        12. 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) \]
        13. 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) \]
        14. 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) \]
        15. +-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) \]
        16. 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) \]
        17. 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) \]
        18. +-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) \]
        19. 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) \]
        20. lower-sqrt.f6470.8

          \[\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) \]
        21. 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) \]
        22. *-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) \]
        23. lower-fma.f6470.8

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
      8. 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. associate-*r*N/A

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

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

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

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

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

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

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

    Alternative 9: 99.0% accurate, 1.4× speedup?

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

      1. Initial program 55.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 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.3999999999999999 < F < 0.95999999999999996

      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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
      4. Step-by-step derivation
        1. lower-sqrt.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2}} \]
      7. Step-by-step derivation
        1. Applied rewrites98.3%

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{0.5} \]

        if 0.95999999999999996 < F

        1. Initial program 57.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. 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 rewrites72.4%

          \[\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-pow2N/A

            \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
          12. 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) \]
          13. 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) \]
          14. 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) \]
          15. +-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) \]
          16. 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) \]
          17. 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) \]
          18. +-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) \]
          19. 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) \]
          20. lower-sqrt.f6472.4

            \[\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) \]
          21. 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) \]
          22. *-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) \]
          23. lower-fma.f6472.4

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
        8. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

      Alternative 10: 51.6% accurate, 1.7× speedup?

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

        1. Initial program 56.4%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. 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.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 rewrites39.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 rewrites50.2%

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

          if -0.00115 < F < 1e16

          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 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.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 rewrites50.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 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.9%

            \[\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}} \]
          9. Step-by-step derivation
            1. Applied rewrites51.0%

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

            if 1e16 < F

            1. Initial program 54.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.f6438.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 rewrites38.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 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 rewrites39.7%

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

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

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

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

            Alternative 11: 51.4% accurate, 2.0× speedup?

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

              1. Initial program 56.4%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. 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.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 rewrites39.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 rewrites50.2%

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

                if -0.00115 < F < 24.5

                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 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 rewrites51.1%

                  \[\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 24.5 < F

                1. Initial program 56.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.f6438.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 rewrites38.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 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 rewrites39.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}} \]
                9. Taylor expanded in F around inf

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00115:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 24.5:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, \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(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                13. Add Preprocessing

                Alternative 12: 77.1% accurate, 2.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{-14} \lor \neg \left(x \leq 2.4 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (or (<= x -8.6e-14) (not (<= x 2.4e-42)))
                   (/ (- x) (tan B))
                   (- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))))
                double code(double F, double B, double x) {
                	double tmp;
                	if ((x <= -8.6e-14) || !(x <= 2.4e-42)) {
                		tmp = -x / tan(B);
                	} else {
                		tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if ((x <= -8.6e-14) || !(x <= 2.4e-42))
                		tmp = Float64(Float64(-x) / tan(B));
                	else
                		tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[Or[LessEqual[x, -8.6e-14], N[Not[LessEqual[x, 2.4e-42]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq -8.6 \cdot 10^{-14} \lor \neg \left(x \leq 2.4 \cdot 10^{-42}\right):\\
                \;\;\;\;\frac{-x}{\tan B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -8.59999999999999996e-14 or 2.40000000000000003e-42 < x

                  1. Initial program 81.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 rewrites97.7%

                    \[\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 0

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

                      \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                    2. associate-/l*N/A

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

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

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

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

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

                      \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                    8. lower-sin.f6494.2

                      \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                  7. Applied rewrites94.2%

                    \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                  8. Step-by-step derivation
                    1. Applied rewrites94.4%

                      \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]

                    if -8.59999999999999996e-14 < x < 2.40000000000000003e-42

                    1. Initial program 70.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 rewrites75.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. 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-pow2N/A

                        \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{\color{blue}{\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{{\left(\sqrt{\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{{\left(\sqrt{\color{blue}{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{{\left(\sqrt{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{{\left(\sqrt{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{{\left(\sqrt{\color{blue}{\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{\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) \]
                      12. 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) \]
                      13. 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) \]
                      14. 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) \]
                      15. +-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) \]
                      16. 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) \]
                      17. 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) \]
                      18. +-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) \]
                      19. 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) \]
                      20. lower-sqrt.f6475.1

                        \[\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) \]
                      21. 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) \]
                      22. *-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) \]
                      23. lower-fma.f6475.1

                        \[\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 rewrites75.1%

                      \[\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) \]
                    7. Applied rewrites75.3%

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

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

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

                      \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
                  9. Recombined 2 regimes into one program.
                  10. Final simplification77.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{-14} \lor \neg \left(x \leq 2.4 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \]
                  11. Add Preprocessing

                  Alternative 13: 51.8% accurate, 2.5× speedup?

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

                    1. Initial program 32.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{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.f6431.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 rewrites31.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 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 rewrites32.0%

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

                      \[\leadsto \frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B} \]
                    10. Step-by-step derivation
                      1. Applied rewrites50.5%

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

                      if -3.1000000000000001e154 < F < 7.49999999999999945e29

                      1. Initial program 96.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{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.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 rewrites50.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 x around 0

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

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

                        if 7.49999999999999945e29 < F

                        1. Initial program 54.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.f6439.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 rewrites39.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 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 rewrites40.3%

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

                          \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                        10. Step-by-step derivation
                          1. Applied rewrites50.6%

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

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

                        Alternative 14: 51.6% accurate, 2.5× speedup?

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

                          1. Initial program 57.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.f6439.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 rewrites39.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 rewrites49.6%

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

                            if -3.04999999999999994e-5 < F < 0.95999999999999996

                            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 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.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 rewrites50.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 0

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

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

                              if 0.95999999999999996 < F

                              1. Initial program 57.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.f6440.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 rewrites40.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 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 rewrites41.1%

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

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

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

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

                              Alternative 15: 44.6% accurate, 2.5× speedup?

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

                                1. Initial program 57.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.f6440.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 rewrites40.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 rewrites50.3%

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

                                  if -2.99999999999999983e-18 < F < -4.2000000000000002e-133

                                  1. Initial program 99.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 \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.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 rewrites50.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 x around 0

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

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

                                    if -4.2000000000000002e-133 < F < 7.99999999999999962e-44

                                    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.f6450.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 rewrites50.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 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.9%

                                      \[\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}} \]
                                    9. Taylor expanded in x around inf

                                      \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                                    10. Step-by-step derivation
                                      1. Applied rewrites37.4%

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

                                      if 7.99999999999999962e-44 < F

                                      1. Initial program 59.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.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 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 rewrites40.4%

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

                                        \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                      10. Step-by-step derivation
                                        1. Applied rewrites47.4%

                                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                      11. Recombined 4 regimes into one program.
                                      12. Final simplification44.5%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-18}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-133}:\\ \;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-44}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot 0.3333333333333333 - 1\right) \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                      13. Add Preprocessing

                                      Alternative 16: 44.6% accurate, 2.5× speedup?

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

                                        1. Initial program 57.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.f6440.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 rewrites40.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 rewrites50.3%

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

                                          if -2.99999999999999983e-18 < F < -4.2000000000000002e-133

                                          1. Initial program 99.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 \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.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 rewrites50.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 x around 0

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

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

                                            if -4.2000000000000002e-133 < F < 7.99999999999999962e-44

                                            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.f6450.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 rewrites50.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 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.9%

                                              \[\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}} \]
                                            9. Taylor expanded in x around inf

                                              \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                                            10. Step-by-step derivation
                                              1. Applied rewrites37.4%

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

                                              if 7.99999999999999962e-44 < F

                                              1. Initial program 59.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.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 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 rewrites40.4%

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

                                                \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                              10. Step-by-step derivation
                                                1. Applied rewrites47.4%

                                                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                              11. Recombined 4 regimes into one program.
                                              12. Final simplification44.5%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-18}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-133}:\\ \;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-44}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot 0.3333333333333333 - 1\right) \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                              13. Add Preprocessing

                                              Alternative 17: 57.9% accurate, 3.1× speedup?

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

                                                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{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.f6461.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 rewrites61.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 rewrites61.3%

                                                  \[\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}} \]
                                                9. Applied rewrites61.3%

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

                                                if 0.0085000000000000006 < B

                                                1. Initial program 82.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 rewrites82.8%

                                                  \[\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 0

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

                                                    \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                  2. associate-/l*N/A

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

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

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

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

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

                                                    \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                                  8. lower-sin.f6455.7

                                                    \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                                7. Applied rewrites55.7%

                                                  \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                                8. Step-by-step derivation
                                                  1. Applied rewrites55.7%

                                                    \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                                9. Recombined 2 regimes into one program.
                                                10. Final simplification59.7%

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

                                                Alternative 18: 51.5% accurate, 3.2× speedup?

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

                                                  1. Initial program 56.4%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. 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.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 rewrites39.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 rewrites50.2%

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

                                                    if -0.00115 < F < 24.5

                                                    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 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.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 rewrites51.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 rewrites51.3%

                                                      \[\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}} \]
                                                    9. Applied rewrites51.4%

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

                                                    if 24.5 < F

                                                    1. Initial program 56.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.f6438.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 rewrites38.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 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 rewrites39.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}} \]
                                                    9. Taylor expanded in F around inf

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

                                                        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                                    11. Recombined 3 regimes into one program.
                                                    12. Add Preprocessing

                                                    Alternative 19: 51.8% accurate, 6.1× speedup?

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

                                                      1. Initial program 32.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{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.f6431.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 rewrites31.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 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 rewrites32.0%

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

                                                        \[\leadsto \frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B} \]
                                                      10. Step-by-step derivation
                                                        1. Applied rewrites50.5%

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

                                                        if -3.1000000000000001e154 < F < 7.49999999999999945e29

                                                        1. Initial program 96.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{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.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 rewrites50.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. Step-by-step derivation
                                                          1. Applied rewrites50.1%

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

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

                                                            if 7.49999999999999945e29 < F

                                                            1. Initial program 54.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.f6439.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 rewrites39.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 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 rewrites40.3%

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

                                                              \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                                            10. Step-by-step derivation
                                                              1. Applied rewrites50.6%

                                                                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                                            11. Recombined 3 regimes into one program.
                                                            12. Add Preprocessing

                                                            Alternative 20: 51.8% accurate, 6.8× speedup?

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

                                                              1. Initial program 32.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{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.f6431.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 rewrites31.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 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 rewrites32.0%

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

                                                                \[\leadsto \frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B} \]
                                                              10. Step-by-step derivation
                                                                1. Applied rewrites50.5%

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

                                                                if -3.1000000000000001e154 < F < 7.49999999999999945e29

                                                                1. Initial program 96.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{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.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 rewrites50.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. Step-by-step derivation
                                                                  1. Applied rewrites50.1%

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

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

                                                                    if 7.49999999999999945e29 < F

                                                                    1. Initial program 54.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.f6439.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 rewrites39.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 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 rewrites40.3%

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

                                                                      \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                                                    10. Step-by-step derivation
                                                                      1. Applied rewrites50.6%

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

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

                                                                    Alternative 21: 44.5% accurate, 8.4× speedup?

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

                                                                      1. Initial program 65.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.f6441.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 rewrites41.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{-1 - x}{B} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites42.9%

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

                                                                        if -3.3000000000000001e-93 < F < 7.99999999999999962e-44

                                                                        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 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.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 rewrites51.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 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 rewrites51.8%

                                                                          \[\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}} \]
                                                                        9. Taylor expanded in x around inf

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

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

                                                                          if 7.99999999999999962e-44 < F

                                                                          1. Initial program 59.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.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 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 rewrites40.4%

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

                                                                            \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                                                          10. Step-by-step derivation
                                                                            1. Applied rewrites47.4%

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                                                          11. Recombined 3 regimes into one program.
                                                                          12. Add Preprocessing

                                                                          Alternative 22: 44.5% accurate, 8.8× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.56 \cdot 10^{-24}:\\ \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot 0.3333333333333333 - 1\right) \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                          (FPCore (F B x)
                                                                           :precision binary64
                                                                           (if (<= F -3.3e-93)
                                                                             (/ (- -1.0 x) B)
                                                                             (if (<= F 1.56e-24)
                                                                               (/ (* (- (* (* B B) 0.3333333333333333) 1.0) x) B)
                                                                               (/ (- 1.0 x) B))))
                                                                          double code(double F, double B, double x) {
                                                                          	double tmp;
                                                                          	if (F <= -3.3e-93) {
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	} else if (F <= 1.56e-24) {
                                                                          		tmp = ((((B * B) * 0.3333333333333333) - 1.0) * 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 <= (-3.3d-93)) then
                                                                                  tmp = ((-1.0d0) - x) / b
                                                                              else if (f <= 1.56d-24) then
                                                                                  tmp = ((((b * b) * 0.3333333333333333d0) - 1.0d0) * 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 <= -3.3e-93) {
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	} else if (F <= 1.56e-24) {
                                                                          		tmp = ((((B * B) * 0.3333333333333333) - 1.0) * x) / B;
                                                                          	} else {
                                                                          		tmp = (1.0 - x) / B;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(F, B, x):
                                                                          	tmp = 0
                                                                          	if F <= -3.3e-93:
                                                                          		tmp = (-1.0 - x) / B
                                                                          	elif F <= 1.56e-24:
                                                                          		tmp = ((((B * B) * 0.3333333333333333) - 1.0) * x) / B
                                                                          	else:
                                                                          		tmp = (1.0 - x) / B
                                                                          	return tmp
                                                                          
                                                                          function code(F, B, x)
                                                                          	tmp = 0.0
                                                                          	if (F <= -3.3e-93)
                                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                                          	elseif (F <= 1.56e-24)
                                                                          		tmp = Float64(Float64(Float64(Float64(Float64(B * B) * 0.3333333333333333) - 1.0) * 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 <= -3.3e-93)
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	elseif (F <= 1.56e-24)
                                                                          		tmp = ((((B * B) * 0.3333333333333333) - 1.0) * x) / B;
                                                                          	else
                                                                          		tmp = (1.0 - x) / B;
                                                                          	end
                                                                          	tmp_2 = tmp;
                                                                          end
                                                                          
                                                                          code[F_, B_, x_] := If[LessEqual[F, -3.3e-93], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.56e-24], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;F \leq -3.3 \cdot 10^{-93}:\\
                                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                                          
                                                                          \mathbf{elif}\;F \leq 1.56 \cdot 10^{-24}:\\
                                                                          \;\;\;\;\frac{\left(\left(B \cdot B\right) \cdot 0.3333333333333333 - 1\right) \cdot x}{B}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\frac{1 - x}{B}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if F < -3.3000000000000001e-93

                                                                            1. Initial program 65.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.f6441.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 rewrites41.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{-1 - x}{B} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites42.9%

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

                                                                              if -3.3000000000000001e-93 < F < 1.56e-24

                                                                              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 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.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 rewrites49.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 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.2%

                                                                                \[\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}} \]
                                                                              9. Taylor expanded in x around inf

                                                                                \[\leadsto \frac{x \cdot \left(\frac{1}{3} \cdot {B}^{2} - 1\right)}{B} \]
                                                                              10. Step-by-step derivation
                                                                                1. Applied rewrites35.9%

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

                                                                                if 1.56e-24 < F

                                                                                1. Initial program 58.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{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.f6441.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 rewrites41.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 inf

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

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

                                                                                Alternative 23: 44.5% accurate, 13.6× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-34}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                                (FPCore (F B x)
                                                                                 :precision binary64
                                                                                 (if (<= F -3.3e-93)
                                                                                   (/ (- -1.0 x) B)
                                                                                   (if (<= F 2.2e-34) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                                double code(double F, double B, double x) {
                                                                                	double tmp;
                                                                                	if (F <= -3.3e-93) {
                                                                                		tmp = (-1.0 - x) / B;
                                                                                	} else if (F <= 2.2e-34) {
                                                                                		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 <= (-3.3d-93)) then
                                                                                        tmp = ((-1.0d0) - x) / b
                                                                                    else if (f <= 2.2d-34) 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 <= -3.3e-93) {
                                                                                		tmp = (-1.0 - x) / B;
                                                                                	} else if (F <= 2.2e-34) {
                                                                                		tmp = -x / B;
                                                                                	} else {
                                                                                		tmp = (1.0 - x) / B;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                def code(F, B, x):
                                                                                	tmp = 0
                                                                                	if F <= -3.3e-93:
                                                                                		tmp = (-1.0 - x) / B
                                                                                	elif F <= 2.2e-34:
                                                                                		tmp = -x / B
                                                                                	else:
                                                                                		tmp = (1.0 - x) / B
                                                                                	return tmp
                                                                                
                                                                                function code(F, B, x)
                                                                                	tmp = 0.0
                                                                                	if (F <= -3.3e-93)
                                                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                	elseif (F <= 2.2e-34)
                                                                                		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 <= -3.3e-93)
                                                                                		tmp = (-1.0 - x) / B;
                                                                                	elseif (F <= 2.2e-34)
                                                                                		tmp = -x / B;
                                                                                	else
                                                                                		tmp = (1.0 - x) / B;
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                code[F_, B_, x_] := If[LessEqual[F, -3.3e-93], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e-34], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;F \leq -3.3 \cdot 10^{-93}:\\
                                                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                                                
                                                                                \mathbf{elif}\;F \leq 2.2 \cdot 10^{-34}:\\
                                                                                \;\;\;\;\frac{-x}{B}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\frac{1 - x}{B}\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 3 regimes
                                                                                2. if F < -3.3000000000000001e-93

                                                                                  1. Initial program 65.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.f6441.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 rewrites41.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{-1 - x}{B} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites42.9%

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

                                                                                    if -3.3000000000000001e-93 < F < 2.1999999999999999e-34

                                                                                    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 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.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 rewrites50.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 0

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

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

                                                                                      if 2.1999999999999999e-34 < F

                                                                                      1. Initial program 59.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.f6440.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 rewrites40.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 inf

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

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

                                                                                      Alternative 24: 37.3% accurate, 17.5× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                      (FPCore (F B x)
                                                                                       :precision binary64
                                                                                       (if (<= F -3.3e-93) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                      double code(double F, double B, double x) {
                                                                                      	double tmp;
                                                                                      	if (F <= -3.3e-93) {
                                                                                      		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 <= (-3.3d-93)) 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 <= -3.3e-93) {
                                                                                      		tmp = (-1.0 - x) / B;
                                                                                      	} else {
                                                                                      		tmp = -x / B;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(F, B, x):
                                                                                      	tmp = 0
                                                                                      	if F <= -3.3e-93:
                                                                                      		tmp = (-1.0 - x) / B
                                                                                      	else:
                                                                                      		tmp = -x / B
                                                                                      	return tmp
                                                                                      
                                                                                      function code(F, B, x)
                                                                                      	tmp = 0.0
                                                                                      	if (F <= -3.3e-93)
                                                                                      		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 <= -3.3e-93)
                                                                                      		tmp = (-1.0 - x) / B;
                                                                                      	else
                                                                                      		tmp = -x / B;
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[F_, B_, x_] := If[LessEqual[F, -3.3e-93], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;F \leq -3.3 \cdot 10^{-93}:\\
                                                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\frac{-x}{B}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if F < -3.3000000000000001e-93

                                                                                        1. Initial program 65.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.f6441.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 rewrites41.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{-1 - x}{B} \]
                                                                                        7. Step-by-step derivation
                                                                                          1. Applied rewrites42.9%

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

                                                                                          if -3.3000000000000001e-93 < F

                                                                                          1. Initial program 80.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.f6445.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 rewrites45.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 0

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

                                                                                              \[\leadsto \frac{-x}{B} \]
                                                                                          8. Recombined 2 regimes into one program.
                                                                                          9. Add Preprocessing

                                                                                          Alternative 25: 29.9% 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 75.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.f6444.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 rewrites44.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 0

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

                                                                                              \[\leadsto \frac{-x}{B} \]
                                                                                            2. Add Preprocessing

                                                                                            Reproduce

                                                                                            ?
                                                                                            herbie shell --seed 2024354 
                                                                                            (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))))))