VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.2% → 98.7%
Time: 8.2s
Alternatives: 23
Speedup: 1.4×

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

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

Initial Program: 76.2% 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: 98.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 5.2 \cdot 10^{+66}:\\
\;\;\;\;\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}:\\
\;\;\;\;t\_1 + \mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, -\frac{\left(\frac{1}{F} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e115 < F < 5.20000000000000024e66

    1. Initial program 76.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.f6476.3

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

      \[\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 5.20000000000000024e66 < F

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, -\frac{\left(\frac{1}{F} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
    9. Step-by-step derivation
      1. lower-/.f6444.3

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, -\frac{\left(\frac{1}{F} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
    10. Applied rewrites44.3%

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

Alternative 2: 98.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 8 \cdot 10^{+82}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\frac{1}{t\_1} + \left(-\frac{\cos B \cdot x}{t\_1}\right)\right) \cdot F\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e115 < F < 7.9999999999999997e82

    1. Initial program 76.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.f6476.3

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

      \[\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 7.9999999999999997e82 < F

    1. Initial program 76.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}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

Alternative 3: 98.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \sin B \cdot F\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;-\frac{1 + t\_1}{t\_0} \cdot F\\

\mathbf{elif}\;F \leq 8 \cdot 10^{+82}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\frac{1}{t\_0} + \left(-\frac{t\_1}{t\_0}\right)\right) \cdot F\\


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

    1. Initial program 76.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}{-1 \cdot \left(F \cdot \left(\frac{1}{F \cdot \sin B} + \frac{x \cdot \cos B}{F \cdot \sin B}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F \]
      13. lift-sin.f6451.2

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

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

    if -1.85000000000000002e112 < F < 7.9999999999999997e82

    1. Initial program 76.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.f6476.3

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

      \[\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 7.9999999999999997e82 < F

    1. Initial program 76.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}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

Alternative 4: 92.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\

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

\mathbf{elif}\;F \leq 10^{+228}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\

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


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

    1. Initial program 76.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}{-1 \cdot \left(F \cdot \left(\frac{1}{F \cdot \sin B} + \frac{x \cdot \cos B}{F \cdot \sin B}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F \]
      13. lift-sin.f6451.2

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

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

    if -1.85000000000000002e112 < F < 1.35000000000000003e154

    1. Initial program 76.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.f6476.3

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

      \[\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 1.35000000000000003e154 < F < 9.9999999999999992e227

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

    if 9.9999999999999992e227 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 91.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\

\mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_1\right)\\

\mathbf{elif}\;F \leq 10^{+228}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, t\_1 \cdot \frac{1}{F}\right)\\


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

    1. Initial program 76.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}{-1 \cdot \left(F \cdot \left(\frac{1}{F \cdot \sin B} + \frac{x \cdot \cos B}{F \cdot \sin B}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F \]
      13. lift-sin.f6451.2

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

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

    if -1.85000000000000002e112 < F < 1.35000000000000003e154

    1. Initial program 76.2%

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

      \[\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 1.35000000000000003e154 < F < 9.9999999999999992e227

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

    if 9.9999999999999992e227 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.2% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 76.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}{-1 \cdot \left(F \cdot \left(\frac{1}{F \cdot \sin B} + \frac{x \cdot \cos B}{F \cdot \sin B}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F \]
      13. lift-sin.f6451.2

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

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

    if -2.7000000000000002 < F < 1.45e-5

    1. Initial program 76.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 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 rewrites54.9%

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

    if 1.45e-5 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 85.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;F \leq -3.6 \cdot 10^{-170}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot t\_1\\

\mathbf{elif}\;F \leq 310:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot t\_1\\

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


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

    1. Initial program 76.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}{-1 \cdot \left(F \cdot \left(\frac{1}{F \cdot \sin B} + \frac{x \cdot \cos B}{F \cdot \sin B}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F \]
      13. lift-sin.f6451.2

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

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

    if -2.30000000000000012e39 < F < -3.6000000000000003e-170

    1. Initial program 76.2%

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

      \[\leadsto \left(-\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-/.f6449.2

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

      \[\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 -3.6000000000000003e-170 < F < 310

    1. Initial program 76.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.f6476.3

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

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

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

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

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

    if 310 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\

\mathbf{elif}\;F \leq -3.6 \cdot 10^{-170}:\\
\;\;\;\;\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{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left(2 + F \cdot F\right)}^{-0.5}}{B}\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{+224}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.30000000000000012e39

    1. Initial program 76.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}{-1 \cdot \left(F \cdot \left(\frac{1}{F \cdot \sin B} + \frac{x \cdot \cos B}{F \cdot \sin B}\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F \]
      13. lift-sin.f6451.2

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

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

    if -2.30000000000000012e39 < F < -3.6000000000000003e-170

    1. Initial program 76.2%

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

      \[\leadsto \left(-\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-/.f6449.2

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

      \[\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 -3.6000000000000003e-170 < F < 1.35000000000000003e154

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(F \cdot F + 2\right)}^{\frac{-1}{4}}}{\sin B}, -\frac{\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
      16. lift-fma.f6483.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}}}{\sin B}, -\frac{\left(\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(F \cdot F + 2\right)}^{\frac{-1}{4}}\right) \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
      16. lift-fma.f6483.2

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left({\left(2 + F \cdot F\right)}^{\frac{-1}{4}}\right)}^{2}}{\sin B} \]
      8. lift-sin.f6484.6

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

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

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

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

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

    if 1.35000000000000003e154 < F < 2.3000000000000002e224

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

    if 2.3000000000000002e224 < F

    1. Initial program 76.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.f6417.0

        \[\leadsto \frac{1}{\sin B} \]
    4. Applied rewrites17.0%

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

Alternative 9: 75.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq 10:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_2\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+268}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -5e4 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.9999999999999999e268

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(F \cdot F + 2\right)}^{\frac{-1}{4}}}{\sin B}, -\frac{\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
      16. lift-fma.f6483.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}}}{\sin B}, -\frac{\left(\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(F \cdot F + 2\right)}^{\frac{-1}{4}}\right) \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
      16. lift-fma.f6483.2

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left({\left(2 + F \cdot F\right)}^{\frac{-1}{4}}\right)}^{2}}{\sin B} \]
      8. lift-sin.f6484.6

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

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

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

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

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

    if -5e4 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

    1. Initial program 76.2%

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

      \[\leadsto \left(-\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-/.f6449.2

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

      \[\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 1.9999999999999999e268 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B} \]
      13. lower-/.f6422.3

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

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

Alternative 10: 74.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left(2 + F \cdot F\right)}^{-0.5}}{B}\\ \mathbf{if}\;x \leq -2.6 \cdot 10^{-140}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-123}:\\ \;\;\;\;\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)))) (/ (* F (pow (+ 2.0 (* F F)) -0.5)) B))))
   (if (<= x -2.6e-140)
     t_0
     (if (<= x 1.6e-123) (/ (* (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))) + ((F * pow((2.0 + (F * F)), -0.5)) / B);
	double tmp;
	if (x <= -2.6e-140) {
		tmp = t_0;
	} else if (x <= 1.6e-123) {
		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(Float64(F * (Float64(2.0 + Float64(F * F)) ^ -0.5)) / B))
	tmp = 0.0
	if (x <= -2.6e-140)
		tmp = t_0;
	elseif (x <= 1.6e-123)
		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[(N[(F * N[Power[N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e-140], t$95$0, If[LessEqual[x, 1.6e-123], 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{F \cdot {\left(2 + F \cdot F\right)}^{-0.5}}{B}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{-140}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{-123}:\\
\;\;\;\;\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 < -2.5999999999999998e-140 or 1.59999999999999989e-123 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(F \cdot F + 2\right)}^{\frac{-1}{4}}}{\sin B}, -\frac{\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
      16. lift-fma.f6483.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}}}{\sin B}, -\frac{\left(\left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{4}} \cdot {\left(F \cdot F + 2\right)}^{\frac{-1}{4}}\right) \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right) \]
      16. lift-fma.f6483.2

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left({\left(2 + F \cdot F\right)}^{\frac{-1}{4}}\right)}^{2}}{\sin B} \]
      8. lift-sin.f6484.6

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

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

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

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

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

    if -2.5999999999999998e-140 < x < 1.59999999999999989e-123

    1. Initial program 76.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 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.f6430.3

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

      \[\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 11: 71.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -\cos B \cdot \frac{x}{\sin B}\\ \mathbf{if}\;x \leq -1.55 \cdot 10^{-46}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-88}:\\ \;\;\;\;\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 (- (* (cos B) (/ x (sin B))))))
   (if (<= x -1.55e-46)
     t_0
     (if (<= x 2.9e-88) (/ (* (pow (fma F F 2.0) -0.5) F) (sin B)) t_0))))
