VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.8% → 99.6%
Time: 8.3s
Alternatives: 29
Speedup: 1.3×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 29 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.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;F \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\

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


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

    1. Initial program 55.6%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6499.7

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000024e25 < F < 2e15

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

    if 2e15 < F

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
    6. Applied rewrites99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6499.8

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites99.8%

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

Alternative 2: 99.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -5.5 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, \frac{-1}{\sin B}\right)\\

\mathbf{elif}\;F \leq 2.85 \cdot 10^{-6}:\\
\;\;\;\;\left(-x \cdot t\_0\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\

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


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

    1. Initial program 55.6%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6499.7

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000018e25 < F < 2.8499999999999998e-6

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      8. metadata-eval99.4

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

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

    if 2.8499999999999998e-6 < F

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6498.3

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
    6. Applied rewrites98.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6498.3

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites98.3%

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

Alternative 3: 99.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -5.5 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, \frac{-1}{\sin B}\right)\\

\mathbf{elif}\;F \leq 2.85 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B}\right)\\

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


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

    1. Initial program 55.6%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6499.7

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000018e25 < F < 2.8499999999999998e-6

    1. Initial program 99.4%

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

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

    if 2.8499999999999998e-6 < F

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6498.3

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
    6. Applied rewrites98.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6498.3

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites98.3%

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

Alternative 4: 99.0% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\color{blue}{\tan B}}, \frac{-1}{\sin B}\right) \]
      10. lift-/.f6499.3

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

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

    if -1.44999999999999996 < F < 2.8499999999999998e-6

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if 2.8499999999999998e-6 < F

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6498.3

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
    6. Applied rewrites98.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6498.3

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites98.3%

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

