VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.1% → 99.7%
Time: 8.0s
Alternatives: 23
Speedup: 1.4×

Specification

?
\[\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)} \]
(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]
\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)}

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 23 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.1% accurate, 1.0× speedup?

\[\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)} \]
(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]
\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)}

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 76.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. 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-neg.f64N/A

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
      5. lower--.f6476.1%

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

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

      \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. Applied rewrites56.6%

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
      2. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
        2. sub-flipN/A

          \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
        3. lift-/.f64N/A

          \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
        4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
      3. Applied rewrites56.6%

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

      if -36 < F < 1.8000000000000001e-4

      1. Initial program 76.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. 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-neg.f64N/A

          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
        5. lower--.f6476.1%

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

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

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

      if 1.8000000000000001e-4 < F

      1. Initial program 76.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. 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-neg.f64N/A

          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
        5. lower--.f6476.1%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
      5. Step-by-step derivation
        1. Applied rewrites56.5%

          \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
      6. Recombined 3 regimes into one program.
      7. Add Preprocessing

      Alternative 2: 99.4% accurate, 1.0× speedup?

      \[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.45 \cdot 10^{+56}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 2800000000000:\\ \;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \]
      (FPCore (F B x)
        :precision binary64
        (let* ((t_0 (/ x (tan B))))
        (if (<= F -1.45e+56)
          (/ (fma (cos B) (- x) -1.0) (sin B))
          (if (<= F 2800000000000.0)
            (- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
            (- (/ 1.0 (sin B)) t_0)))))
      double code(double F, double B, double x) {
      	double t_0 = x / tan(B);
      	double tmp;
      	if (F <= -1.45e+56) {
      		tmp = fma(cos(B), -x, -1.0) / sin(B);
      	} else if (F <= 2800000000000.0) {
      		tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
      	} else {
      		tmp = (1.0 / sin(B)) - t_0;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(x / tan(B))
      	tmp = 0.0
      	if (F <= -1.45e+56)
      		tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B));
      	elseif (F <= 2800000000000.0)
      		tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0);
      	else
      		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45e+56], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800000000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \frac{x}{\tan B}\\
      \mathbf{if}\;F \leq -1.45 \cdot 10^{+56}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
      
      \mathbf{elif}\;F \leq 2800000000000:\\
      \;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{1}{\sin B} - t\_0\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if F < -1.45e56

        1. Initial program 76.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. 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-neg.f64N/A

            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
          5. lower--.f6476.1%

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

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

          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
        5. Step-by-step derivation
          1. Applied rewrites56.6%

            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
          2. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
            2. sub-flipN/A

              \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
            3. lift-/.f64N/A

              \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
            4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
          3. Applied rewrites56.6%

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

          if -1.45e56 < F < 2.8e12

          1. Initial program 76.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. 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-neg.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
            5. lower--.f6476.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(-\frac{1}{2}\right)}}}{\sin B} - \frac{x}{\tan B} \]
            15. 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}} - \frac{x}{\tan B} \]
            16. lower-*.f64N/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}} - \frac{x}{\tan B} \]
            17. lower-/.f6484.6%

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

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

          if 2.8e12 < F

          1. Initial program 76.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. 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-neg.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
            5. lower--.f6476.1%

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

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

            \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
          5. Step-by-step derivation
            1. Applied rewrites56.5%

              \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
          6. Recombined 3 regimes into one program.
          7. Add Preprocessing

          Alternative 3: 99.4% accurate, 1.0× speedup?

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

            1. Initial program 76.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. 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-neg.f64N/A

                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
              5. lower--.f6476.1%

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

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

              \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
            5. Step-by-step derivation
              1. Applied rewrites56.6%

                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
              2. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                2. sub-flipN/A

                  \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                3. lift-/.f64N/A

                  \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
              3. Applied rewrites56.6%

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

              if -2e113 < F < 1.8000000000000001e-4

              1. Initial program 76.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. 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-neg.f64N/A

                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                5. lower--.f6476.1%

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

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

              if 1.8000000000000001e-4 < F

              1. Initial program 76.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. 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-neg.f64N/A

                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                5. lower--.f6476.1%

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

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

                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
              5. Step-by-step derivation
                1. Applied rewrites56.5%

                  \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
              6. Recombined 3 regimes into one program.
              7. Add Preprocessing

              Alternative 4: 99.3% accurate, 1.1× speedup?

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

                1. Initial program 76.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. 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-neg.f64N/A

                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                  5. lower--.f6476.1%

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

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

                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                5. Step-by-step derivation
                  1. Applied rewrites56.6%

                    \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                  2. Step-by-step derivation
                    1. lift--.f64N/A

                      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                    2. sub-flipN/A

                      \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                    3. lift-/.f64N/A

                      \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                    4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
                  3. Applied rewrites56.6%

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

                  if -1e116 < F < 1.8000000000000001e-4

                  1. Initial program 76.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. 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-neg.f64N/A

                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                    5. lower--.f6476.1%

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

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

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

                  if 1.8000000000000001e-4 < F

                  1. Initial program 76.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. 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-neg.f64N/A

                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                    5. lower--.f6476.1%

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

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

                    \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                  5. Step-by-step derivation
                    1. Applied rewrites56.5%

                      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                  6. Recombined 3 regimes into one program.
                  7. Add Preprocessing

                  Alternative 5: 99.2% accurate, 1.1× speedup?

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

                    1. Initial program 76.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. 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-neg.f64N/A

                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                      5. lower--.f6476.1%

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

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

                      \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                    5. Step-by-step derivation
                      1. Applied rewrites56.6%

                        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                      2. Step-by-step derivation
                        1. lift--.f64N/A

                          \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                        2. sub-flipN/A

                          \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                        3. lift-/.f64N/A

                          \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                        4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
                      3. Applied rewrites56.6%

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

                      if -36 < F < 1.8000000000000001e-4

                      1. Initial program 76.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. 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-neg.f64N/A

                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                        5. lower--.f6476.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(-\frac{1}{2}\right)}}}{\sin B} - \frac{x}{\tan B} \]
                        15. 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}} - \frac{x}{\tan B} \]
                        16. lower-*.f64N/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}} - \frac{x}{\tan B} \]
                        17. lower-/.f6484.6%

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

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

                        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \color{blue}{2}\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B} \]
                      7. Step-by-step derivation
                        1. Applied rewrites55.8%

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

                        if 1.8000000000000001e-4 < F

                        1. Initial program 76.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. 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-neg.f64N/A

                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                          5. lower--.f6476.1%

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

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

                          \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                        5. Step-by-step derivation
                          1. Applied rewrites56.5%

                            \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                        6. Recombined 3 regimes into one program.
                        7. Add Preprocessing

                        Alternative 6: 99.2% accurate, 1.1× speedup?

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

                          1. Initial program 76.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. 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-neg.f64N/A

                              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                            5. lower--.f6476.1%

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

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

                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                          5. Step-by-step derivation
                            1. Applied rewrites56.6%

                              \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                            2. Step-by-step derivation
                              1. lift--.f64N/A

                                \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                              2. sub-flipN/A

                                \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                              3. lift-/.f64N/A

                                \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                              4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
                            3. Applied rewrites56.6%

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

                            if -36 < F < 1.8000000000000001e-4

                            1. Initial program 76.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. 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-neg.f64N/A

                                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                              5. lower--.f6476.1%

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

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

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

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

                                \[\leadsto \frac{\mathsf{fma}\left({\left(2 + \color{blue}{2 \cdot x}\right)}^{\frac{-1}{2}}, F, \left(-x\right) \cdot \cos B\right)}{\sin B} \]
                              2. lower-*.f6456.2%

                                \[\leadsto \frac{\mathsf{fma}\left({\left(2 + 2 \cdot \color{blue}{x}\right)}^{-0.5}, F, \left(-x\right) \cdot \cos B\right)}{\sin B} \]
                            7. Applied rewrites56.2%

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

                            if 1.8000000000000001e-4 < F

                            1. Initial program 76.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. 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-neg.f64N/A

                                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                              5. lower--.f6476.1%

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

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

                              \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                            5. Step-by-step derivation
                              1. Applied rewrites56.5%

                                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                            6. Recombined 3 regimes into one program.
                            7. Add Preprocessing

                            Alternative 7: 92.2% accurate, 1.4× speedup?

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

                              1. Initial program 76.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. 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-neg.f64N/A

                                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                5. lower--.f6476.1%

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

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

                                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                              5. Step-by-step derivation
                                1. Applied rewrites56.6%

                                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                2. Step-by-step derivation
                                  1. lift--.f64N/A

                                    \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                                  2. sub-flipN/A

                                    \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                                  3. lift-/.f64N/A

                                    \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                  4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
                                3. Applied rewrites56.6%

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

                                if -36 < F < 1.8000000000000001e-4

                                1. Initial program 76.1%

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

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

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

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

                                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{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}{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-neg.f64N/A

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

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

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

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

                                    \[\leadsto \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) \]
                                  8. mult-flip-revN/A

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

                                    \[\leadsto \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                  10. sub-flip-reverseN/A

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

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

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

                                if 1.8000000000000001e-4 < F

                                1. Initial program 76.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. 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-neg.f64N/A

                                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                  5. lower--.f6476.1%

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

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

                                  \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                5. Step-by-step derivation
                                  1. Applied rewrites56.5%

                                    \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                6. Recombined 3 regimes into one program.
                                7. Add Preprocessing

                                Alternative 8: 82.3% accurate, 1.4× speedup?

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

                                  1. Initial program 76.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. 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-neg.f64N/A

                                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                    5. lower--.f6476.1%

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

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

                                    \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                  5. Step-by-step derivation
                                    1. Applied rewrites56.6%

                                      \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                    2. Step-by-step derivation
                                      1. lift--.f64N/A

                                        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                                      2. sub-flipN/A

                                        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                                      3. lift-/.f64N/A

                                        \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                      4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
                                    3. Applied rewrites56.6%

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

                                    if -36 < F < 5.2e-39

                                    1. Initial program 76.1%

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

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

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

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

                                        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{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}{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-neg.f64N/A

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

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

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

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

                                        \[\leadsto \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\color{blue}{\tan B}}\right)\right) \]
                                      8. mult-flip-revN/A

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

                                        \[\leadsto \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                      10. sub-flip-reverseN/A

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

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

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

                                    if 5.2e-39 < F < 1.7500000000000001e154

                                    1. Initial program 76.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. 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-neg.f64N/A

                                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                      5. lower--.f6476.1%

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

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

                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                    5. Step-by-step derivation
                                      1. lower-/.f6457.9%

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

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

                                    if 1.7500000000000001e154 < F

                                    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                      4. Recombined 4 regimes into one program.
                                      5. Add Preprocessing

                                      Alternative 9: 77.1% accurate, 1.4× speedup?

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

                                        1. Initial program 76.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. 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-neg.f64N/A

                                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                          5. lower--.f6476.1%

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

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

                                          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                        5. Step-by-step derivation
                                          1. Applied rewrites56.6%

                                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                          2. Step-by-step derivation
                                            1. lift--.f64N/A

                                              \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
                                            2. sub-flipN/A

                                              \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                                            3. lift-/.f64N/A

                                              \[\leadsto \frac{-1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x}{\tan B}}\right)\right) \]
                                            4. mult-flip-revN/A

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{\left(-x\right) \cdot \cos B}{\sin B} + \color{blue}{\frac{-1}{\sin B}} \]
                                          3. Applied rewrites56.6%

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

                                          if -5.2000000000000002e-83 < F < -4.0999999999999999e-107

                                          1. Initial program 76.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. 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-neg.f64N/A

                                              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                            5. lower--.f6476.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(-\frac{1}{2}\right)}}}{\sin B} - \frac{x}{\tan B} \]
                                            15. 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}} - \frac{x}{\tan B} \]
                                            16. lower-*.f64N/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}} - \frac{x}{\tan B} \]
                                            17. lower-/.f6484.6%

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

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

                                            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                          7. Step-by-step derivation
                                            1. lower-/.f6457.9%

                                              \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                          8. Applied rewrites57.9%

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

                                          if -4.0999999999999999e-107 < F < 1.4499999999999999e-202

                                          1. Initial program 76.1%

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

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

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

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

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

                                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                            5. lower-sin.f6456.2%

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

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

                                          if 1.4499999999999999e-202 < F < 1.7500000000000001e154

                                          1. Initial program 76.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. 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-neg.f64N/A

                                              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                            5. lower--.f6476.1%

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

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

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                          5. Step-by-step derivation
                                            1. lower-/.f6457.9%

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

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

                                          if 1.7500000000000001e154 < F

                                          1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                            4. Recombined 5 regimes into one program.
                                            5. Add Preprocessing

                                            Alternative 10: 76.7% accurate, 1.4× speedup?

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

                                              1. Initial program 76.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. 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-neg.f64N/A

                                                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                5. lower--.f6476.1%

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

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

                                                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                              5. Step-by-step derivation
                                                1. Applied rewrites56.6%

                                                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                2. Taylor expanded in B around 0

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

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

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

                                                    \[\leadsto \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{B}^{2}}\right)} - \frac{x}{\tan B} \]
                                                  4. lower-pow.f6455.6%

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

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

                                                if -5.2000000000000002e-83 < F < -4.0999999999999999e-107

                                                1. Initial program 76.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. 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-neg.f64N/A

                                                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                  5. lower--.f6476.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(-\frac{1}{2}\right)}}}{\sin B} - \frac{x}{\tan B} \]
                                                  15. 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}} - \frac{x}{\tan B} \]
                                                  16. lower-*.f64N/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}} - \frac{x}{\tan B} \]
                                                  17. lower-/.f6484.6%

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

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

                                                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                7. Step-by-step derivation
                                                  1. lower-/.f6457.9%

                                                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                8. Applied rewrites57.9%

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

                                                if -4.0999999999999999e-107 < F < 1.4499999999999999e-202

                                                1. Initial program 76.1%

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

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

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

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

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

                                                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                                                  5. lower-sin.f6456.2%

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

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

                                                if 1.4499999999999999e-202 < F < 1.7500000000000001e154

                                                1. Initial program 76.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. 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-neg.f64N/A

                                                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                  5. lower--.f6476.1%

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

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

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                5. Step-by-step derivation
                                                  1. lower-/.f6457.9%

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

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

                                                if 1.7500000000000001e154 < F

                                                1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                                  4. Recombined 5 regimes into one program.
                                                  5. Add Preprocessing

                                                  Alternative 11: 70.0% accurate, 1.5× speedup?

                                                  \[\begin{array}{l} t_0 := \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - \frac{x}{\tan B}\\ \mathbf{if}\;x \leq -340000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-7}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                                  (FPCore (F B x)
                                                    :precision binary64
                                                    (let* ((t_0
                                                          (-
                                                           (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
                                                           (/ x (tan B)))))
                                                    (if (<= x -340000000000.0)
                                                      t_0
                                                      (if (<= x 1.85e-7)
                                                        (-
                                                         (/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B))
                                                         (/ x B))
                                                        t_0))))
                                                  double code(double F, double B, double x) {
                                                  	double t_0 = (-1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))) - (x / tan(B));
                                                  	double tmp;
                                                  	if (x <= -340000000000.0) {
                                                  		tmp = t_0;
                                                  	} else if (x <= 1.85e-7) {
                                                  		tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
                                                  	} else {
                                                  		tmp = t_0;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(F, B, x)
                                                  	t_0 = Float64(Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))) - Float64(x / tan(B)))
                                                  	tmp = 0.0
                                                  	if (x <= -340000000000.0)
                                                  		tmp = t_0;
                                                  	elseif (x <= 1.85e-7)
                                                  		tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B));
                                                  	else
                                                  		tmp = t_0;
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -340000000000.0], t$95$0, If[LessEqual[x, 1.85e-7], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                                  
                                                  \begin{array}{l}
                                                  t_0 := \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - \frac{x}{\tan B}\\
                                                  \mathbf{if}\;x \leq -340000000000:\\
                                                  \;\;\;\;t\_0\\
                                                  
                                                  \mathbf{elif}\;x \leq 1.85 \cdot 10^{-7}:\\
                                                  \;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \frac{x}{B}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;t\_0\\
                                                  
                                                  
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if x < -3.4e11 or 1.85e-7 < x

                                                    1. Initial program 76.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. 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-neg.f64N/A

                                                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                      5. lower--.f6476.1%

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

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

                                                      \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                    5. Step-by-step derivation
                                                      1. Applied rewrites56.6%

                                                        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                      2. Taylor expanded in B around 0

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

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

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

                                                          \[\leadsto \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{B}^{2}}\right)} - \frac{x}{\tan B} \]
                                                        4. lower-pow.f6455.6%

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

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

                                                      if -3.4e11 < x < 1.85e-7

                                                      1. Initial program 76.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6476.1%

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

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

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                      5. Step-by-step derivation
                                                        1. lower-/.f6457.9%

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

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                    6. Recombined 2 regimes into one program.
                                                    7. Add Preprocessing

                                                    Alternative 12: 69.7% accurate, 1.4× speedup?

                                                    \[\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l} \mathbf{if}\;\left|B\right| \leq 0.0115:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\left|B\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)} - \frac{x}{\tan \left(\left|B\right|\right)}\\ \end{array} \]
                                                    (FPCore (F B x)
                                                      :precision binary64
                                                      (*
                                                     (copysign 1.0 B)
                                                     (if (<= (fabs B) 0.0115)
                                                       (/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (fabs B))
                                                       (-
                                                        (/
                                                         -1.0
                                                         (* (fabs B) (+ 1.0 (* -0.16666666666666666 (pow (fabs B) 2.0)))))
                                                        (/ x (tan (fabs B)))))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (fabs(B) <= 0.0115) {
                                                    		tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / fabs(B);
                                                    	} else {
                                                    		tmp = (-1.0 / (fabs(B) * (1.0 + (-0.16666666666666666 * pow(fabs(B), 2.0))))) - (x / tan(fabs(B)));
                                                    	}
                                                    	return copysign(1.0, B) * tmp;
                                                    }
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (abs(B) <= 0.0115)
                                                    		tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / abs(B));
                                                    	else
                                                    		tmp = Float64(Float64(-1.0 / Float64(abs(B) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(B) ^ 2.0))))) - Float64(x / tan(abs(B))));
                                                    	end
                                                    	return Float64(copysign(1.0, B) * tmp)
                                                    end
                                                    
                                                    code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 0.0115], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[Abs[B], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                                    
                                                    \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
                                                    \mathbf{if}\;\left|B\right| \leq 0.0115:\\
                                                    \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\left|B\right|}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{-1}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)} - \frac{x}{\tan \left(\left|B\right|\right)}\\
                                                    
                                                    
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if B < 0.0115

                                                      1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                        13. lift-*.f6444.7%

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

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

                                                          \[\leadsto \frac{{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                        16. lower-fma.f6444.7%

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

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

                                                      if 0.0115 < B

                                                      1. Initial program 76.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6476.1%

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

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

                                                        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                      5. Step-by-step derivation
                                                        1. Applied rewrites56.6%

                                                          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                        2. Taylor expanded in B around 0

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

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

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

                                                            \[\leadsto \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{B}^{2}}\right)} - \frac{x}{\tan B} \]
                                                          4. lower-pow.f6455.6%

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

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

                                                      Alternative 13: 58.7% accurate, 1.5× speedup?

                                                      \[\begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{+23}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 45000:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\ \end{array} \]
                                                      (FPCore (F B x)
                                                        :precision binary64
                                                        (if (<= F -2.3e+23)
                                                        (- (/ -1.0 (sin B)) (/ x B))
                                                        (if (<= F 45000.0)
                                                          (+
                                                           (/ (- (* 0.3333333333333333 (* (pow B 2.0) x)) x) B)
                                                           (* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
                                                          (if (<= F 1.22e+168)
                                                            (/ 1.0 (sin B))
                                                            (/ (* (- 1.0 (/ x 1.0)) 1.0) B)))))
                                                      double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -2.3e+23) {
                                                      		tmp = (-1.0 / sin(B)) - (x / B);
                                                      	} else if (F <= 45000.0) {
                                                      		tmp = (((0.3333333333333333 * (pow(B, 2.0) * x)) - x) / B) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                                      	} else if (F <= 1.22e+168) {
                                                      		tmp = 1.0 / sin(B);
                                                      	} else {
                                                      		tmp = ((1.0 - (x / 1.0)) * 1.0) / 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 <= (-2.3d+23)) then
                                                              tmp = ((-1.0d0) / sin(b)) - (x / b)
                                                          else if (f <= 45000.0d0) then
                                                              tmp = (((0.3333333333333333d0 * ((b ** 2.0d0) * x)) - x) / b) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
                                                          else if (f <= 1.22d+168) then
                                                              tmp = 1.0d0 / sin(b)
                                                          else
                                                              tmp = ((1.0d0 - (x / 1.0d0)) * 1.0d0) / b
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -2.3e+23) {
                                                      		tmp = (-1.0 / Math.sin(B)) - (x / B);
                                                      	} else if (F <= 45000.0) {
                                                      		tmp = (((0.3333333333333333 * (Math.pow(B, 2.0) * x)) - x) / B) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                                      	} else if (F <= 1.22e+168) {
                                                      		tmp = 1.0 / Math.sin(B);
                                                      	} else {
                                                      		tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(F, B, x):
                                                      	tmp = 0
                                                      	if F <= -2.3e+23:
                                                      		tmp = (-1.0 / math.sin(B)) - (x / B)
                                                      	elif F <= 45000.0:
                                                      		tmp = (((0.3333333333333333 * (math.pow(B, 2.0) * x)) - x) / B) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
                                                      	elif F <= 1.22e+168:
                                                      		tmp = 1.0 / math.sin(B)
                                                      	else:
                                                      		tmp = ((1.0 - (x / 1.0)) * 1.0) / B
                                                      	return tmp
                                                      
                                                      function code(F, B, x)
                                                      	tmp = 0.0
                                                      	if (F <= -2.3e+23)
                                                      		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
                                                      	elseif (F <= 45000.0)
                                                      		tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64((B ^ 2.0) * x)) - x) / B) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
                                                      	elseif (F <= 1.22e+168)
                                                      		tmp = Float64(1.0 / sin(B));
                                                      	else
                                                      		tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(F, B, x)
                                                      	tmp = 0.0;
                                                      	if (F <= -2.3e+23)
                                                      		tmp = (-1.0 / sin(B)) - (x / B);
                                                      	elseif (F <= 45000.0)
                                                      		tmp = (((0.3333333333333333 * ((B ^ 2.0) * x)) - x) / B) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
                                                      	elseif (F <= 1.22e+168)
                                                      		tmp = 1.0 / sin(B);
                                                      	else
                                                      		tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[F_, B_, x_] := If[LessEqual[F, -2.3e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 45000.0], N[(N[(N[(N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(F / B), $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], If[LessEqual[F, 1.22e+168], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]
                                                      
                                                      \begin{array}{l}
                                                      \mathbf{if}\;F \leq -2.3 \cdot 10^{+23}:\\
                                                      \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
                                                      
                                                      \mathbf{elif}\;F \leq 45000:\\
                                                      \;\;\;\;\frac{0.3333333333333333 \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
                                                      
                                                      \mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\
                                                      \;\;\;\;\frac{1}{\sin B}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
                                                      
                                                      
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 4 regimes
                                                      2. if F < -2.3e23

                                                        1. Initial program 76.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. 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-neg.f64N/A

                                                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                          5. lower--.f6476.1%

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

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

                                                          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                        5. Step-by-step derivation
                                                          1. Applied rewrites56.6%

                                                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                          2. Taylor expanded in B around 0

                                                            \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                          3. Step-by-step derivation
                                                            1. lower-/.f6437.0%

                                                              \[\leadsto \frac{-1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                          4. Applied rewrites37.0%

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

                                                          if -2.3e23 < F < 45000

                                                          1. Initial program 76.1%

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            5. lower-pow.f6436.2%

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

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

                                                          if 45000 < F < 1.2199999999999999e168

                                                          1. Initial program 76.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. 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-neg.f64N/A

                                                              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                            5. lower--.f6476.1%

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

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

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

                                                            \[\leadsto \frac{\color{blue}{1}}{\sin B} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites16.7%

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

                                                            if 1.2199999999999999e168 < F

                                                            1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                                              4. Recombined 4 regimes into one program.
                                                              5. Add Preprocessing

                                                              Alternative 14: 58.7% accurate, 2.4× speedup?

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

                                                                1. Initial program 76.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. 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-neg.f64N/A

                                                                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                                  5. lower--.f6476.1%

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

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

                                                                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                                5. Step-by-step derivation
                                                                  1. Applied rewrites56.6%

                                                                    \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                                                  2. Taylor expanded in B around 0

                                                                    \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                                  3. Step-by-step derivation
                                                                    1. lower-/.f6437.0%

                                                                      \[\leadsto \frac{-1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                                  4. Applied rewrites37.0%

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

                                                                  if -2.3e23 < F < 3e10

                                                                  1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                    13. lift-*.f6444.7%

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

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

                                                                      \[\leadsto \frac{{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                    16. lower-fma.f6444.7%

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

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

                                                                  if 3e10 < F < 1.2199999999999999e168

                                                                  1. Initial program 76.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. 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-neg.f64N/A

                                                                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                                    5. lower--.f6476.1%

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

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

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

                                                                    \[\leadsto \frac{\color{blue}{1}}{\sin B} \]
                                                                  6. Step-by-step derivation
                                                                    1. Applied rewrites16.7%

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

                                                                    if 1.2199999999999999e168 < F

                                                                    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                                                      4. Recombined 4 regimes into one program.
                                                                      5. Add Preprocessing

                                                                      Alternative 15: 52.7% accurate, 2.3× speedup?

                                                                      \[\begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{+143}:\\ \;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 30000000000:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\ \end{array} \]
                                                                      (FPCore (F B x)
                                                                        :precision binary64
                                                                        (if (<= F -1.55e+143)
                                                                        (/ (* (- 1.0 (/ x -1.0)) -1.0) B)
                                                                        (if (<= F -4.5e+21)
                                                                          (/ -1.0 (sin B))
                                                                          (if (<= F 30000000000.0)
                                                                            (/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
                                                                            (if (<= F 1.22e+168)
                                                                              (/ 1.0 (sin B))
                                                                              (/ (* (- 1.0 (/ x 1.0)) 1.0) B))))))
                                                                      double code(double F, double B, double x) {
                                                                      	double tmp;
                                                                      	if (F <= -1.55e+143) {
                                                                      		tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
                                                                      	} else if (F <= -4.5e+21) {
                                                                      		tmp = -1.0 / sin(B);
                                                                      	} else if (F <= 30000000000.0) {
                                                                      		tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
                                                                      	} else if (F <= 1.22e+168) {
                                                                      		tmp = 1.0 / sin(B);
                                                                      	} else {
                                                                      		tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      function code(F, B, x)
                                                                      	tmp = 0.0
                                                                      	if (F <= -1.55e+143)
                                                                      		tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B);
                                                                      	elseif (F <= -4.5e+21)
                                                                      		tmp = Float64(-1.0 / sin(B));
                                                                      	elseif (F <= 30000000000.0)
                                                                      		tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B);
                                                                      	elseif (F <= 1.22e+168)
                                                                      		tmp = Float64(1.0 / sin(B));
                                                                      	else
                                                                      		tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B);
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      code[F_, B_, x_] := If[LessEqual[F, -1.55e+143], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.5e+21], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 30000000000.0], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e+168], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      \mathbf{if}\;F \leq -1.55 \cdot 10^{+143}:\\
                                                                      \;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
                                                                      
                                                                      \mathbf{elif}\;F \leq -4.5 \cdot 10^{+21}:\\
                                                                      \;\;\;\;\frac{-1}{\sin B}\\
                                                                      
                                                                      \mathbf{elif}\;F \leq 30000000000:\\
                                                                      \;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
                                                                      
                                                                      \mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\
                                                                      \;\;\;\;\frac{1}{\sin B}\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 5 regimes
                                                                      2. if F < -1.55e143

                                                                        1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                            if -1.55e143 < F < -4.5e21

                                                                            1. Initial program 76.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. 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-neg.f64N/A

                                                                                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                                              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                                              5. lower--.f6476.1%

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

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

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

                                                                              \[\leadsto \frac{\color{blue}{-1}}{\sin B} \]
                                                                            6. Step-by-step derivation
                                                                              1. Applied rewrites17.3%

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

                                                                              if -4.5e21 < F < 3e10

                                                                              1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                13. lift-*.f6444.7%

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

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

                                                                                  \[\leadsto \frac{{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                16. lower-fma.f6444.7%

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

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

                                                                              if 3e10 < F < 1.2199999999999999e168

                                                                              1. Initial program 76.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. 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-neg.f64N/A

                                                                                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                                                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                                                5. lower--.f6476.1%

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

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

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

                                                                                \[\leadsto \frac{\color{blue}{1}}{\sin B} \]
                                                                              6. Step-by-step derivation
                                                                                1. Applied rewrites16.7%

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

                                                                                if 1.2199999999999999e168 < F

                                                                                1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                                                                  4. Recombined 5 regimes into one program.
                                                                                  5. Add Preprocessing

                                                                                  Alternative 16: 52.5% accurate, 2.5× speedup?

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

                                                                                    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        if -1.55e143 < F < -4.5e21

                                                                                        1. Initial program 76.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. 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-neg.f64N/A

                                                                                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                                                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                                                          5. lower--.f6476.1%

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

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

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

                                                                                          \[\leadsto \frac{\color{blue}{-1}}{\sin B} \]
                                                                                        6. Step-by-step derivation
                                                                                          1. Applied rewrites17.3%

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

                                                                                          if -4.5e21 < F < 4.3e8

                                                                                          1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                            13. lift-*.f6444.7%

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

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

                                                                                              \[\leadsto \frac{{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                            16. lower-fma.f6444.7%

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

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

                                                                                          if 4.3e8 < F

                                                                                          1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                \[\leadsto \frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B} \]
                                                                                            4. Recombined 4 regimes into one program.
                                                                                            5. Add Preprocessing

                                                                                            Alternative 17: 52.3% accurate, 2.7× speedup?

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

                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  if -1e116 < F < 4.3e8

                                                                                                  1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                                    13. lift-*.f6444.7%

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

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

                                                                                                      \[\leadsto \frac{{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                                    16. lower-fma.f6444.7%

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

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

                                                                                                  if 4.3e8 < F

                                                                                                  1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                    Alternative 18: 51.9% accurate, 3.1× speedup?

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

                                                                                                      1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                          if -36 < F < 2.7e12

                                                                                                          1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                  \[\leadsto \frac{\left(1 - \frac{x}{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{\frac{-1}{2}} \cdot F}\right) \cdot \left({\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{\frac{-1}{2}} \cdot F\right)}{B} \]
                                                                                                                4. sub-to-mult-revN/A

                                                                                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                                                                                5. lower--.f6430.1%

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

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

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

                                                                                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F - x}{B} \]
                                                                                                              3. Applied rewrites30.1%

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

                                                                                                              if 2.7e12 < F

                                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                Alternative 19: 44.3% accurate, 5.6× speedup?

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

                                                                                                                  1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                      if -6.9999999999999997e-107 < F < 5.1999999999999996e-111

                                                                                                                      1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                      6. Step-by-step derivation
                                                                                                                        1. lower-*.f6430.2%

                                                                                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                      7. Applied rewrites30.2%

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

                                                                                                                      if 5.1999999999999996e-111 < F

                                                                                                                      1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                        Alternative 20: 37.4% accurate, 6.8× speedup?

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

                                                                                                                          1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                              if -6.9999999999999997e-107 < F

                                                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                              6. Step-by-step derivation
                                                                                                                                1. lower-*.f6430.2%

                                                                                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                              7. Applied rewrites30.2%

                                                                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                                            5. Add Preprocessing

                                                                                                                            Alternative 21: 30.8% accurate, 10.5× speedup?

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

                                                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                                \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                                                                                                              6. Step-by-step derivation
                                                                                                                                1. lower-/.f6410.7%

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

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

                                                                                                                              if -4.1e11 < F

                                                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                              6. Step-by-step derivation
                                                                                                                                1. lower-*.f6430.2%

                                                                                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                              7. Applied rewrites30.2%

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

                                                                                                                            Alternative 22: 17.8% accurate, 14.2× speedup?

                                                                                                                            \[\begin{array}{l} \mathbf{if}\;F \leq 1.2 \cdot 10^{-180}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
                                                                                                                            (FPCore (F B x)
                                                                                                                              :precision binary64
                                                                                                                              (if (<= F 1.2e-180) (/ -1.0 B) (/ 1.0 B)))
                                                                                                                            double code(double F, double B, double x) {
                                                                                                                            	double tmp;
                                                                                                                            	if (F <= 1.2e-180) {
                                                                                                                            		tmp = -1.0 / B;
                                                                                                                            	} else {
                                                                                                                            		tmp = 1.0 / B;
                                                                                                                            	}
                                                                                                                            	return tmp;
                                                                                                                            }
                                                                                                                            
                                                                                                                            module fmin_fmax_functions
                                                                                                                                implicit none
                                                                                                                                private
                                                                                                                                public fmax
                                                                                                                                public fmin
                                                                                                                            
                                                                                                                                interface fmax
                                                                                                                                    module procedure fmax88
                                                                                                                                    module procedure fmax44
                                                                                                                                    module procedure fmax84
                                                                                                                                    module procedure fmax48
                                                                                                                                end interface
                                                                                                                                interface fmin
                                                                                                                                    module procedure fmin88
                                                                                                                                    module procedure fmin44
                                                                                                                                    module procedure fmin84
                                                                                                                                    module procedure fmin48
                                                                                                                                end interface
                                                                                                                            contains
                                                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                    real(4), intent (in) :: y
                                                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                                                    real(4), intent (in) :: x
                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                end function
                                                                                                                            end module
                                                                                                                            
                                                                                                                            real(8) function code(f, b, x)
                                                                                                                            use fmin_fmax_functions
                                                                                                                                real(8), intent (in) :: f
                                                                                                                                real(8), intent (in) :: b
                                                                                                                                real(8), intent (in) :: x
                                                                                                                                real(8) :: tmp
                                                                                                                                if (f <= 1.2d-180) then
                                                                                                                                    tmp = (-1.0d0) / b
                                                                                                                                else
                                                                                                                                    tmp = 1.0d0 / b
                                                                                                                                end if
                                                                                                                                code = tmp
                                                                                                                            end function
                                                                                                                            
                                                                                                                            public static double code(double F, double B, double x) {
                                                                                                                            	double tmp;
                                                                                                                            	if (F <= 1.2e-180) {
                                                                                                                            		tmp = -1.0 / B;
                                                                                                                            	} else {
                                                                                                                            		tmp = 1.0 / B;
                                                                                                                            	}
                                                                                                                            	return tmp;
                                                                                                                            }
                                                                                                                            
                                                                                                                            def code(F, B, x):
                                                                                                                            	tmp = 0
                                                                                                                            	if F <= 1.2e-180:
                                                                                                                            		tmp = -1.0 / B
                                                                                                                            	else:
                                                                                                                            		tmp = 1.0 / B
                                                                                                                            	return tmp
                                                                                                                            
                                                                                                                            function code(F, B, x)
                                                                                                                            	tmp = 0.0
                                                                                                                            	if (F <= 1.2e-180)
                                                                                                                            		tmp = Float64(-1.0 / B);
                                                                                                                            	else
                                                                                                                            		tmp = Float64(1.0 / B);
                                                                                                                            	end
                                                                                                                            	return tmp
                                                                                                                            end
                                                                                                                            
                                                                                                                            function tmp_2 = code(F, B, x)
                                                                                                                            	tmp = 0.0;
                                                                                                                            	if (F <= 1.2e-180)
                                                                                                                            		tmp = -1.0 / B;
                                                                                                                            	else
                                                                                                                            		tmp = 1.0 / B;
                                                                                                                            	end
                                                                                                                            	tmp_2 = tmp;
                                                                                                                            end
                                                                                                                            
                                                                                                                            code[F_, B_, x_] := If[LessEqual[F, 1.2e-180], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
                                                                                                                            
                                                                                                                            \begin{array}{l}
                                                                                                                            \mathbf{if}\;F \leq 1.2 \cdot 10^{-180}:\\
                                                                                                                            \;\;\;\;\frac{-1}{B}\\
                                                                                                                            
                                                                                                                            \mathbf{else}:\\
                                                                                                                            \;\;\;\;\frac{1}{B}\\
                                                                                                                            
                                                                                                                            
                                                                                                                            \end{array}
                                                                                                                            
                                                                                                                            Derivation
                                                                                                                            1. Split input into 2 regimes
                                                                                                                            2. if F < 1.1999999999999999e-180

                                                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                                \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                                                                                                              6. Step-by-step derivation
                                                                                                                                1. lower-/.f6410.7%

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

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

                                                                                                                              if 1.1999999999999999e-180 < F

                                                                                                                              1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                                \[\leadsto \frac{1}{\color{blue}{B}} \]
                                                                                                                              6. Step-by-step derivation
                                                                                                                                1. lower-/.f649.9%

                                                                                                                                  \[\leadsto \frac{1}{B} \]
                                                                                                                              7. Applied rewrites9.9%

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

                                                                                                                            Alternative 23: 10.7% accurate, 25.4× speedup?

                                                                                                                            \[\frac{-1}{B} \]
                                                                                                                            (FPCore (F B x)
                                                                                                                              :precision binary64
                                                                                                                              (/ -1.0 B))
                                                                                                                            double code(double F, double B, double x) {
                                                                                                                            	return -1.0 / 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 = (-1.0d0) / b
                                                                                                                            end function
                                                                                                                            
                                                                                                                            public static double code(double F, double B, double x) {
                                                                                                                            	return -1.0 / B;
                                                                                                                            }
                                                                                                                            
                                                                                                                            def code(F, B, x):
                                                                                                                            	return -1.0 / B
                                                                                                                            
                                                                                                                            function code(F, B, x)
                                                                                                                            	return Float64(-1.0 / B)
                                                                                                                            end
                                                                                                                            
                                                                                                                            function tmp = code(F, B, x)
                                                                                                                            	tmp = -1.0 / B;
                                                                                                                            end
                                                                                                                            
                                                                                                                            code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                                                                                                            
                                                                                                                            \frac{-1}{B}
                                                                                                                            
                                                                                                                            Derivation
                                                                                                                            1. Initial program 76.1%

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

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

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

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

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

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

                                                                                                                              \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                                                                                                            6. Step-by-step derivation
                                                                                                                              1. lower-/.f6410.7%

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

                                                                                                                              \[\leadsto \frac{-1}{\color{blue}{B}} \]
                                                                                                                            8. Add Preprocessing

                                                                                                                            Reproduce

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