double code(double F, double B, double x) {
	double t_0 = -(cos(B) * (x / sin(B)));
	double tmp;
	if (x <= -1.55e-46) {
		tmp = t_0;
	} else if (x <= 2.9e-88) {
		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(cos(B) * Float64(x / sin(B))))
	tmp = 0.0
	if (x <= -1.55e-46)
		tmp = t_0;
	elseif (x <= 2.9e-88)
		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[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -1.55e-46], t$95$0, If[LessEqual[x, 2.9e-88], 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 := -\cos B \cdot \frac{x}{\sin B}\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{-88}:\\
\;\;\;\;\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.55e-46 or 2.9000000000000001e-88 < x

    1. Initial program 76.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 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.f6455.9

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

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

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

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

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

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

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

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

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

        \[\leadsto -\cos B \cdot \frac{x}{\sin B} \]
      9. lift-sin.f6455.9

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

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

    if -1.55e-46 < x < 2.9000000000000001e-88

    1. Initial program 76.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 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.f6430.3

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

      \[\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 12: 57.2% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.39999999999999998e-8

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999998e-8 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{F}{B \cdot \left(1 + \frac{-1}{6} \cdot \left(B \cdot \color{blue}{B}\right)\right)} \cdot \frac{-1}{F}\right) \]
      5. lift-*.f6447.7

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

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

Alternative 13: 56.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 2.39999999999999998e-8

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999998e-8 < B

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F}\right) \]
    8. Step-by-step derivation
      1. lower-/.f6446.8

        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{F}{\color{blue}{B}} \cdot \frac{-1}{F}\right) \]
    9. Applied rewrites46.8%

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