Alternative 5: 91.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ t_1 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -0.000216:\\ \;\;\;\;t\_1 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-130}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-140}:\\ \;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0
         (+
          (- (/ x B))
          (*
           (/ F (sin B))
           (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
        (t_1 (/ (- x) (tan B))))
   (if (<= F -0.000216)
     (+ t_1 (/ -1.0 (sin B)))
     (if (<= F -4.5e-130)
       t_0
       (if (<= F 4.2e-140)
         (- (* (cos B) (/ x (sin B))))
         (if (<= F 6.6e-7) t_0 (+ t_1 (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
	double t_0 = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	double t_1 = -x / tan(B);
	double tmp;
	if (F <= -0.000216) {
		tmp = t_1 + (-1.0 / sin(B));
	} else if (F <= -4.5e-130) {
		tmp = t_0;
	} else if (F <= 4.2e-140) {
		tmp = -(cos(B) * (x / sin(B)));
	} else if (F <= 6.6e-7) {
		tmp = t_0;
	} else {
		tmp = t_1 + (1.0 / sin(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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -(x / b) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    t_1 = -x / tan(b)
    if (f <= (-0.000216d0)) then
        tmp = t_1 + ((-1.0d0) / sin(b))
    else if (f <= (-4.5d-130)) then
        tmp = t_0
    else if (f <= 4.2d-140) then
        tmp = -(cos(b) * (x / sin(b)))
    else if (f <= 6.6d-7) then
        tmp = t_0
    else
        tmp = t_1 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -(x / B) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	double t_1 = -x / Math.tan(B);
	double tmp;
	if (F <= -0.000216) {
		tmp = t_1 + (-1.0 / Math.sin(B));
	} else if (F <= -4.5e-130) {
		tmp = t_0;
	} else if (F <= 4.2e-140) {
		tmp = -(Math.cos(B) * (x / Math.sin(B)));
	} else if (F <= 6.6e-7) {
		tmp = t_0;
	} else {
		tmp = t_1 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -(x / B) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	t_1 = -x / math.tan(B)
	tmp = 0
	if F <= -0.000216:
		tmp = t_1 + (-1.0 / math.sin(B))
	elif F <= -4.5e-130:
		tmp = t_0
	elif F <= 4.2e-140:
		tmp = -(math.cos(B) * (x / math.sin(B)))
	elif F <= 6.6e-7:
		tmp = t_0
	else:
		tmp = t_1 + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
	t_1 = Float64(Float64(-x) / tan(B))
	tmp = 0.0
	if (F <= -0.000216)
		tmp = Float64(t_1 + Float64(-1.0 / sin(B)));
	elseif (F <= -4.5e-130)
		tmp = t_0;
	elseif (F <= 4.2e-140)
		tmp = Float64(-Float64(cos(B) * Float64(x / sin(B))));
	elseif (F <= 6.6e-7)
		tmp = t_0;
	else
		tmp = Float64(t_1 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -(x / B) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	t_1 = -x / tan(B);
	tmp = 0.0;
	if (F <= -0.000216)
		tmp = t_1 + (-1.0 / sin(B));
	elseif (F <= -4.5e-130)
		tmp = t_0;
	elseif (F <= 4.2e-140)
		tmp = -(cos(B) * (x / sin(B)));
	elseif (F <= 6.6e-7)
		tmp = t_0;
	else
		tmp = t_1 + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $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]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.000216], N[(t$95$1 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.5e-130], t$95$0, If[LessEqual[F, 4.2e-140], (-N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 6.6e-7], t$95$0, N[(t$95$1 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.000216:\\
\;\;\;\;t\_1 + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-140}:\\
\;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\

\mathbf{elif}\;F \leq 6.6 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.1599999999999999e-4

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites98.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
      10. lift-tan.f6498.9

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
    6. Applied rewrites98.9%

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

    if -2.1599999999999999e-4 < F < -4.5e-130 or 4.20000000000000035e-140 < F < 6.6000000000000003e-7

    1. Initial program 99.4%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin 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-/.f6476.6

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

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

    if -4.5e-130 < F < 4.20000000000000035e-140

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*82.2

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

        \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      6. associate-/l*N/A

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

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

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

        \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
      10. lift-sin.f6482.2

        \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
    6. Applied rewrites82.2%

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

    if 6.6000000000000003e-7 < F

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6435.9

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6435.9

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites35.9%

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

Alternative 6: 91.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, \frac{-1}{\sin B}\right)\\

\mathbf{elif}\;F \leq 1.15 \cdot 10^{-38}:\\
\;\;\;\;\left(-x \cdot t\_0\right) + \frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B}\\

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


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

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\color{blue}{\tan B}}, \frac{-1}{\sin B}\right) \]
      10. lift-/.f6499.3

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

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

    if -1.3999999999999999 < F < 1.15000000000000001e-38

    1. Initial program 99.5%

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

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

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

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

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

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

    if 1.15000000000000001e-38 < F

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6494.0

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6494.0

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites94.0%

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

Alternative 7: 90.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.000216:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\


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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites98.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
      10. lift-tan.f6498.9

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
    6. Applied rewrites98.9%

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

    if -2.1599999999999999e-4 < F < 1.15000000000000001e-38

    1. Initial program 99.5%

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

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

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

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

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

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

    if 1.15000000000000001e-38 < F

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6494.0

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{1}{\sin B} \]
      9. lift-tan.f6494.0

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{1}{\sin B} \]
    8. Applied rewrites94.0%

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

Alternative 8: 83.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{if}\;F \leq -0.000216:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-130}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-140}:\\ \;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+139}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\left(1 + \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right) \cdot \left(B \cdot B\right)\right) \cdot B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0
         (+
          (- (/ x B))
          (*
           (/ F (sin B))
           (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))))
   (if (<= F -0.000216)
     (+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
     (if (<= F -4.5e-130)
       t_0
       (if (<= F 4.2e-140)
         (- (* (cos B) (/ x (sin B))))
         (if (<= F 4.3e+139)
           t_0
           (+
            (- (/ (* x 1.0) (tan B)))
            (/
             1.0
             (*
              (+
               1.0
               (*
                (- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
                (* B B)))
              B)))))))))
double code(double F, double B, double x) {
	double t_0 = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	double tmp;
	if (F <= -0.000216) {
		tmp = (-x / tan(B)) + (-1.0 / sin(B));
	} else if (F <= -4.5e-130) {
		tmp = t_0;
	} else if (F <= 4.2e-140) {
		tmp = -(cos(B) * (x / sin(B)));
	} else if (F <= 4.3e+139) {
		tmp = t_0;
	} else {
		tmp = -((x * 1.0) / tan(B)) + (1.0 / ((1.0 + (((0.008333333333333333 * (B * B)) - 0.16666666666666666) * (B * B))) * 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) :: t_0
    real(8) :: tmp
    t_0 = -(x / b) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    if (f <= (-0.000216d0)) then
        tmp = (-x / tan(b)) + ((-1.0d0) / sin(b))
    else if (f <= (-4.5d-130)) then
        tmp = t_0
    else if (f <= 4.2d-140) then
        tmp = -(cos(b) * (x / sin(b)))
    else if (f <= 4.3d+139) then
        tmp = t_0
    else
        tmp = -((x * 1.0d0) / tan(b)) + (1.0d0 / ((1.0d0 + (((0.008333333333333333d0 * (b * b)) - 0.16666666666666666d0) * (b * b))) * b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -(x / B) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	double tmp;
	if (F <= -0.000216) {
		tmp = (-x / Math.tan(B)) + (-1.0 / Math.sin(B));
	} else if (F <= -4.5e-130) {
		tmp = t_0;
	} else if (F <= 4.2e-140) {
		tmp = -(Math.cos(B) * (x / Math.sin(B)));
	} else if (F <= 4.3e+139) {
		tmp = t_0;
	} else {
		tmp = -((x * 1.0) / Math.tan(B)) + (1.0 / ((1.0 + (((0.008333333333333333 * (B * B)) - 0.16666666666666666) * (B * B))) * B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -(x / B) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	tmp = 0
	if F <= -0.000216:
		tmp = (-x / math.tan(B)) + (-1.0 / math.sin(B))
	elif F <= -4.5e-130:
		tmp = t_0
	elif F <= 4.2e-140:
		tmp = -(math.cos(B) * (x / math.sin(B)))
	elif F <= 4.3e+139:
		tmp = t_0
	else:
		tmp = -((x * 1.0) / math.tan(B)) + (1.0 / ((1.0 + (((0.008333333333333333 * (B * B)) - 0.16666666666666666) * (B * B))) * B))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
	tmp = 0.0
	if (F <= -0.000216)
		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B)));
	elseif (F <= -4.5e-130)
		tmp = t_0;
	elseif (F <= 4.2e-140)
		tmp = Float64(-Float64(cos(B) * Float64(x / sin(B))));
	elseif (F <= 4.3e+139)
		tmp = t_0;
	else
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / Float64(Float64(1.0 + Float64(Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666) * Float64(B * B))) * B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -(x / B) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	tmp = 0.0;
	if (F <= -0.000216)
		tmp = (-x / tan(B)) + (-1.0 / sin(B));
	elseif (F <= -4.5e-130)
		tmp = t_0;
	elseif (F <= 4.2e-140)
		tmp = -(cos(B) * (x / sin(B)));
	elseif (F <= 4.3e+139)
		tmp = t_0;
	else
		tmp = -((x * 1.0) / tan(B)) + (1.0 / ((1.0 + (((0.008333333333333333 * (B * B)) - 0.16666666666666666) * (B * B))) * B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $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]}, If[LessEqual[F, -0.000216], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.5e-130], t$95$0, If[LessEqual[F, 4.2e-140], (-N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.3e+139], t$95$0, N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[(N[(1.0 + N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{if}\;F \leq -0.000216:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-140}:\\
\;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\

\mathbf{elif}\;F \leq 4.3 \cdot 10^{+139}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\left(1 + \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right) \cdot \left(B \cdot B\right)\right) \cdot B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.1599999999999999e-4

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites98.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
      10. lift-tan.f6498.9

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
    6. Applied rewrites98.9%

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

    if -2.1599999999999999e-4 < F < -4.5e-130 or 4.20000000000000035e-140 < F < 4.2999999999999998e139

    1. Initial program 95.9%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin 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-/.f6474.1

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

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

    if -4.5e-130 < F < 4.20000000000000035e-140

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
    5. Step-by-step derivation
      1. associate-/l*82.2

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

        \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      6. associate-/l*N/A

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

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

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

        \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
      10. lift-sin.f6482.2

        \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
    6. Applied rewrites82.2%

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

    if 4.2999999999999998e139 < F

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
    6. Applied rewrites58.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\left(1 + \left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}\right) \cdot \left(B \cdot B\right)\right) \cdot B} \]
      11. lower-*.f6452.0

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\left(1 + \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right) \cdot \left(B \cdot B\right)\right) \cdot B} \]
    9. Applied rewrites52.0%

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

Alternative 9: 75.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{-8}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{elif}\;x \leq 5.7 \cdot 10^{-18}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= x -6.8e-8)
   (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))
   (if (<= x 5.7e-18)
     (+
      (- (/ x B))
      (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
     (- (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (x <= -6.8e-8) {
		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
	} else if (x <= 5.7e-18) {
		tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = -(cos(B) * (x / sin(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 (x <= (-6.8d-8)) then
        tmp = -(x * (1.0d0 / tan(b))) + ((-1.0d0) / b)
    else if (x <= 5.7d-18) then
        tmp = -(x / b) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = -(cos(b) * (x / sin(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (x <= -6.8e-8) {
		tmp = -(x * (1.0 / Math.tan(B))) + (-1.0 / B);
	} else if (x <= 5.7e-18) {
		tmp = -(x / B) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = -(Math.cos(B) * (x / Math.sin(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if x <= -6.8e-8:
		tmp = -(x * (1.0 / math.tan(B))) + (-1.0 / B)
	elif x <= 5.7e-18:
		tmp = -(x / B) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	else:
		tmp = -(math.cos(B) * (x / math.sin(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (x <= -6.8e-8)
		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
	elseif (x <= 5.7e-18)
		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
	else
		tmp = Float64(-Float64(cos(B) * Float64(x / sin(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (x <= -6.8e-8)
		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
	elseif (x <= 5.7e-18)
		tmp = -(x / B) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = -(cos(B) * (x / sin(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[x, -6.8e-8], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.7e-18], N[((-N[(x / B), $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], (-N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\

\mathbf{elif}\;x \leq 5.7 \cdot 10^{-18}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.8e-8

    1. Initial program 70.8%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6494.6

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites94.6%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
    6. Step-by-step derivation
      1. Applied rewrites94.4%

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

      if -6.8e-8 < x < 5.69999999999999971e-18

      1. Initial program 72.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(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin 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-/.f6460.6

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

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

      if 5.69999999999999971e-18 < x

      1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
      5. Step-by-step derivation
        1. associate-/l*96.1

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

          \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
        3. lift-*.f64N/A

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

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

          \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
        6. associate-/l*N/A

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

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

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

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

          \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
      6. Applied rewrites96.1%

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

    Alternative 10: 75.8% accurate, 1.5× speedup?

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

      1. Initial program 70.8%

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
        2. lift-sin.f6494.6

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
      4. Applied rewrites94.6%

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
      6. Step-by-step derivation
        1. Applied rewrites94.4%

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

        if -6.8e-8 < x < 5.69999999999999971e-18

        1. Initial program 72.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 x around 0

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
          8. metadata-eval72.1

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

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

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

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

          if 5.69999999999999971e-18 < x

          1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
          5. Step-by-step derivation
            1. associate-/l*96.1

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

              \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
            3. lift-*.f64N/A

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

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

              \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
            6. associate-/l*N/A

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

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

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

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

              \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
          6. Applied rewrites96.1%

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

        Alternative 11: 75.8% accurate, 1.5× speedup?

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

          1. Initial program 70.8%

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
            2. lift-sin.f6494.6

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
          4. Applied rewrites94.6%

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
          6. Step-by-step derivation
            1. Applied rewrites94.4%

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

            if -6.8e-8 < x < 5.69999999999999971e-18

            1. Initial program 72.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 x around 0

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
              8. metadata-eval72.1

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

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

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

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

              if 5.69999999999999971e-18 < x

              1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

            Alternative 12: 75.6% accurate, 1.5× speedup?

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

              1. Initial program 70.8%

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                2. lift-sin.f6494.6

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
              4. Applied rewrites94.6%

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
              6. Step-by-step derivation
                1. Applied rewrites94.4%

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

                if -6.8e-8 < x < 0.014999999999999999

                1. Initial program 72.0%

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
                  8. metadata-eval71.9

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \]
                6. Step-by-step derivation
                  1. Applied rewrites60.0%

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

                  if 0.014999999999999999 < x

                  1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                    2. lift-sin.f6497.7

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

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

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

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

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

                Alternative 13: 69.6% accurate, 1.5× speedup?

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

                  1. Initial program 71.4%

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                  4. Applied rewrites63.8%

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

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

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

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

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

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

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

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

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

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

                  if -3.1e-109 < x < 7.50000000000000044e-119

                  1. Initial program 72.3%

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{{\left({F}^{2} + 2\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot F}{\sin B} \]
                    8. pow2N/A

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

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

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

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

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

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

                  if 7.50000000000000044e-119 < x

                  1. Initial program 83.6%

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                  4. Applied rewrites77.4%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, B \cdot B, 1\right) \cdot B} \]
                    11. lower-*.f6479.7

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

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

                Alternative 14: 69.5% accurate, 1.7× speedup?

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

                  1. Initial program 79.4%

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                    2. lift-sin.f6472.7

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

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

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

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

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

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

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

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

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

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

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

                  if -3.1e-109 < x < 7.50000000000000044e-119

                  1. Initial program 72.3%

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{{\left({F}^{2} + 2\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot F}{\sin B} \]
                    8. pow2N/A

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

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

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

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

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

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

                Alternative 15: 69.5% accurate, 1.7× speedup?

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

                  1. Initial program 79.8%

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                  4. Applied rewrites75.1%

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                  6. Step-by-step derivation
                    1. Applied rewrites76.9%

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

                    if -1.85e-73 < x < 8.20000000000000041e-119

                    1. Initial program 72.3%

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{{\left({F}^{2} + 2\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot F}{\sin B} \]
                      8. pow2N/A

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

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

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

                        \[\leadsto \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B} \]
                      12. lift-sin.f6458.7

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

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

                  Alternative 16: 63.3% accurate, 1.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{B}\\ t_1 := \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{B}\\ \mathbf{if}\;F \leq -2.55 \cdot 10^{+119}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -0.000216:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-107}:\\ \;\;\;\;t\_0 + \frac{F}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+139}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{F}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (let* ((t_0 (- (* x (/ 1.0 B))))
                          (t_1 (+ (- (/ (* x 1.0) (tan B))) (/ 1.0 B))))
                     (if (<= F -2.55e+119)
                       (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))
                       (if (<= F -0.000216)
                         (+ t_0 (/ -1.0 (sin B)))
                         (if (<= F 7.5e-107)
                           (+
                            t_0
                            (*
                             (/
                              F
                              (*
                               B
                               (+
                                1.0
                                (*
                                 (* B B)
                                 (- (* 0.008333333333333333 (* B B)) 0.16666666666666666)))))
                             (pow (fma F F 2.0) -0.5)))
                           (if (<= F 1.15e+36)
                             t_1
                             (if (<= F 4.3e+139) (+ t_0 (* (/ F (sin B)) (/ 1.0 F))) t_1)))))))
                  double code(double F, double B, double x) {
                  	double t_0 = -(x * (1.0 / B));
                  	double t_1 = -((x * 1.0) / tan(B)) + (1.0 / B);
                  	double tmp;
                  	if (F <= -2.55e+119) {
                  		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
                  	} else if (F <= -0.000216) {
                  		tmp = t_0 + (-1.0 / sin(B));
                  	} else if (F <= 7.5e-107) {
                  		tmp = t_0 + ((F / (B * (1.0 + ((B * B) * ((0.008333333333333333 * (B * B)) - 0.16666666666666666))))) * pow(fma(F, F, 2.0), -0.5));
                  	} else if (F <= 1.15e+36) {
                  		tmp = t_1;
                  	} else if (F <= 4.3e+139) {
                  		tmp = t_0 + ((F / sin(B)) * (1.0 / F));
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	t_0 = Float64(-Float64(x * Float64(1.0 / B)))
                  	t_1 = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / B))
                  	tmp = 0.0
                  	if (F <= -2.55e+119)
                  		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
                  	elseif (F <= -0.000216)
                  		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
                  	elseif (F <= 7.5e-107)
                  		tmp = Float64(t_0 + Float64(Float64(F / Float64(B * Float64(1.0 + Float64(Float64(B * B) * Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666))))) * (fma(F, F, 2.0) ^ -0.5)));
                  	elseif (F <= 1.15e+36)
                  		tmp = t_1;
                  	elseif (F <= 4.3e+139)
                  		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(1.0 / F)));
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.55e+119], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -0.000216], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-107], N[(t$95$0 + N[(N[(F / N[(B * N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e+36], t$95$1, If[LessEqual[F, 4.3e+139], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := -x \cdot \frac{1}{B}\\
                  t_1 := \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{B}\\
                  \mathbf{if}\;F \leq -2.55 \cdot 10^{+119}:\\
                  \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
                  
                  \mathbf{elif}\;F \leq -0.000216:\\
                  \;\;\;\;t\_0 + \frac{-1}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 7.5 \cdot 10^{-107}:\\
                  \;\;\;\;t\_0 + \frac{F}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
                  
                  \mathbf{elif}\;F \leq 1.15 \cdot 10^{+36}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;F \leq 4.3 \cdot 10^{+139}:\\
                  \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{F}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 5 regimes
                  2. if F < -2.54999999999999992e119

                    1. Initial program 39.4%

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                      2. lift-sin.f6499.7

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

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

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

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

                      if -2.54999999999999992e119 < F < -2.1599999999999999e-4

                      1. Initial program 93.3%

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                        2. lift-sin.f6497.3

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                      4. Applied rewrites97.3%

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

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

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

                        if -2.1599999999999999e-4 < F < 7.50000000000000047e-107

                        1. Initial program 99.5%

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
                          8. metadata-eval99.4

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \]
                            9. lift-*.f6452.0

                              \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \]
                          4. Applied rewrites52.0%

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

                          if 7.50000000000000047e-107 < F < 1.14999999999999998e36 or 4.2999999999999998e139 < F

                          1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                            2. lift-sin.f6481.3

                              \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
                          6. Applied rewrites81.3%

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

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

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

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

                          if 1.14999999999999998e36 < F < 4.2999999999999998e139

                          1. Initial program 87.0%

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
                            8. metadata-eval87.0

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

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

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                              3. sqr-powN/A

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                              8. pow-prod-upN/A

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                              13. pow-prod-upN/A

                                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                              14. unpow2N/A

                                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                              15. lower-/.f6467.3

                                \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                            4. Applied rewrites67.3%

                              \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\color{blue}{F}} \]
                          7. Recombined 5 regimes into one program.
                          8. Add Preprocessing

                          Alternative 17: 63.3% accurate, 1.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{B}\\ t_1 := \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{B}\\ \mathbf{if}\;F \leq -2.55 \cdot 10^{+119}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -0.000216:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-107}:\\ \;\;\;\;t\_0 + \frac{F}{B \cdot \left(1 - 0.16666666666666666 \cdot \left(B \cdot B\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{+36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+139}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{F}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (let* ((t_0 (- (* x (/ 1.0 B))))
                                  (t_1 (+ (- (/ (* x 1.0) (tan B))) (/ 1.0 B))))
                             (if (<= F -2.55e+119)
                               (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))
                               (if (<= F -0.000216)
                                 (+ t_0 (/ -1.0 (sin B)))
                                 (if (<= F 7.5e-107)
                                   (+
                                    t_0
                                    (*
                                     (/ F (* B (- 1.0 (* 0.16666666666666666 (* B B)))))
                                     (pow (fma F F 2.0) -0.5)))
                                   (if (<= F 1.15e+36)
                                     t_1
                                     (if (<= F 4.3e+139) (+ t_0 (* (/ F (sin B)) (/ 1.0 F))) t_1)))))))
                          double code(double F, double B, double x) {
                          	double t_0 = -(x * (1.0 / B));
                          	double t_1 = -((x * 1.0) / tan(B)) + (1.0 / B);
                          	double tmp;
                          	if (F <= -2.55e+119) {
                          		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
                          	} else if (F <= -0.000216) {
                          		tmp = t_0 + (-1.0 / sin(B));
                          	} else if (F <= 7.5e-107) {
                          		tmp = t_0 + ((F / (B * (1.0 - (0.16666666666666666 * (B * B))))) * pow(fma(F, F, 2.0), -0.5));
                          	} else if (F <= 1.15e+36) {
                          		tmp = t_1;
                          	} else if (F <= 4.3e+139) {
                          		tmp = t_0 + ((F / sin(B)) * (1.0 / F));
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          function code(F, B, x)
                          	t_0 = Float64(-Float64(x * Float64(1.0 / B)))
                          	t_1 = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / B))
                          	tmp = 0.0
                          	if (F <= -2.55e+119)
                          		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
                          	elseif (F <= -0.000216)
                          		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
                          	elseif (F <= 7.5e-107)
                          		tmp = Float64(t_0 + Float64(Float64(F / Float64(B * Float64(1.0 - Float64(0.16666666666666666 * Float64(B * B))))) * (fma(F, F, 2.0) ^ -0.5)));
                          	elseif (F <= 1.15e+36)
                          		tmp = t_1;
                          	elseif (F <= 4.3e+139)
                          		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(1.0 / F)));
                          	else
                          		tmp = t_1;
                          	end
                          	return tmp
                          end
                          
                          code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.55e+119], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -0.000216], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-107], N[(t$95$0 + N[(N[(F / N[(B * N[(1.0 - N[(0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e+36], t$95$1, If[LessEqual[F, 4.3e+139], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := -x \cdot \frac{1}{B}\\
                          t_1 := \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{B}\\
                          \mathbf{if}\;F \leq -2.55 \cdot 10^{+119}:\\
                          \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
                          
                          \mathbf{elif}\;F \leq -0.000216:\\
                          \;\;\;\;t\_0 + \frac{-1}{\sin B}\\
                          
                          \mathbf{elif}\;F \leq 7.5 \cdot 10^{-107}:\\
                          \;\;\;\;t\_0 + \frac{F}{B \cdot \left(1 - 0.16666666666666666 \cdot \left(B \cdot B\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
                          
                          \mathbf{elif}\;F \leq 1.15 \cdot 10^{+36}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;F \leq 4.3 \cdot 10^{+139}:\\
                          \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{F}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 5 regimes
                          2. if F < -2.54999999999999992e119

                            1. Initial program 39.4%

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                              2. lift-sin.f6499.7

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

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

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

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

                              if -2.54999999999999992e119 < F < -2.1599999999999999e-4

                              1. Initial program 93.3%

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                2. lift-sin.f6497.3

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                              4. Applied rewrites97.3%

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

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

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

                                if -2.1599999999999999e-4 < F < 7.50000000000000047e-107

                                1. Initial program 99.5%

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
                                  8. metadata-eval99.4

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{B \cdot \left(1 - \frac{1}{6} \cdot \left(B \cdot \color{blue}{B}\right)\right)} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \]
                                    7. lift-*.f6452.0

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

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

                                  if 7.50000000000000047e-107 < F < 1.14999999999999998e36 or 4.2999999999999998e139 < F

                                  1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                    2. lift-sin.f6481.3

                                      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
                                  6. Applied rewrites81.3%

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

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

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

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

                                  if 1.14999999999999998e36 < F < 4.2999999999999998e139

                                  1. Initial program 87.0%

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
                                    8. metadata-eval87.0

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

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

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

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

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

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

                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                      3. sqr-powN/A

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

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

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

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

                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                      8. pow-prod-upN/A

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

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

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

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

                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                      13. pow-prod-upN/A

                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                      14. unpow2N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                      15. lower-/.f6467.3

                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                    4. Applied rewrites67.3%

                                      \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\color{blue}{F}} \]
                                  7. Recombined 5 regimes into one program.
                                  8. Add Preprocessing

                                  Alternative 18: 58.7% accurate, 2.2× speedup?

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

                                    1. Initial program 74.0%

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

                                      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites57.7%

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

                                    if 2e-3 < B

                                    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
                                      2. lift-sin.f6457.3

                                        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
                                    6. Applied rewrites57.3%

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

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

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

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

                                  Alternative 19: 56.3% accurate, 2.2× speedup?

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

                                    1. Initial program 74.0%

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

                                      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites57.7%

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

                                    if 0.00239999999999999979 < B

                                    1. Initial program 85.0%

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

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

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                      2. lift-sin.f6456.9

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

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

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

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

                                    Alternative 20: 56.2% accurate, 2.3× speedup?

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

                                      1. Initial program 58.8%

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

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

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

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

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

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

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

                                        if -1.3999999999999999 < F < 7.69999999999999964e40

                                        1. Initial program 99.3%

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

                                          \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites51.5%

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

                                        if 7.69999999999999964e40 < F < 5.6000000000000002e159

                                        1. Initial program 84.0%

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

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

                                            \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                          2. lift-sin.f6454.8

                                            \[\leadsto \frac{1}{\sin B} \]
                                        4. Applied rewrites54.8%

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

                                        if 5.6000000000000002e159 < F

                                        1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 21: 52.7% accurate, 2.3× speedup?

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

                                          1. Initial program 39.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 \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. lift-/.f64N/A

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

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

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

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

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

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

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

                                            \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                          5. 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}} \]
                                          6. Applied rewrites30.8%

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

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

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

                                            if -3.9999999999999999e120 < F < -2.1e5

                                            1. Initial program 92.8%

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

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

                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                              2. lift-sin.f6459.7

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

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

                                            if -2.1e5 < F < 1.3e12

                                            1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                            5. 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}} \]
                                            6. Applied rewrites51.8%

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

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

                                                \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                              2. lift-+.f6451.1

                                                \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B} \]
                                            9. Applied rewrites51.1%

                                              \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B} \]

                                            if 1.3e12 < F < 5.6000000000000002e159

                                            1. Initial program 86.4%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Taylor expanded in F around inf

                                              \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                              2. lift-sin.f6456.1

                                                \[\leadsto \frac{1}{\sin B} \]
                                            4. Applied rewrites56.1%

                                              \[\leadsto \color{blue}{\frac{1}{\sin B}} \]

                                            if 5.6000000000000002e159 < F

                                            1. Initial program 32.2%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Step-by-step derivation
                                              1. lift-*.f64N/A

                                                \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. lift-/.f64N/A

                                                \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              3. lift-tan.f64N/A

                                                \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              4. associate-*r/N/A

                                                \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              5. lower-/.f64N/A

                                                \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              6. lower-*.f64N/A

                                                \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              7. lift-tan.f6432.2

                                                \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            3. Applied rewrites32.2%

                                              \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            4. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                            5. 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}} \]
                                            6. Applied rewrites25.1%

                                              \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                            7. Taylor expanded in F around inf

                                              \[\leadsto \frac{1 - x}{B} \]
                                            8. Step-by-step derivation
                                              1. Applied rewrites51.1%

                                                \[\leadsto \frac{1 - x}{B} \]
                                            9. Recombined 5 regimes into one program.
                                            10. Add Preprocessing

                                            Alternative 22: 51.4% accurate, 2.4× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\sin B}\\ \mathbf{if}\;B \leq 0.92:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\ \mathbf{elif}\;B \leq 6.1 \cdot 10^{+29}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;B \leq 5 \cdot 10^{+105}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (let* ((t_0 (/ 1.0 (sin B))))
                                               (if (<= B 0.92)
                                                 (/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B)
                                                 (if (<= B 6.1e+29) t_0 (if (<= B 5e+105) (/ -1.0 (sin B)) t_0)))))
                                            double code(double F, double B, double x) {
                                            	double t_0 = 1.0 / sin(B);
                                            	double tmp;
                                            	if (B <= 0.92) {
                                            		tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
                                            	} else if (B <= 6.1e+29) {
                                            		tmp = t_0;
                                            	} else if (B <= 5e+105) {
                                            		tmp = -1.0 / sin(B);
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	t_0 = Float64(1.0 / sin(B))
                                            	tmp = 0.0
                                            	if (B <= 0.92)
                                            		tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B);
                                            	elseif (B <= 6.1e+29)
                                            		tmp = t_0;
                                            	elseif (B <= 5e+105)
                                            		tmp = Float64(-1.0 / sin(B));
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.92], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 6.1e+29], t$95$0, If[LessEqual[B, 5e+105], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{1}{\sin B}\\
                                            \mathbf{if}\;B \leq 0.92:\\
                                            \;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
                                            
                                            \mathbf{elif}\;B \leq 6.1 \cdot 10^{+29}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;B \leq 5 \cdot 10^{+105}:\\
                                            \;\;\;\;\frac{-1}{\sin B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if B < 0.92000000000000004

                                              1. Initial program 74.0%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites57.6%

                                                \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]

                                              if 0.92000000000000004 < B < 6.0999999999999998e29 or 5.00000000000000046e105 < B

                                              1. Initial program 84.8%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Taylor expanded in F around inf

                                                \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                2. lift-sin.f6417.8

                                                  \[\leadsto \frac{1}{\sin B} \]
                                              4. Applied rewrites17.8%

                                                \[\leadsto \color{blue}{\frac{1}{\sin B}} \]

                                              if 6.0999999999999998e29 < B < 5.00000000000000046e105

                                              1. Initial program 85.9%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Taylor expanded in F around -inf

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                2. lift-sin.f6417.2

                                                  \[\leadsto \frac{-1}{\sin B} \]
                                              4. Applied rewrites17.2%

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                            3. Recombined 3 regimes into one program.
                                            4. Add Preprocessing

                                            Alternative 23: 50.5% accurate, 2.6× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+120}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -210000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-38}:\\ \;\;\;\;\frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -4e+120)
                                               (/ (- -1.0 x) B)
                                               (if (<= F -210000.0)
                                                 (/ -1.0 (sin B))
                                                 (if (<= F 1.15e-38)
                                                   (/ (- (* (pow (+ (+ x x) 2.0) -0.5) F) x) B)
                                                   (/ (- 1.0 x) B)))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -4e+120) {
                                            		tmp = (-1.0 - x) / B;
                                            	} else if (F <= -210000.0) {
                                            		tmp = -1.0 / sin(B);
                                            	} else if (F <= 1.15e-38) {
                                            		tmp = ((pow(((x + x) + 2.0), -0.5) * F) - x) / B;
                                            	} else {
                                            		tmp = (1.0 - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(f, b, x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                real(8) :: tmp
                                                if (f <= (-4d+120)) then
                                                    tmp = ((-1.0d0) - x) / b
                                                else if (f <= (-210000.0d0)) then
                                                    tmp = (-1.0d0) / sin(b)
                                                else if (f <= 1.15d-38) then
                                                    tmp = (((((x + x) + 2.0d0) ** (-0.5d0)) * f) - x) / b
                                                else
                                                    tmp = (1.0d0 - x) / b
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -4e+120) {
                                            		tmp = (-1.0 - x) / B;
                                            	} else if (F <= -210000.0) {
                                            		tmp = -1.0 / Math.sin(B);
                                            	} else if (F <= 1.15e-38) {
                                            		tmp = ((Math.pow(((x + x) + 2.0), -0.5) * F) - x) / B;
                                            	} else {
                                            		tmp = (1.0 - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -4e+120:
                                            		tmp = (-1.0 - x) / B
                                            	elif F <= -210000.0:
                                            		tmp = -1.0 / math.sin(B)
                                            	elif F <= 1.15e-38:
                                            		tmp = ((math.pow(((x + x) + 2.0), -0.5) * F) - x) / B
                                            	else:
                                            		tmp = (1.0 - x) / B
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -4e+120)
                                            		tmp = Float64(Float64(-1.0 - x) / B);
                                            	elseif (F <= -210000.0)
                                            		tmp = Float64(-1.0 / sin(B));
                                            	elseif (F <= 1.15e-38)
                                            		tmp = Float64(Float64(Float64((Float64(Float64(x + x) + 2.0) ^ -0.5) * F) - x) / B);
                                            	else
                                            		tmp = Float64(Float64(1.0 - x) / B);
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -4e+120)
                                            		tmp = (-1.0 - x) / B;
                                            	elseif (F <= -210000.0)
                                            		tmp = -1.0 / sin(B);
                                            	elseif (F <= 1.15e-38)
                                            		tmp = (((((x + x) + 2.0) ^ -0.5) * F) - x) / B;
                                            	else
                                            		tmp = (1.0 - x) / B;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -4e+120], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -210000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-38], N[(N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -4 \cdot 10^{+120}:\\
                                            \;\;\;\;\frac{-1 - x}{B}\\
                                            
                                            \mathbf{elif}\;F \leq -210000:\\
                                            \;\;\;\;\frac{-1}{\sin B}\\
                                            
                                            \mathbf{elif}\;F \leq 1.15 \cdot 10^{-38}:\\
                                            \;\;\;\;\frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{1 - x}{B}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 4 regimes
                                            2. if F < -3.9999999999999999e120

                                              1. Initial program 39.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 \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. lift-/.f64N/A

                                                  \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                3. lift-tan.f64N/A

                                                  \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                4. associate-*r/N/A

                                                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                5. lower-/.f64N/A

                                                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                6. lower-*.f64N/A

                                                  \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                7. lift-tan.f6439.2

                                                  \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              3. Applied rewrites39.2%

                                                \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              4. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                              5. 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}} \]
                                              6. Applied rewrites30.8%

                                                \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                              7. Taylor expanded in F around -inf

                                                \[\leadsto \frac{-1 - x}{B} \]
                                              8. Step-by-step derivation
                                                1. Applied rewrites52.1%

                                                  \[\leadsto \frac{-1 - x}{B} \]

                                                if -3.9999999999999999e120 < F < -2.1e5

                                                1. Initial program 92.8%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Taylor expanded in F around -inf

                                                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                  2. lift-sin.f6459.7

                                                    \[\leadsto \frac{-1}{\sin B} \]
                                                4. Applied rewrites59.7%

                                                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                                if -2.1e5 < F < 1.15000000000000001e-38

                                                1. Initial program 99.5%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  3. lift-tan.f64N/A

                                                    \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  4. associate-*r/N/A

                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  5. lower-/.f64N/A

                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  6. lower-*.f64N/A

                                                    \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  7. lift-tan.f6499.6

                                                    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                3. Applied rewrites99.6%

                                                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                4. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                5. 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}} \]
                                                6. Applied rewrites52.2%

                                                  \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                7. Taylor expanded in F around 0

                                                  \[\leadsto \frac{{\left(2 \cdot x + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                8. Step-by-step derivation
                                                  1. count-2-revN/A

                                                    \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                  2. lift-+.f6451.9

                                                    \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B} \]
                                                9. Applied rewrites51.9%

                                                  \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B} \]

                                                if 1.15000000000000001e-38 < F

                                                1. Initial program 61.9%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  3. lift-tan.f64N/A

                                                    \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  4. associate-*r/N/A

                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  5. lower-/.f64N/A

                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  6. lower-*.f64N/A

                                                    \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  7. lift-tan.f6462.0

                                                    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                3. Applied rewrites62.0%

                                                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                4. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                5. 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}} \]
                                                6. Applied rewrites37.5%

                                                  \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                7. Taylor expanded in F around inf

                                                  \[\leadsto \frac{1 - x}{B} \]
                                                8. Step-by-step derivation
                                                  1. Applied rewrites47.8%

                                                    \[\leadsto \frac{1 - x}{B} \]
                                                9. Recombined 4 regimes into one program.
                                                10. Add Preprocessing

                                                Alternative 24: 47.3% accurate, 3.0× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -210000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-38}:\\ \;\;\;\;\frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -210000.0)
                                                   (/ (- -1.0 x) B)
                                                   (if (<= F 1.15e-38)
                                                     (/ (- (* (pow (+ (+ x x) 2.0) -0.5) F) x) B)
                                                     (/ (- 1.0 x) B))))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -210000.0) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 1.15e-38) {
                                                		tmp = ((pow(((x + x) + 2.0), -0.5) * F) - x) / B;
                                                	} else {
                                                		tmp = (1.0 - x) / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(8) function code(f, b, x)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: f
                                                    real(8), intent (in) :: b
                                                    real(8), intent (in) :: x
                                                    real(8) :: tmp
                                                    if (f <= (-210000.0d0)) then
                                                        tmp = ((-1.0d0) - x) / b
                                                    else if (f <= 1.15d-38) then
                                                        tmp = (((((x + x) + 2.0d0) ** (-0.5d0)) * f) - x) / b
                                                    else
                                                        tmp = (1.0d0 - x) / b
                                                    end if
                                                    code = tmp
                                                end function
                                                
                                                public static double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -210000.0) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 1.15e-38) {
                                                		tmp = ((Math.pow(((x + x) + 2.0), -0.5) * F) - x) / B;
                                                	} else {
                                                		tmp = (1.0 - x) / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(F, B, x):
                                                	tmp = 0
                                                	if F <= -210000.0:
                                                		tmp = (-1.0 - x) / B
                                                	elif F <= 1.15e-38:
                                                		tmp = ((math.pow(((x + x) + 2.0), -0.5) * F) - x) / B
                                                	else:
                                                		tmp = (1.0 - x) / B
                                                	return tmp
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -210000.0)
                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                	elseif (F <= 1.15e-38)
                                                		tmp = Float64(Float64(Float64((Float64(Float64(x + x) + 2.0) ^ -0.5) * F) - x) / B);
                                                	else
                                                		tmp = Float64(Float64(1.0 - x) / B);
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(F, B, x)
                                                	tmp = 0.0;
                                                	if (F <= -210000.0)
                                                		tmp = (-1.0 - x) / B;
                                                	elseif (F <= 1.15e-38)
                                                		tmp = (((((x + x) + 2.0) ^ -0.5) * F) - x) / B;
                                                	else
                                                		tmp = (1.0 - x) / B;
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -210000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.15e-38], N[(N[(N[(N[Power[N[(N[(x + x), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -210000:\\
                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 1.15 \cdot 10^{-38}:\\
                                                \;\;\;\;\frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{1 - x}{B}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 3 regimes
                                                2. if F < -2.1e5

                                                  1. Initial program 58.2%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Step-by-step derivation
                                                    1. lift-*.f64N/A

                                                      \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    3. lift-tan.f64N/A

                                                      \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    4. associate-*r/N/A

                                                      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    5. lower-/.f64N/A

                                                      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    6. lower-*.f64N/A

                                                      \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    7. lift-tan.f6458.2

                                                      \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  3. Applied rewrites58.2%

                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  4. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                  5. 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}} \]
                                                  6. Applied rewrites37.8%

                                                    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                  7. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                  8. Step-by-step derivation
                                                    1. Applied rewrites51.5%

                                                      \[\leadsto \frac{-1 - x}{B} \]

                                                    if -2.1e5 < F < 1.15000000000000001e-38

                                                    1. Initial program 99.5%

                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. Step-by-step derivation
                                                      1. lift-*.f64N/A

                                                        \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. lift-/.f64N/A

                                                        \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      3. lift-tan.f64N/A

                                                        \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      4. associate-*r/N/A

                                                        \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      5. lower-/.f64N/A

                                                        \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      6. lower-*.f64N/A

                                                        \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      7. lift-tan.f6499.6

                                                        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    3. Applied rewrites99.6%

                                                      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    4. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                    5. 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}} \]
                                                    6. Applied rewrites52.2%

                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                    7. Taylor expanded in F around 0

                                                      \[\leadsto \frac{{\left(2 \cdot x + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                    8. Step-by-step derivation
                                                      1. count-2-revN/A

                                                        \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
                                                      2. lift-+.f6451.9

                                                        \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B} \]
                                                    9. Applied rewrites51.9%

                                                      \[\leadsto \frac{{\left(\left(x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B} \]

                                                    if 1.15000000000000001e-38 < F

                                                    1. Initial program 61.9%

                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. Step-by-step derivation
                                                      1. lift-*.f64N/A

                                                        \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. lift-/.f64N/A

                                                        \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      3. lift-tan.f64N/A

                                                        \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      4. associate-*r/N/A

                                                        \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      5. lower-/.f64N/A

                                                        \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      6. lower-*.f64N/A

                                                        \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      7. lift-tan.f6462.0

                                                        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    3. Applied rewrites62.0%

                                                      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    4. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                    5. 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}} \]
                                                    6. Applied rewrites37.5%

                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                    7. Taylor expanded in F around inf

                                                      \[\leadsto \frac{1 - x}{B} \]
                                                    8. Step-by-step derivation
                                                      1. Applied rewrites47.8%

                                                        \[\leadsto \frac{1 - x}{B} \]
                                                    9. Recombined 3 regimes into one program.
                                                    10. Add Preprocessing

                                                    Alternative 25: 43.8% accurate, 7.9× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-59}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                    (FPCore (F B x)
                                                     :precision binary64
                                                     (if (<= F -3e-54)
                                                       (/ (- -1.0 x) B)
                                                       (if (<= F 1.5e-59) (- (/ x B)) (/ (- 1.0 x) B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -3e-54) {
                                                    		tmp = (-1.0 - x) / B;
                                                    	} else if (F <= 1.5e-59) {
                                                    		tmp = -(x / B);
                                                    	} else {
                                                    		tmp = (1.0 - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    module fmin_fmax_functions
                                                        implicit none
                                                        private
                                                        public fmax
                                                        public fmin
                                                    
                                                        interface fmax
                                                            module procedure fmax88
                                                            module procedure fmax44
                                                            module procedure fmax84
                                                            module procedure fmax48
                                                        end interface
                                                        interface fmin
                                                            module procedure fmin88
                                                            module procedure fmin44
                                                            module procedure fmin84
                                                            module procedure fmin48
                                                        end interface
                                                    contains
                                                        real(8) function fmax88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmax44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmin44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                        end function
                                                    end module
                                                    
                                                    real(8) function code(f, b, x)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: f
                                                        real(8), intent (in) :: b
                                                        real(8), intent (in) :: x
                                                        real(8) :: tmp
                                                        if (f <= (-3d-54)) then
                                                            tmp = ((-1.0d0) - x) / b
                                                        else if (f <= 1.5d-59) then
                                                            tmp = -(x / b)
                                                        else
                                                            tmp = (1.0d0 - x) / b
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -3e-54) {
                                                    		tmp = (-1.0 - x) / B;
                                                    	} else if (F <= 1.5e-59) {
                                                    		tmp = -(x / B);
                                                    	} else {
                                                    		tmp = (1.0 - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(F, B, x):
                                                    	tmp = 0
                                                    	if F <= -3e-54:
                                                    		tmp = (-1.0 - x) / B
                                                    	elif F <= 1.5e-59:
                                                    		tmp = -(x / B)
                                                    	else:
                                                    		tmp = (1.0 - x) / B
                                                    	return tmp
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (F <= -3e-54)
                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                    	elseif (F <= 1.5e-59)
                                                    		tmp = Float64(-Float64(x / B));
                                                    	else
                                                    		tmp = Float64(Float64(1.0 - x) / B);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(F, B, x)
                                                    	tmp = 0.0;
                                                    	if (F <= -3e-54)
                                                    		tmp = (-1.0 - x) / B;
                                                    	elseif (F <= 1.5e-59)
                                                    		tmp = -(x / B);
                                                    	else
                                                    		tmp = (1.0 - x) / B;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[F_, B_, x_] := If[LessEqual[F, -3e-54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.5e-59], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;F \leq -3 \cdot 10^{-54}:\\
                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 1.5 \cdot 10^{-59}:\\
                                                    \;\;\;\;-\frac{x}{B}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{1 - x}{B}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if F < -3.00000000000000009e-54

                                                      1. Initial program 64.0%

                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. Step-by-step derivation
                                                        1. lift-*.f64N/A

                                                          \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. lift-/.f64N/A

                                                          \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        3. lift-tan.f64N/A

                                                          \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        4. associate-*r/N/A

                                                          \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        5. lower-/.f64N/A

                                                          \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        6. lower-*.f64N/A

                                                          \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        7. lift-tan.f6464.0

                                                          \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      3. Applied rewrites64.0%

                                                        \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      4. Taylor expanded in B around 0

                                                        \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                      5. 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}} \]
                                                      6. Applied rewrites39.8%

                                                        \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                      7. Taylor expanded in F around -inf

                                                        \[\leadsto \frac{-1 - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. Applied rewrites47.6%

                                                          \[\leadsto \frac{-1 - x}{B} \]

                                                        if -3.00000000000000009e-54 < F < 1.5e-59

                                                        1. Initial program 99.5%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Taylor expanded in F around 0

                                                          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                        3. Step-by-step derivation
                                                          1. mul-1-negN/A

                                                            \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                                                          2. lower-neg.f64N/A

                                                            \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                                          3. lower-/.f64N/A

                                                            \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                                          4. *-commutativeN/A

                                                            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                          5. lower-*.f64N/A

                                                            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                          6. lower-cos.f64N/A

                                                            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                          7. lift-sin.f6472.2

                                                            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                        4. Applied rewrites72.2%

                                                          \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
                                                        5. Taylor expanded in B around 0

                                                          \[\leadsto -\frac{x}{B} \]
                                                        6. Step-by-step derivation
                                                          1. lower-/.f6438.1

                                                            \[\leadsto -\frac{x}{B} \]
                                                        7. Applied rewrites38.1%

                                                          \[\leadsto -\frac{x}{B} \]

                                                        if 1.5e-59 < F

                                                        1. Initial program 63.8%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Step-by-step derivation
                                                          1. lift-*.f64N/A

                                                            \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. lift-/.f64N/A

                                                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          3. lift-tan.f64N/A

                                                            \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          4. associate-*r/N/A

                                                            \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          5. lower-/.f64N/A

                                                            \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          6. lower-*.f64N/A

                                                            \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          7. lift-tan.f6463.8

                                                            \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        3. Applied rewrites63.8%

                                                          \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        4. Taylor expanded in B around 0

                                                          \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                        5. 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}} \]
                                                        6. Applied rewrites38.2%

                                                          \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                        7. Taylor expanded in F around inf

                                                          \[\leadsto \frac{1 - x}{B} \]
                                                        8. Step-by-step derivation
                                                          1. Applied rewrites46.5%

                                                            \[\leadsto \frac{1 - x}{B} \]
                                                        9. Recombined 3 regimes into one program.
                                                        10. Add Preprocessing

                                                        Alternative 26: 36.6% accurate, 10.7× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \end{array} \]
                                                        (FPCore (F B x)
                                                         :precision binary64
                                                         (if (<= F -3e-54) (/ (- -1.0 x) B) (- (/ x B))))
                                                        double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -3e-54) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else {
                                                        		tmp = -(x / B);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        module fmin_fmax_functions
                                                            implicit none
                                                            private
                                                            public fmax
                                                            public fmin
                                                        
                                                            interface fmax
                                                                module procedure fmax88
                                                                module procedure fmax44
                                                                module procedure fmax84
                                                                module procedure fmax48
                                                            end interface
                                                            interface fmin
                                                                module procedure fmin88
                                                                module procedure fmin44
                                                                module procedure fmin84
                                                                module procedure fmin48
                                                            end interface
                                                        contains
                                                            real(8) function fmax88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmax44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmin44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                            end function
                                                        end module
                                                        
                                                        real(8) function code(f, b, x)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: f
                                                            real(8), intent (in) :: b
                                                            real(8), intent (in) :: x
                                                            real(8) :: tmp
                                                            if (f <= (-3d-54)) then
                                                                tmp = ((-1.0d0) - x) / b
                                                            else
                                                                tmp = -(x / b)
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -3e-54) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else {
                                                        		tmp = -(x / B);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(F, B, x):
                                                        	tmp = 0
                                                        	if F <= -3e-54:
                                                        		tmp = (-1.0 - x) / B
                                                        	else:
                                                        		tmp = -(x / B)
                                                        	return tmp
                                                        
                                                        function code(F, B, x)
                                                        	tmp = 0.0
                                                        	if (F <= -3e-54)
                                                        		tmp = Float64(Float64(-1.0 - x) / B);
                                                        	else
                                                        		tmp = Float64(-Float64(x / B));
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(F, B, x)
                                                        	tmp = 0.0;
                                                        	if (F <= -3e-54)
                                                        		tmp = (-1.0 - x) / B;
                                                        	else
                                                        		tmp = -(x / B);
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[F_, B_, x_] := If[LessEqual[F, -3e-54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;F \leq -3 \cdot 10^{-54}:\\
                                                        \;\;\;\;\frac{-1 - x}{B}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;-\frac{x}{B}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if F < -3.00000000000000009e-54

                                                          1. Initial program 64.0%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Step-by-step derivation
                                                            1. lift-*.f64N/A

                                                              \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            2. lift-/.f64N/A

                                                              \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            3. lift-tan.f64N/A

                                                              \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            4. associate-*r/N/A

                                                              \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            5. lower-/.f64N/A

                                                              \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            6. lower-*.f64N/A

                                                              \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            7. lift-tan.f6464.0

                                                              \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          3. Applied rewrites64.0%

                                                            \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          4. Taylor expanded in B around 0

                                                            \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                          5. 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}} \]
                                                          6. Applied rewrites39.8%

                                                            \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                          7. Taylor expanded in F around -inf

                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                          8. Step-by-step derivation
                                                            1. Applied rewrites47.6%

                                                              \[\leadsto \frac{-1 - x}{B} \]

                                                            if -3.00000000000000009e-54 < F

                                                            1. Initial program 82.7%

                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            2. Taylor expanded in F around 0

                                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                            3. Step-by-step derivation
                                                              1. mul-1-negN/A

                                                                \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                                                              2. lower-neg.f64N/A

                                                                \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                                              3. lower-/.f64N/A

                                                                \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                                              4. *-commutativeN/A

                                                                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                              5. lower-*.f64N/A

                                                                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                              6. lower-cos.f64N/A

                                                                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                              7. lift-sin.f6460.2

                                                                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                            4. Applied rewrites60.2%

                                                              \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
                                                            5. Taylor expanded in B around 0

                                                              \[\leadsto -\frac{x}{B} \]
                                                            6. Step-by-step derivation
                                                              1. lower-/.f6431.6

                                                                \[\leadsto -\frac{x}{B} \]
                                                            7. Applied rewrites31.6%

                                                              \[\leadsto -\frac{x}{B} \]
                                                          9. Recombined 2 regimes into one program.
                                                          10. Add Preprocessing

                                                          Alternative 27: 29.7% accurate, 12.7× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+155}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \end{array} \]
                                                          (FPCore (F B x) :precision binary64 (if (<= F -5e+155) (/ -1.0 B) (- (/ x B))))
                                                          double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= -5e+155) {
                                                          		tmp = -1.0 / B;
                                                          	} else {
                                                          		tmp = -(x / B);
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          module fmin_fmax_functions
                                                              implicit none
                                                              private
                                                              public fmax
                                                              public fmin
                                                          
                                                              interface fmax
                                                                  module procedure fmax88
                                                                  module procedure fmax44
                                                                  module procedure fmax84
                                                                  module procedure fmax48
                                                              end interface
                                                              interface fmin
                                                                  module procedure fmin88
                                                                  module procedure fmin44
                                                                  module procedure fmin84
                                                                  module procedure fmin48
                                                              end interface
                                                          contains
                                                              real(8) function fmax88(x, y) result (res)
                                                                  real(8), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                              end function
                                                              real(4) function fmax44(x, y) result (res)
                                                                  real(4), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmax84(x, y) result(res)
                                                                  real(8), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmax48(x, y) result(res)
                                                                  real(4), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmin88(x, y) result (res)
                                                                  real(8), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                              end function
                                                              real(4) function fmin44(x, y) result (res)
                                                                  real(4), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmin84(x, y) result(res)
                                                                  real(8), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmin48(x, y) result(res)
                                                                  real(4), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                              end function
                                                          end module
                                                          
                                                          real(8) function code(f, b, x)
                                                          use fmin_fmax_functions
                                                              real(8), intent (in) :: f
                                                              real(8), intent (in) :: b
                                                              real(8), intent (in) :: x
                                                              real(8) :: tmp
                                                              if (f <= (-5d+155)) then
                                                                  tmp = (-1.0d0) / b
                                                              else
                                                                  tmp = -(x / b)
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          public static double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= -5e+155) {
                                                          		tmp = -1.0 / B;
                                                          	} else {
                                                          		tmp = -(x / B);
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          def code(F, B, x):
                                                          	tmp = 0
                                                          	if F <= -5e+155:
                                                          		tmp = -1.0 / B
                                                          	else:
                                                          		tmp = -(x / B)
                                                          	return tmp
                                                          
                                                          function code(F, B, x)
                                                          	tmp = 0.0
                                                          	if (F <= -5e+155)
                                                          		tmp = Float64(-1.0 / B);
                                                          	else
                                                          		tmp = Float64(-Float64(x / B));
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          function tmp_2 = code(F, B, x)
                                                          	tmp = 0.0;
                                                          	if (F <= -5e+155)
                                                          		tmp = -1.0 / B;
                                                          	else
                                                          		tmp = -(x / B);
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          code[F_, B_, x_] := If[LessEqual[F, -5e+155], N[(-1.0 / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;F \leq -5 \cdot 10^{+155}:\\
                                                          \;\;\;\;\frac{-1}{B}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;-\frac{x}{B}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if F < -4.9999999999999999e155

                                                            1. Initial program 30.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 -inf

                                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                            3. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                              2. lift-sin.f6451.0

                                                                \[\leadsto \frac{-1}{\sin B} \]
                                                            4. Applied rewrites51.0%

                                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                            5. Taylor expanded in B around 0

                                                              \[\leadsto \frac{-1}{B} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites27.7%

                                                                \[\leadsto \frac{-1}{B} \]

                                                              if -4.9999999999999999e155 < F

                                                              1. Initial program 84.6%

                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                              2. Taylor expanded in F around 0

                                                                \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                              3. Step-by-step derivation
                                                                1. mul-1-negN/A

                                                                  \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                                                                2. lower-neg.f64N/A

                                                                  \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                                                3. lower-/.f64N/A

                                                                  \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                                                4. *-commutativeN/A

                                                                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                                5. lower-*.f64N/A

                                                                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                                6. lower-cos.f64N/A

                                                                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                                7. lift-sin.f6456.7

                                                                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                                              4. Applied rewrites56.7%

                                                                \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
                                                              5. Taylor expanded in B around 0

                                                                \[\leadsto -\frac{x}{B} \]
                                                              6. Step-by-step derivation
                                                                1. lower-/.f6430.0

                                                                  \[\leadsto -\frac{x}{B} \]
                                                              7. Applied rewrites30.0%

                                                                \[\leadsto -\frac{x}{B} \]
                                                            7. Recombined 2 regimes into one program.
                                                            8. Add Preprocessing

                                                            Alternative 28: 17.4% accurate, 14.2× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1300000000000:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
                                                            (FPCore (F B x)
                                                             :precision binary64
                                                             (if (<= F 1300000000000.0) (/ -1.0 B) (/ 1.0 B)))
                                                            double code(double F, double B, double x) {
                                                            	double tmp;
                                                            	if (F <= 1300000000000.0) {
                                                            		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 <= 1300000000000.0d0) 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 <= 1300000000000.0) {
                                                            		tmp = -1.0 / B;
                                                            	} else {
                                                            		tmp = 1.0 / B;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(F, B, x):
                                                            	tmp = 0
                                                            	if F <= 1300000000000.0:
                                                            		tmp = -1.0 / B
                                                            	else:
                                                            		tmp = 1.0 / B
                                                            	return tmp
                                                            
                                                            function code(F, B, x)
                                                            	tmp = 0.0
                                                            	if (F <= 1300000000000.0)
                                                            		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 <= 1300000000000.0)
                                                            		tmp = -1.0 / B;
                                                            	else
                                                            		tmp = 1.0 / B;
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[F_, B_, x_] := If[LessEqual[F, 1300000000000.0], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;F \leq 1300000000000:\\
                                                            \;\;\;\;\frac{-1}{B}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\frac{1}{B}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if F < 1.3e12

                                                              1. Initial program 84.2%

                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                              2. Taylor expanded in F around -inf

                                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                              3. Step-by-step derivation
                                                                1. lower-/.f64N/A

                                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                2. lift-sin.f6422.9

                                                                  \[\leadsto \frac{-1}{\sin B} \]
                                                              4. Applied rewrites22.9%

                                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                              5. Taylor expanded in B around 0

                                                                \[\leadsto \frac{-1}{B} \]
                                                              6. Step-by-step derivation
                                                                1. Applied rewrites13.3%

                                                                  \[\leadsto \frac{-1}{B} \]

                                                                if 1.3e12 < F

                                                                1. Initial program 57.1%

                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                2. Step-by-step derivation
                                                                  1. lift-*.f64N/A

                                                                    \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  2. lift-/.f64N/A

                                                                    \[\leadsto \left(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  3. lift-tan.f64N/A

                                                                    \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  4. associate-*r/N/A

                                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  5. lower-/.f64N/A

                                                                    \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  6. lower-*.f64N/A

                                                                    \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  7. lift-tan.f6457.2

                                                                    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                3. Applied rewrites57.2%

                                                                  \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                4. Taylor expanded in B around 0

                                                                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                                                                5. 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}} \]
                                                                6. Applied rewrites36.3%

                                                                  \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}} \]
                                                                7. Taylor expanded in F around inf

                                                                  \[\leadsto \frac{1}{B} \]
                                                                8. Step-by-step derivation
                                                                  1. Applied rewrites28.3%

                                                                    \[\leadsto \frac{1}{B} \]
                                                                9. Recombined 2 regimes into one program.
                                                                10. Add Preprocessing

                                                                Alternative 29: 10.4% accurate, 26.5× speedup?

                                                                \[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
                                                                (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]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \frac{-1}{B}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Initial program 76.8%

                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                2. Taylor expanded in F around -inf

                                                                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                                3. Step-by-step derivation
                                                                  1. lower-/.f64N/A

                                                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                  2. lift-sin.f6417.2

                                                                    \[\leadsto \frac{-1}{\sin B} \]
                                                                4. Applied rewrites17.2%

                                                                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                                5. Taylor expanded in B around 0

                                                                  \[\leadsto \frac{-1}{B} \]
                                                                6. Step-by-step derivation
                                                                  1. Applied rewrites10.4%

                                                                    \[\leadsto \frac{-1}{B} \]
                                                                  2. Add Preprocessing

                                                                  Reproduce

                                                                  ?
                                                                  herbie shell --seed 2025133 
                                                                  (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))))))