Alternative 14: 51.0% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.85:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B} - \frac{x}{B}\\

\mathbf{elif}\;B \leq 6.6 \cdot 10^{+242}:\\
\;\;\;\;\frac{1}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 3.85000000000000009

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.85000000000000009 < B < 6.60000000000000045e242

    1. Initial program 76.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.f6417.0

        \[\leadsto \frac{1}{\sin B} \]
    4. Applied rewrites17.0%

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

    if 6.60000000000000045e242 < B

    1. Initial program 76.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.f6417.8

        \[\leadsto \frac{-1}{\sin B} \]
    4. Applied rewrites17.8%

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

Alternative 15: 50.7% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.85:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\

\mathbf{elif}\;B \leq 6.6 \cdot 10^{+242}:\\
\;\;\;\;\frac{1}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 3.85000000000000009

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

    if 3.85000000000000009 < B < 6.60000000000000045e242

    1. Initial program 76.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.f6417.0

        \[\leadsto \frac{1}{\sin B} \]
    4. Applied rewrites17.0%

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

    if 6.60000000000000045e242 < B

    1. Initial program 76.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.f6417.8

        \[\leadsto \frac{-1}{\sin B} \]
    4. Applied rewrites17.8%

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

Alternative 16: 50.7% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\

\mathbf{elif}\;F \leq 520000000000:\\
\;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{+224}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\


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

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B} \]
      13. lower-/.f6422.3

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

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

    if -3.6e-9 < F < 5.2e11

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{{\left(2 \cdot x + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-*.f6429.2

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

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

    if 5.2e11 < F < 2.3000000000000002e224

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

    if 2.3000000000000002e224 < F

    1. Initial program 76.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.f6417.0

        \[\leadsto \frac{1}{\sin B} \]
    4. Applied rewrites17.0%

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

Alternative 17: 47.4% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{-9}:\\ \;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 520000000000:\\ \;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.6e-9)
   (/ (- (* (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (* (* F F) F))) (/ 1.0 F)) F) x) B)
   (if (<= F 520000000000.0)
     (/ (- (* (pow (+ (* 2.0 x) 2.0) -0.5) F) x) B)
     (/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.6e-9) {
		tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
	} else if (F <= 520000000000.0) {
		tmp = ((pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
	} else {
		tmp = (((1.0 / F) * F) - x) / B;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-3.6d-9)) then
        tmp = ((((0.5d0 * ((2.0d0 + (2.0d0 * x)) / ((f * f) * f))) - (1.0d0 / f)) * f) - x) / b
    else if (f <= 520000000000.0d0) then
        tmp = (((((2.0d0 * x) + 2.0d0) ** (-0.5d0)) * f) - x) / b
    else
        tmp = (((1.0d0 / f) * f) - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.6e-9) {
		tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
	} else if (F <= 520000000000.0) {
		tmp = ((Math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
	} else {
		tmp = (((1.0 / F) * F) - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.6e-9:
		tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B
	elif F <= 520000000000.0:
		tmp = ((math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B
	else:
		tmp = (((1.0 / F) * F) - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.6e-9)
		tmp = Float64(Float64(Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(Float64(F * F) * F))) - Float64(1.0 / F)) * F) - x) / B);
	elseif (F <= 520000000000.0)
		tmp = Float64(Float64(Float64((Float64(Float64(2.0 * x) + 2.0) ^ -0.5) * F) - x) / B);
	else
		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.6e-9)
		tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
	elseif (F <= 520000000000.0)
		tmp = (((((2.0 * x) + 2.0) ^ -0.5) * F) - x) / B;
	else
		tmp = (((1.0 / F) * F) - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.6e-9], N[(N[(N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 520000000000.0], N[(N[(N[(N[Power[N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\

\mathbf{elif}\;F \leq 520000000000:\\
\;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\

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


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

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B} \]
      13. lower-/.f6422.3

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

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

    if -3.6e-9 < F < 5.2e11

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{{\left(2 \cdot x + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-*.f6429.2

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

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

    if 5.2e11 < F

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

Alternative 18: 47.4% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\

\mathbf{elif}\;F \leq 520000000000:\\
\;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\

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


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

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{-1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.2

        \[\leadsto \frac{\frac{-1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.2%

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

    if -2.7000000000000002 < F < 5.2e11

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{{\left(2 \cdot x + 2\right)}^{\frac{-1}{2}} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-*.f6429.2

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

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

    if 5.2e11 < F

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

Alternative 19: 44.3% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.35 \cdot 10^{-33}:\\ \;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-27}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.35e-33)
   (/ (- (* (/ -1.0 F) F) x) B)
   (if (<= F 2.4e-27) (/ (* -1.0 x) B) (/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.35e-33) {
		tmp = (((-1.0 / F) * F) - x) / B;
	} else if (F <= 2.4e-27) {
		tmp = (-1.0 * x) / B;
	} else {
		tmp = (((1.0 / F) * F) - 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 <= (-2.35d-33)) then
        tmp = ((((-1.0d0) / f) * f) - x) / b
    else if (f <= 2.4d-27) then
        tmp = ((-1.0d0) * x) / b
    else
        tmp = (((1.0d0 / f) * f) - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.35e-33) {
		tmp = (((-1.0 / F) * F) - x) / B;
	} else if (F <= 2.4e-27) {
		tmp = (-1.0 * x) / B;
	} else {
		tmp = (((1.0 / F) * F) - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.35e-33:
		tmp = (((-1.0 / F) * F) - x) / B
	elif F <= 2.4e-27:
		tmp = (-1.0 * x) / B
	else:
		tmp = (((1.0 / F) * F) - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.35e-33)
		tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - x) / B);
	elseif (F <= 2.4e-27)
		tmp = Float64(Float64(-1.0 * x) / B);
	else
		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.35e-33)
		tmp = (((-1.0 / F) * F) - x) / B;
	elseif (F <= 2.4e-27)
		tmp = (-1.0 * x) / B;
	else
		tmp = (((1.0 / F) * F) - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-33], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.4e-27], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\

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


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

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{-1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.2

        \[\leadsto \frac{\frac{-1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.2%

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

    if -2.3500000000000001e-33 < F < 2.40000000000000002e-27

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. lower-*.f6429.6

        \[\leadsto \frac{-1 \cdot x}{B} \]
    7. Applied rewrites29.6%

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

    if 2.40000000000000002e-27 < F

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.6

        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.6%

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

Alternative 20: 36.7% accurate, 6.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.35 \cdot 10^{-33}:\\ \;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.35e-33) (/ (- (* (/ -1.0 F) F) x) B) (/ (* -1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.35e-33) {
		tmp = (((-1.0 / F) * 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 <= (-2.35d-33)) then
        tmp = ((((-1.0d0) / f) * 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 <= -2.35e-33) {
		tmp = (((-1.0 / F) * F) - x) / B;
	} else {
		tmp = (-1.0 * x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.35e-33:
		tmp = (((-1.0 / F) * F) - x) / B
	else:
		tmp = (-1.0 * x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.35e-33)
		tmp = Float64(Float64(Float64(Float64(-1.0 / F) * 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 <= -2.35e-33)
		tmp = (((-1.0 / F) * F) - x) / B;
	else
		tmp = (-1.0 * x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-33], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\

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


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

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{\frac{-1}{F} \cdot F - x}{B} \]
    6. Step-by-step derivation
      1. lower-/.f6430.2

        \[\leadsto \frac{\frac{-1}{F} \cdot F - x}{B} \]
    7. Applied rewrites30.2%

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

    if -2.3500000000000001e-33 < F

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. lower-*.f6429.6

        \[\leadsto \frac{-1 \cdot x}{B} \]
    7. Applied rewrites29.6%

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

Alternative 21: 31.6% accurate, 6.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 \cdot x}{B}\\ \mathbf{if}\;x \leq -5.5 \cdot 10^{-57}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-291}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-123}:\\ \;\;\;\;\frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (* -1.0 x) B)))
   (if (<= x -5.5e-57)
     t_0
     (if (<= x 1.5e-291) (/ -1.0 B) (if (<= x 1.8e-123) (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 * x) / B;
	double tmp;
	if (x <= -5.5e-57) {
		tmp = t_0;
	} else if (x <= 1.5e-291) {
		tmp = -1.0 / B;
	} else if (x <= 1.8e-123) {
		tmp = 1.0 / B;
	} else {
		tmp = t_0;
	}
	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 = ((-1.0d0) * x) / b
    if (x <= (-5.5d-57)) then
        tmp = t_0
    else if (x <= 1.5d-291) then
        tmp = (-1.0d0) / b
    else if (x <= 1.8d-123) then
        tmp = 1.0d0 / b
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (-1.0 * x) / B;
	double tmp;
	if (x <= -5.5e-57) {
		tmp = t_0;
	} else if (x <= 1.5e-291) {
		tmp = -1.0 / B;
	} else if (x <= 1.8e-123) {
		tmp = 1.0 / B;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 * x) / B
	tmp = 0
	if x <= -5.5e-57:
		tmp = t_0
	elif x <= 1.5e-291:
		tmp = -1.0 / B
	elif x <= 1.8e-123:
		tmp = 1.0 / B
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 * x) / B)
	tmp = 0.0
	if (x <= -5.5e-57)
		tmp = t_0;
	elseif (x <= 1.5e-291)
		tmp = Float64(-1.0 / B);
	elseif (x <= 1.8e-123)
		tmp = Float64(1.0 / B);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (-1.0 * x) / B;
	tmp = 0.0;
	if (x <= -5.5e-57)
		tmp = t_0;
	elseif (x <= 1.5e-291)
		tmp = -1.0 / B;
	elseif (x <= 1.8e-123)
		tmp = 1.0 / B;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[x, -5.5e-57], t$95$0, If[LessEqual[x, 1.5e-291], N[(-1.0 / B), $MachinePrecision], If[LessEqual[x, 1.8e-123], N[(1.0 / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-1 \cdot x}{B}\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{-57}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-291}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{-123}:\\
\;\;\;\;\frac{1}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.50000000000000011e-57 or 1.7999999999999998e-123 < x

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{-1 \cdot x}{B} \]
    6. Step-by-step derivation
      1. lower-*.f6429.6

        \[\leadsto \frac{-1 \cdot x}{B} \]
    7. Applied rewrites29.6%

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

    if -5.50000000000000011e-57 < x < 1.5e-291

    1. Initial program 76.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.f6417.8

        \[\leadsto \frac{-1}{\sin B} \]
    4. Applied rewrites17.8%

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

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

        \[\leadsto \frac{-1}{B} \]
    7. Applied rewrites10.4%

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

    if 1.5e-291 < x < 1.7999999999999998e-123

    1. Initial program 76.2%

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

      \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

      \[\leadsto \frac{1}{B} \]
    6. Step-by-step derivation
      1. Applied rewrites10.2%

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

    Alternative 22: 17.8% accurate, 14.2× speedup?

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

      1. Initial program 76.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.f6417.8

          \[\leadsto \frac{-1}{\sin B} \]
      4. Applied rewrites17.8%

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

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

          \[\leadsto \frac{-1}{B} \]
      7. Applied rewrites10.4%

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

      if 1e-27 < F

      1. Initial program 76.2%

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

        \[\leadsto \color{blue}{\frac{F \cdot {\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 rewrites43.9%

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

        \[\leadsto \frac{1}{B} \]
      6. Step-by-step derivation
        1. Applied rewrites10.2%

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

      Alternative 23: 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.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.f6417.8

          \[\leadsto \frac{-1}{\sin B} \]
      4. Applied rewrites17.8%

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

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

          \[\leadsto \frac{-1}{B} \]
      7. Applied rewrites10.4%

        \[\leadsto \frac{-1}{\color{blue}{B}} \]
      8. Add Preprocessing

      Reproduce

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