Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 22.9s
Alternatives: 12
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
   (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / tan(t)));
	return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((eh / ew) / tan(t)))
    code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
	return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((eh / ew) / math.tan(t)))
	return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh / ew) / tan(t)))
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((eh / ew) / tan(t)));
	tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\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 12 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
   (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh / ew) / tan(t)));
	return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
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(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((eh / ew) / tan(t)))
    code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
	return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((eh / ew) / math.tan(t)))
	return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh / ew) / tan(t)))
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((eh / ew) / tan(t)));
	tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\\ \left|\mathsf{fma}\left(\cos t \cdot eh, \tanh t\_1, \frac{\sin t}{\cosh t\_1} \cdot ew\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (asinh (/ eh (* (tan t) ew)))))
   (fabs (fma (* (cos t) eh) (tanh t_1) (* (/ (sin t) (cosh t_1)) ew)))))
double code(double eh, double ew, double t) {
	double t_1 = asinh((eh / (tan(t) * ew)));
	return fabs(fma((cos(t) * eh), tanh(t_1), ((sin(t) / cosh(t_1)) * ew)));
}
function code(eh, ew, t)
	t_1 = asinh(Float64(eh / Float64(tan(t) * ew)))
	return abs(fma(Float64(cos(t) * eh), tanh(t_1), Float64(Float64(sin(t) / cosh(t_1)) * ew)))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Tanh[t$95$1], $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\\
\left|\mathsf{fma}\left(\cos t \cdot eh, \tanh t\_1, \frac{\sin t}{\cosh t\_1} \cdot ew\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Applied rewrites99.8%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)}\right| \]
  3. Taylor expanded in t around inf

    \[\leadsto \left|\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\color{blue}{\sin t}}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)\right| \]
  4. Step-by-step derivation
    1. lift-sin.f6499.8

      \[\leadsto \left|\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\sin t}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)\right| \]
  5. Applied rewrites99.8%

    \[\leadsto \left|\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\color{blue}{\sin t}}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)\right| \]
  6. Add Preprocessing

Alternative 2: 89.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ t_2 := eh \cdot \cos t\\ t_3 := ew \cdot \sin t\\ t_4 := \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right)\\ \mathbf{if}\;ew \leq 4.4 \cdot 10^{-57}:\\ \;\;\;\;\left|t\_3 \cdot \cos t\_4 + t\_2 \cdot \sin t\_4\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(t\_3, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, t\_2 \cdot \tanh \sinh^{-1} t\_1\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ eh (* t ew)))
        (t_2 (* eh (cos t)))
        (t_3 (* ew (sin t)))
        (t_4 (atan (/ (/ (fma (* -0.3333333333333333 (* t t)) eh eh) ew) t))))
   (if (<= ew 4.4e-57)
     (fabs (+ (* t_3 (cos t_4)) (* t_2 (sin t_4))))
     (fabs
      (fma
       t_3
       (/ 1.0 (sqrt (+ 1.0 (* t_1 t_1))))
       (* t_2 (tanh (asinh t_1))))))))
double code(double eh, double ew, double t) {
	double t_1 = eh / (t * ew);
	double t_2 = eh * cos(t);
	double t_3 = ew * sin(t);
	double t_4 = atan(((fma((-0.3333333333333333 * (t * t)), eh, eh) / ew) / t));
	double tmp;
	if (ew <= 4.4e-57) {
		tmp = fabs(((t_3 * cos(t_4)) + (t_2 * sin(t_4))));
	} else {
		tmp = fabs(fma(t_3, (1.0 / sqrt((1.0 + (t_1 * t_1)))), (t_2 * tanh(asinh(t_1)))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(eh / Float64(t * ew))
	t_2 = Float64(eh * cos(t))
	t_3 = Float64(ew * sin(t))
	t_4 = atan(Float64(Float64(fma(Float64(-0.3333333333333333 * Float64(t * t)), eh, eh) / ew) / t))
	tmp = 0.0
	if (ew <= 4.4e-57)
		tmp = abs(Float64(Float64(t_3 * cos(t_4)) + Float64(t_2 * sin(t_4))));
	else
		tmp = abs(fma(t_3, Float64(1.0 / sqrt(Float64(1.0 + Float64(t_1 * t_1)))), Float64(t_2 * tanh(asinh(t_1)))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[(N[(N[(-0.3333333333333333 * N[(t * t), $MachinePrecision]), $MachinePrecision] * eh + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, 4.4e-57], N[Abs[N[(N[(t$95$3 * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$3 * N[(1.0 / N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
t_2 := eh \cdot \cos t\\
t_3 := ew \cdot \sin t\\
t_4 := \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right)\\
\mathbf{if}\;ew \leq 4.4 \cdot 10^{-57}:\\
\;\;\;\;\left|t\_3 \cdot \cos t\_4 + t\_2 \cdot \sin t\_4\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(t\_3, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, t\_2 \cdot \tanh \sinh^{-1} t\_1\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < 4.39999999999999997e-57

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{\color{blue}{t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. associate-*r/N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left(eh \cdot {t}^{2}\right)}{ew} + \frac{eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      3. div-add-revN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left(eh \cdot {t}^{2}\right) + eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left(eh \cdot {t}^{2}\right) + eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      5. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left({t}^{2} \cdot eh\right) + eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      6. associate-*r*N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\left(\frac{-1}{3} \cdot {t}^{2}\right) \cdot eh + eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {t}^{2}\right) \cdot eh + eh}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      8. lower-fma.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {t}^{2}, eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      9. metadata-evalN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot {t}^{2}, eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      10. lower-*.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot {t}^{2}, eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      11. unpow2N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      12. lower-*.f6486.6

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Applied rewrites86.6%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{\color{blue}{t}}\right)\right| \]
      2. associate-*r/N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left(eh \cdot {t}^{2}\right)}{ew} + \frac{eh}{ew}}{t}\right)\right| \]
      3. div-add-revN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left(eh \cdot {t}^{2}\right) + eh}{ew}}{t}\right)\right| \]
      4. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left(eh \cdot {t}^{2}\right) + eh}{ew}}{t}\right)\right| \]
      5. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\frac{-1}{3} \cdot \left({t}^{2} \cdot eh\right) + eh}{ew}}{t}\right)\right| \]
      6. associate-*r*N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\left(\frac{-1}{3} \cdot {t}^{2}\right) \cdot eh + eh}{ew}}{t}\right)\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {t}^{2}\right) \cdot eh + eh}{ew}}{t}\right)\right| \]
      8. lower-fma.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {t}^{2}, eh, eh\right)}{ew}}{t}\right)\right| \]
      9. metadata-evalN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot {t}^{2}, eh, eh\right)}{ew}}{t}\right)\right| \]
      10. lower-*.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot {t}^{2}, eh, eh\right)}{ew}}{t}\right)\right| \]
      11. unpow2N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3} \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right)\right| \]
      12. lower-*.f6486.6

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right)\right| \]
    7. Applied rewrites86.6%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot \left(t \cdot t\right), eh, eh\right)}{ew}}{t}\right)}\right| \]

    if 4.39999999999999997e-57 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      3. lower-*.f6499.0

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Applied rewrites99.0%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
      3. lower-*.f6490.8

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
    7. Applied rewrites90.8%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
    8. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
      2. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      3. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      4. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      5. lower-fma.f64N/A

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
    9. Applied rewrites75.3%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      2. lift-sqrt.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\color{blue}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      3. lift-+.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{\color{blue}{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      4. lift-*.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \color{blue}{\frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      5. tanh-asinh-revN/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
      6. lower-tanh.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
    11. Applied rewrites90.8%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{\left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 87.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ \mathbf{if}\;ew \leq 10^{-180}:\\ \;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\cos t \cdot \frac{eh}{\sin t \cdot ew}\right) \cdot \cos t\right) \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ eh (* t ew))))
   (if (<= ew 1e-180)
     (fabs (* (* (tanh (asinh (* (cos t) (/ eh (* (sin t) ew))))) (cos t)) eh))
     (fabs
      (fma
       (* ew (sin t))
       (/ 1.0 (sqrt (+ 1.0 (* t_1 t_1))))
       (* (* eh (cos t)) (tanh (asinh t_1))))))))
double code(double eh, double ew, double t) {
	double t_1 = eh / (t * ew);
	double tmp;
	if (ew <= 1e-180) {
		tmp = fabs(((tanh(asinh((cos(t) * (eh / (sin(t) * ew))))) * cos(t)) * eh));
	} else {
		tmp = fabs(fma((ew * sin(t)), (1.0 / sqrt((1.0 + (t_1 * t_1)))), ((eh * cos(t)) * tanh(asinh(t_1)))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(eh / Float64(t * ew))
	tmp = 0.0
	if (ew <= 1e-180)
		tmp = abs(Float64(Float64(tanh(asinh(Float64(cos(t) * Float64(eh / Float64(sin(t) * ew))))) * cos(t)) * eh));
	else
		tmp = abs(fma(Float64(ew * sin(t)), Float64(1.0 / sqrt(Float64(1.0 + Float64(t_1 * t_1)))), Float64(Float64(eh * cos(t)) * tanh(asinh(t_1)))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 1e-180], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(N[Cos[t], $MachinePrecision] * N[(eh / N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\mathbf{if}\;ew \leq 10^{-180}:\\
\;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\cos t \cdot \frac{eh}{\sin t \cdot ew}\right) \cdot \cos t\right) \cdot eh\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < 1e-180

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Taylor expanded in eh around inf

      \[\leadsto \left|\color{blue}{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right)}\right| \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left|\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right) \cdot \color{blue}{eh}\right| \]
      2. lower-*.f64N/A

        \[\leadsto \left|\left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)\right) \cdot \color{blue}{eh}\right| \]
    4. Applied rewrites66.3%

      \[\leadsto \left|\color{blue}{\left(\tanh \sinh^{-1} \left(\cos t \cdot \frac{eh}{\sin t \cdot ew}\right) \cdot \cos t\right) \cdot eh}\right| \]

    if 1e-180 < ew

    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      3. lower-*.f6499.0

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Applied rewrites99.0%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
      3. lower-*.f6490.4

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
    7. Applied rewrites90.4%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
    8. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
      2. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      3. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      4. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      5. lower-fma.f64N/A

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
    9. Applied rewrites66.0%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      2. lift-sqrt.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\color{blue}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      3. lift-+.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{\color{blue}{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      4. lift-*.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \color{blue}{\frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      5. tanh-asinh-revN/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
      6. lower-tanh.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
    11. Applied rewrites90.4%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{\left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 76.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ eh (* t ew))))
   (fabs
    (fma
     (* ew (sin t))
     (/ 1.0 (sqrt (+ 1.0 (* t_1 t_1))))
     (* (* eh (cos t)) (tanh (asinh t_1)))))))
double code(double eh, double ew, double t) {
	double t_1 = eh / (t * ew);
	return fabs(fma((ew * sin(t)), (1.0 / sqrt((1.0 + (t_1 * t_1)))), ((eh * cos(t)) * tanh(asinh(t_1)))));
}
function code(eh, ew, t)
	t_1 = Float64(eh / Float64(t * ew))
	return abs(fma(Float64(ew * sin(t)), Float64(1.0 / sqrt(Float64(1.0 + Float64(t_1 * t_1)))), Float64(Float64(eh * cos(t)) * tanh(asinh(t_1)))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Taylor expanded in t around 0

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  3. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. *-commutativeN/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. lower-*.f6499.0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  4. Applied rewrites99.0%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  5. Taylor expanded in t around 0

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
  6. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
    2. *-commutativeN/A

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
    3. lower-*.f6489.7

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
  7. Applied rewrites89.7%

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
  8. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
    2. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
    3. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
    4. lift-sin.f64N/A

      \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
    5. lower-fma.f64N/A

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
  9. Applied rewrites57.5%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
  10. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
    2. lift-sqrt.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\color{blue}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
    3. lift-+.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{\color{blue}{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
    4. lift-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \color{blue}{\frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
    5. tanh-asinh-revN/A

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
    6. lower-tanh.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
  11. Applied rewrites89.7%

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{\left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
  12. Add Preprocessing

Alternative 5: 74.4% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ t_2 := eh \cdot \cos t\\ t_3 := \sqrt{1 + t\_1 \cdot t\_1}\\ \mathbf{if}\;t \leq 1600:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{t\_3}, t\_2 \cdot \tanh \sinh^{-1} t\_1\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, 1, t\_2 \cdot \frac{t\_1}{t\_3}\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ eh (* t ew)))
        (t_2 (* eh (cos t)))
        (t_3 (sqrt (+ 1.0 (* t_1 t_1)))))
   (if (<= t 1600.0)
     (fabs (fma (* ew t) (/ 1.0 t_3) (* t_2 (tanh (asinh t_1)))))
     (fabs (fma (* ew (sin t)) 1.0 (* t_2 (/ t_1 t_3)))))))
double code(double eh, double ew, double t) {
	double t_1 = eh / (t * ew);
	double t_2 = eh * cos(t);
	double t_3 = sqrt((1.0 + (t_1 * t_1)));
	double tmp;
	if (t <= 1600.0) {
		tmp = fabs(fma((ew * t), (1.0 / t_3), (t_2 * tanh(asinh(t_1)))));
	} else {
		tmp = fabs(fma((ew * sin(t)), 1.0, (t_2 * (t_1 / t_3))));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(eh / Float64(t * ew))
	t_2 = Float64(eh * cos(t))
	t_3 = sqrt(Float64(1.0 + Float64(t_1 * t_1)))
	tmp = 0.0
	if (t <= 1600.0)
		tmp = abs(fma(Float64(ew * t), Float64(1.0 / t_3), Float64(t_2 * tanh(asinh(t_1)))));
	else
		tmp = abs(fma(Float64(ew * sin(t)), 1.0, Float64(t_2 * Float64(t_1 / t_3))));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1600.0], N[Abs[N[(N[(ew * t), $MachinePrecision] * N[(1.0 / t$95$3), $MachinePrecision] + N[(t$95$2 * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * 1.0 + N[(t$95$2 * N[(t$95$1 / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
t_2 := eh \cdot \cos t\\
t_3 := \sqrt{1 + t\_1 \cdot t\_1}\\
\mathbf{if}\;t \leq 1600:\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{t\_3}, t\_2 \cdot \tanh \sinh^{-1} t\_1\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, 1, t\_2 \cdot \frac{t\_1}{t\_3}\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1600

    1. Initial program 99.9%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      3. lower-*.f6499.3

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    4. Applied rewrites99.3%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    5. Taylor expanded in t around 0

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
      2. *-commutativeN/A

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
      3. lower-*.f6493.1

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
    7. Applied rewrites93.1%

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
    8. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
      2. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      3. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      4. lift-sin.f64N/A

        \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
      5. lower-fma.f64N/A

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
    9. Applied rewrites54.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      2. lift-sqrt.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\color{blue}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      3. lift-+.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{\color{blue}{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      4. lift-*.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \color{blue}{\frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
      5. tanh-asinh-revN/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
      6. lower-tanh.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
    11. Applied rewrites93.1%

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{\left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
    12. Taylor expanded in t around 0

      \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right| \]
    13. Step-by-step derivation
      1. Applied rewrites77.2%

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right| \]

      if 1600 < t

      1. Initial program 99.6%

        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. Taylor expanded in t around 0

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        2. *-commutativeN/A

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        3. lower-*.f6498.0

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      4. Applied rewrites98.0%

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      5. Taylor expanded in t around 0

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
        2. *-commutativeN/A

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
        3. lower-*.f6479.0

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
      7. Applied rewrites79.0%

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
      8. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
        2. lift-*.f64N/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
        3. lift-*.f64N/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
        4. lift-sin.f64N/A

          \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
        5. lower-fma.f64N/A

          \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
      9. Applied rewrites65.6%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
      10. Taylor expanded in eh around 0

        \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{1}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
      11. Step-by-step derivation
        1. Applied rewrites65.7%

          \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{1}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
      12. Recombined 2 regimes into one program.
      13. Add Preprocessing

      Alternative 6: 63.8% accurate, 2.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ t_2 := \sqrt{1 + t\_1 \cdot t\_1}\\ t_3 := \frac{1}{t\_2}\\ \mathbf{if}\;eh \leq 9.5 \cdot 10^{-34}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, t\_3, eh \cdot \frac{t\_1}{t\_2}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, t\_3, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (/ eh (* t ew)))
              (t_2 (sqrt (+ 1.0 (* t_1 t_1))))
              (t_3 (/ 1.0 t_2)))
         (if (<= eh 9.5e-34)
           (fabs (fma (* ew (sin t)) t_3 (* eh (/ t_1 t_2))))
           (fabs (fma (* ew t) t_3 (* (* eh (cos t)) (tanh (asinh t_1))))))))
      double code(double eh, double ew, double t) {
      	double t_1 = eh / (t * ew);
      	double t_2 = sqrt((1.0 + (t_1 * t_1)));
      	double t_3 = 1.0 / t_2;
      	double tmp;
      	if (eh <= 9.5e-34) {
      		tmp = fabs(fma((ew * sin(t)), t_3, (eh * (t_1 / t_2))));
      	} else {
      		tmp = fabs(fma((ew * t), t_3, ((eh * cos(t)) * tanh(asinh(t_1)))));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	t_1 = Float64(eh / Float64(t * ew))
      	t_2 = sqrt(Float64(1.0 + Float64(t_1 * t_1)))
      	t_3 = Float64(1.0 / t_2)
      	tmp = 0.0
      	if (eh <= 9.5e-34)
      		tmp = abs(fma(Float64(ew * sin(t)), t_3, Float64(eh * Float64(t_1 / t_2))));
      	else
      		tmp = abs(fma(Float64(ew * t), t_3, Float64(Float64(eh * cos(t)) * tanh(asinh(t_1)))));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / t$95$2), $MachinePrecision]}, If[LessEqual[eh, 9.5e-34], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$3 + N[(eh * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * t), $MachinePrecision] * t$95$3 + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{eh}{t \cdot ew}\\
      t_2 := \sqrt{1 + t\_1 \cdot t\_1}\\
      t_3 := \frac{1}{t\_2}\\
      \mathbf{if}\;eh \leq 9.5 \cdot 10^{-34}:\\
      \;\;\;\;\left|\mathsf{fma}\left(ew \cdot \sin t, t\_3, eh \cdot \frac{t\_1}{t\_2}\right)\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, t\_3, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if eh < 9.49999999999999985e-34

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        2. Taylor expanded in t around 0

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          2. *-commutativeN/A

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          3. lower-*.f6499.0

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        4. Applied rewrites99.0%

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        5. Taylor expanded in t around 0

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
        6. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
          2. *-commutativeN/A

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
          3. lower-*.f6490.5

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
        7. Applied rewrites90.5%

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
        8. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
          2. lift-*.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
          3. lift-*.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
          4. lift-sin.f64N/A

            \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
          5. lower-fma.f64N/A

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
        9. Applied rewrites64.2%

          \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
        10. Taylor expanded in t around 0

          \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{eh} \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
        11. Step-by-step derivation
          1. Applied rewrites59.6%

            \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{eh} \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]

          if 9.49999999999999985e-34 < eh

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          2. Taylor expanded in t around 0

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. *-commutativeN/A

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            3. lower-*.f6498.9

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          4. Applied rewrites98.9%

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          5. Taylor expanded in t around 0

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
          6. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
            2. *-commutativeN/A

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
            3. lower-*.f6487.7

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
          7. Applied rewrites87.7%

            \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
          8. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
            2. lift-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
            3. lift-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
            4. lift-sin.f64N/A

              \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
            5. lower-fma.f64N/A

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
          9. Applied rewrites39.9%

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
          10. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
            2. lift-sqrt.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\color{blue}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
            3. lift-+.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{\color{blue}{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
            4. lift-*.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \color{blue}{\frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
            5. tanh-asinh-revN/A

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
            6. lower-tanh.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
          11. Applied rewrites87.7%

            \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{\left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
          12. Taylor expanded in t around 0

            \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right| \]
          13. Step-by-step derivation
            1. Applied rewrites74.7%

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right| \]
          14. Recombined 2 regimes into one program.
          15. Add Preprocessing

          Alternative 7: 57.9% accurate, 2.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ \mathbf{if}\;eh \leq 1.68 \cdot 10^{-106}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (let* ((t_1 (/ eh (* t ew))))
             (if (<= eh 1.68e-106)
               (fabs (* ew (sin t)))
               (fabs
                (fma
                 (* ew t)
                 (/ 1.0 (sqrt (+ 1.0 (* t_1 t_1))))
                 (* (* eh (cos t)) (tanh (asinh t_1))))))))
          double code(double eh, double ew, double t) {
          	double t_1 = eh / (t * ew);
          	double tmp;
          	if (eh <= 1.68e-106) {
          		tmp = fabs((ew * sin(t)));
          	} else {
          		tmp = fabs(fma((ew * t), (1.0 / sqrt((1.0 + (t_1 * t_1)))), ((eh * cos(t)) * tanh(asinh(t_1)))));
          	}
          	return tmp;
          }
          
          function code(eh, ew, t)
          	t_1 = Float64(eh / Float64(t * ew))
          	tmp = 0.0
          	if (eh <= 1.68e-106)
          		tmp = abs(Float64(ew * sin(t)));
          	else
          		tmp = abs(fma(Float64(ew * t), Float64(1.0 / sqrt(Float64(1.0 + Float64(t_1 * t_1)))), Float64(Float64(eh * cos(t)) * tanh(asinh(t_1)))));
          	end
          	return tmp
          end
          
          code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, 1.68e-106], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * t), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \frac{eh}{t \cdot ew}\\
          \mathbf{if}\;eh \leq 1.68 \cdot 10^{-106}:\\
          \;\;\;\;\left|ew \cdot \sin t\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if eh < 1.6799999999999999e-106

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. Applied rewrites99.8%

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)}\right| \]
            3. Taylor expanded in eh around 0

              \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
            4. Step-by-step derivation
              1. lift-sin.f64N/A

                \[\leadsto \left|ew \cdot \sin t\right| \]
              2. lift-*.f6450.5

                \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
            5. Applied rewrites50.5%

              \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]

            if 1.6799999999999999e-106 < eh

            1. Initial program 99.8%

              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. Taylor expanded in t around 0

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. *-commutativeN/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. lower-*.f6498.9

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            4. Applied rewrites98.9%

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            5. Taylor expanded in t around 0

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
              2. *-commutativeN/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              3. lower-*.f6487.6

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
            7. Applied rewrites87.6%

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
            8. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
              2. lift-*.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
              3. lift-*.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
              4. lift-sin.f64N/A

                \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
              5. lower-fma.f64N/A

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
            9. Applied rewrites44.6%

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
            10. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
              2. lift-sqrt.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\color{blue}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
              3. lift-+.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{\color{blue}{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
              4. lift-*.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \color{blue}{\frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}}\right)\right| \]
              5. tanh-asinh-revN/A

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
              6. lower-tanh.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \color{blue}{\tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
            11. Applied rewrites87.6%

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \color{blue}{\left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right)\right| \]
            12. Taylor expanded in t around 0

              \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right| \]
            13. Step-by-step derivation
              1. Applied rewrites72.3%

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)\right| \]
            14. Recombined 2 regimes into one program.
            15. Add Preprocessing

            Alternative 8: 52.5% accurate, 2.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ t_2 := \sqrt{1 + t\_1 \cdot t\_1}\\ \mathbf{if}\;t \leq 7.6 \cdot 10^{-65}:\\ \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\ \mathbf{elif}\;t \leq 0.00048:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{t\_2}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.041666666666666664 \cdot \left(t \cdot t\right) - 0.5\right)\right)\right) \cdot \frac{t\_1}{t\_2}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (let* ((t_1 (/ eh (* t ew))) (t_2 (sqrt (+ 1.0 (* t_1 t_1)))))
               (if (<= t 7.6e-65)
                 (fabs (/ eh (* ew (/ 1.0 ew))))
                 (if (<= t 0.00048)
                   (fabs
                    (fma
                     (* ew t)
                     (/ 1.0 t_2)
                     (*
                      (* eh (+ 1.0 (* (* t t) (- (* 0.041666666666666664 (* t t)) 0.5))))
                      (/ t_1 t_2))))
                   (fabs (* ew (sin t)))))))
            double code(double eh, double ew, double t) {
            	double t_1 = eh / (t * ew);
            	double t_2 = sqrt((1.0 + (t_1 * t_1)));
            	double tmp;
            	if (t <= 7.6e-65) {
            		tmp = fabs((eh / (ew * (1.0 / ew))));
            	} else if (t <= 0.00048) {
            		tmp = fabs(fma((ew * t), (1.0 / t_2), ((eh * (1.0 + ((t * t) * ((0.041666666666666664 * (t * t)) - 0.5)))) * (t_1 / t_2))));
            	} else {
            		tmp = fabs((ew * sin(t)));
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	t_1 = Float64(eh / Float64(t * ew))
            	t_2 = sqrt(Float64(1.0 + Float64(t_1 * t_1)))
            	tmp = 0.0
            	if (t <= 7.6e-65)
            		tmp = abs(Float64(eh / Float64(ew * Float64(1.0 / ew))));
            	elseif (t <= 0.00048)
            		tmp = abs(fma(Float64(ew * t), Float64(1.0 / t_2), Float64(Float64(eh * Float64(1.0 + Float64(Float64(t * t) * Float64(Float64(0.041666666666666664 * Float64(t * t)) - 0.5)))) * Float64(t_1 / t_2))));
            	else
            		tmp = abs(Float64(ew * sin(t)));
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.6e-65], N[Abs[N[(eh / N[(ew * N[(1.0 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 0.00048], N[Abs[N[(N[(ew * t), $MachinePrecision] * N[(1.0 / t$95$2), $MachinePrecision] + N[(N[(eh * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(N[(0.041666666666666664 * N[(t * t), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \frac{eh}{t \cdot ew}\\
            t_2 := \sqrt{1 + t\_1 \cdot t\_1}\\
            \mathbf{if}\;t \leq 7.6 \cdot 10^{-65}:\\
            \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\
            
            \mathbf{elif}\;t \leq 0.00048:\\
            \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{t\_2}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.041666666666666664 \cdot \left(t \cdot t\right) - 0.5\right)\right)\right) \cdot \frac{t\_1}{t\_2}\right)\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|ew \cdot \sin t\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if t < 7.6000000000000003e-65

              1. Initial program 99.9%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                3. lower-*.f6499.2

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              4. Applied rewrites99.2%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
                3. lower-*.f6492.6

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              7. Applied rewrites92.6%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
                2. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                3. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                4. lift-sin.f64N/A

                  \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
              9. Applied rewrites53.7%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
              10. Taylor expanded in t around 0

                \[\leadsto \left|\color{blue}{\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
              11. Step-by-step derivation
                1. cos-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                2. sin-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                3. lower-/.f64N/A

                  \[\leadsto \left|\frac{{eh}^{2}}{\color{blue}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                4. unpow2N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                5. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                6. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \color{blue}{\sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                7. lower-sqrt.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              12. Applied rewrites13.6%

                \[\leadsto \left|\color{blue}{\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{eh \cdot eh}{ew \cdot ew}}}}\right| \]
              13. Taylor expanded in eh around 0

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
              14. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \color{blue}{\sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
                2. pow-flipN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{\left(\mathsf{neg}\left(2\right)\right)}}}\right| \]
                3. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{-2}}}\right| \]
                4. sqrt-pow1N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{\left(\frac{-2}{\color{blue}{2}}\right)}}\right| \]
                5. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{-1}}\right| \]
                6. inv-powN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
                7. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{\color{blue}{ew}}}\right| \]
                8. lower-/.f6451.4

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
              15. Applied rewrites51.4%

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \frac{1}{ew}}}\right| \]

              if 7.6000000000000003e-65 < t < 4.80000000000000012e-4

              1. Initial program 100.0%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                3. lower-*.f6499.9

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              4. Applied rewrites99.9%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
                3. lower-*.f64100.0

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              7. Applied rewrites100.0%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
                2. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                3. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                4. lift-sin.f64N/A

                  \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
              9. Applied rewrites68.9%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
              10. Taylor expanded in t around 0

                \[\leadsto \left|\mathsf{fma}\left(\color{blue}{ew \cdot t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              11. Step-by-step derivation
                1. lift-*.f6468.1

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              12. Applied rewrites68.1%

                \[\leadsto \left|\mathsf{fma}\left(\color{blue}{ew \cdot t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              13. Taylor expanded in t around 0

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \color{blue}{\left(1 + {t}^{2} \cdot \left(\frac{1}{24} \cdot {t}^{2} - \frac{1}{2}\right)\right)}\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              14. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \color{blue}{{t}^{2} \cdot \left(\frac{1}{24} \cdot {t}^{2} - \frac{1}{2}\right)}\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                2. lower-*.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + {t}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot {t}^{2} - \frac{1}{2}\right)}\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                3. unpow2N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {t}^{2}} - \frac{1}{2}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                4. lower-*.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\color{blue}{\frac{1}{24} \cdot {t}^{2}} - \frac{1}{2}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                5. lower--.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\frac{1}{24} \cdot {t}^{2} - \color{blue}{\frac{1}{2}}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                6. lower-*.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\frac{1}{24} \cdot {t}^{2} - \frac{1}{2}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                7. unpow2N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\frac{1}{24} \cdot \left(t \cdot t\right) - \frac{1}{2}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                8. lower-*.f6468.1

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.041666666666666664 \cdot \left(t \cdot t\right) - 0.5\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              15. Applied rewrites68.1%

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \color{blue}{\left(1 + \left(t \cdot t\right) \cdot \left(0.041666666666666664 \cdot \left(t \cdot t\right) - 0.5\right)\right)}\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]

              if 4.80000000000000012e-4 < t

              1. Initial program 99.6%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Applied rewrites99.6%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)}\right| \]
              3. Taylor expanded in eh around 0

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              4. Step-by-step derivation
                1. lift-sin.f64N/A

                  \[\leadsto \left|ew \cdot \sin t\right| \]
                2. lift-*.f6452.4

                  \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
              5. Applied rewrites52.4%

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 9: 52.5% accurate, 2.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh}{t \cdot ew}\\ t_2 := \sqrt{1 + t\_1 \cdot t\_1}\\ \mathbf{if}\;t \leq 7.6 \cdot 10^{-65}:\\ \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\ \mathbf{elif}\;t \leq 0.00035:\\ \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{t\_2}, \left(eh \cdot \left(1 - 0.5 \cdot \left(t \cdot t\right)\right)\right) \cdot \frac{t\_1}{t\_2}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (let* ((t_1 (/ eh (* t ew))) (t_2 (sqrt (+ 1.0 (* t_1 t_1)))))
               (if (<= t 7.6e-65)
                 (fabs (/ eh (* ew (/ 1.0 ew))))
                 (if (<= t 0.00035)
                   (fabs
                    (fma
                     (* ew t)
                     (/ 1.0 t_2)
                     (* (* eh (- 1.0 (* 0.5 (* t t)))) (/ t_1 t_2))))
                   (fabs (* ew (sin t)))))))
            double code(double eh, double ew, double t) {
            	double t_1 = eh / (t * ew);
            	double t_2 = sqrt((1.0 + (t_1 * t_1)));
            	double tmp;
            	if (t <= 7.6e-65) {
            		tmp = fabs((eh / (ew * (1.0 / ew))));
            	} else if (t <= 0.00035) {
            		tmp = fabs(fma((ew * t), (1.0 / t_2), ((eh * (1.0 - (0.5 * (t * t)))) * (t_1 / t_2))));
            	} else {
            		tmp = fabs((ew * sin(t)));
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	t_1 = Float64(eh / Float64(t * ew))
            	t_2 = sqrt(Float64(1.0 + Float64(t_1 * t_1)))
            	tmp = 0.0
            	if (t <= 7.6e-65)
            		tmp = abs(Float64(eh / Float64(ew * Float64(1.0 / ew))));
            	elseif (t <= 0.00035)
            		tmp = abs(fma(Float64(ew * t), Float64(1.0 / t_2), Float64(Float64(eh * Float64(1.0 - Float64(0.5 * Float64(t * t)))) * Float64(t_1 / t_2))));
            	else
            		tmp = abs(Float64(ew * sin(t)));
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.6e-65], N[Abs[N[(eh / N[(ew * N[(1.0 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 0.00035], N[Abs[N[(N[(ew * t), $MachinePrecision] * N[(1.0 / t$95$2), $MachinePrecision] + N[(N[(eh * N[(1.0 - N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \frac{eh}{t \cdot ew}\\
            t_2 := \sqrt{1 + t\_1 \cdot t\_1}\\
            \mathbf{if}\;t \leq 7.6 \cdot 10^{-65}:\\
            \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\
            
            \mathbf{elif}\;t \leq 0.00035:\\
            \;\;\;\;\left|\mathsf{fma}\left(ew \cdot t, \frac{1}{t\_2}, \left(eh \cdot \left(1 - 0.5 \cdot \left(t \cdot t\right)\right)\right) \cdot \frac{t\_1}{t\_2}\right)\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|ew \cdot \sin t\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if t < 7.6000000000000003e-65

              1. Initial program 99.9%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                3. lower-*.f6499.2

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              4. Applied rewrites99.2%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
                3. lower-*.f6492.6

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              7. Applied rewrites92.6%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
                2. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                3. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                4. lift-sin.f64N/A

                  \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
              9. Applied rewrites53.7%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
              10. Taylor expanded in t around 0

                \[\leadsto \left|\color{blue}{\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
              11. Step-by-step derivation
                1. cos-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                2. sin-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                3. lower-/.f64N/A

                  \[\leadsto \left|\frac{{eh}^{2}}{\color{blue}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                4. unpow2N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                5. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                6. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \color{blue}{\sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                7. lower-sqrt.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              12. Applied rewrites13.6%

                \[\leadsto \left|\color{blue}{\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{eh \cdot eh}{ew \cdot ew}}}}\right| \]
              13. Taylor expanded in eh around 0

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
              14. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \color{blue}{\sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
                2. pow-flipN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{\left(\mathsf{neg}\left(2\right)\right)}}}\right| \]
                3. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{-2}}}\right| \]
                4. sqrt-pow1N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{\left(\frac{-2}{\color{blue}{2}}\right)}}\right| \]
                5. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{-1}}\right| \]
                6. inv-powN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
                7. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{\color{blue}{ew}}}\right| \]
                8. lower-/.f6451.4

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
              15. Applied rewrites51.4%

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \frac{1}{ew}}}\right| \]

              if 7.6000000000000003e-65 < t < 3.49999999999999996e-4

              1. Initial program 100.0%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                3. lower-*.f6499.9

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              4. Applied rewrites99.9%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
                3. lower-*.f64100.0

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              7. Applied rewrites100.0%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
                2. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                3. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                4. lift-sin.f64N/A

                  \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
              9. Applied rewrites68.9%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
              10. Taylor expanded in t around 0

                \[\leadsto \left|\mathsf{fma}\left(\color{blue}{ew \cdot t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              11. Step-by-step derivation
                1. lift-*.f6468.1

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot \color{blue}{t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              12. Applied rewrites68.1%

                \[\leadsto \left|\mathsf{fma}\left(\color{blue}{ew \cdot t}, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              13. Taylor expanded in t around 0

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \color{blue}{\left(1 + \frac{-1}{2} \cdot {t}^{2}\right)}\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              14. Step-by-step derivation
                1. fp-cancel-sign-sub-invN/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 - \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot {t}^{2}}\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                2. lower--.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 - \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot {t}^{2}}\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                3. metadata-evalN/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 - \frac{1}{2} \cdot {\color{blue}{t}}^{2}\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                4. lower-*.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 - \frac{1}{2} \cdot \color{blue}{{t}^{2}}\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                5. unpow2N/A

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 - \frac{1}{2} \cdot \left(t \cdot \color{blue}{t}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
                6. lower-*.f6468.1

                  \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \left(1 - 0.5 \cdot \left(t \cdot \color{blue}{t}\right)\right)\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]
              15. Applied rewrites68.1%

                \[\leadsto \left|\mathsf{fma}\left(ew \cdot t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \color{blue}{\left(1 - 0.5 \cdot \left(t \cdot t\right)\right)}\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)\right| \]

              if 3.49999999999999996e-4 < t

              1. Initial program 99.6%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Applied rewrites99.6%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)}\right| \]
              3. Taylor expanded in eh around 0

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              4. Step-by-step derivation
                1. lift-sin.f64N/A

                  \[\leadsto \left|ew \cdot \sin t\right| \]
                2. lift-*.f6452.4

                  \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
              5. Applied rewrites52.4%

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 10: 51.7% accurate, 6.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 0.00016:\\ \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (<= t 0.00016) (fabs (/ eh (* ew (/ 1.0 ew)))) (fabs (* ew (sin t)))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if (t <= 0.00016) {
            		tmp = fabs((eh / (ew * (1.0 / ew))));
            	} else {
            		tmp = fabs((ew * sin(t)));
            	}
            	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(eh, ew, t)
            use fmin_fmax_functions
                real(8), intent (in) :: eh
                real(8), intent (in) :: ew
                real(8), intent (in) :: t
                real(8) :: tmp
                if (t <= 0.00016d0) then
                    tmp = abs((eh / (ew * (1.0d0 / ew))))
                else
                    tmp = abs((ew * sin(t)))
                end if
                code = tmp
            end function
            
            public static double code(double eh, double ew, double t) {
            	double tmp;
            	if (t <= 0.00016) {
            		tmp = Math.abs((eh / (ew * (1.0 / ew))));
            	} else {
            		tmp = Math.abs((ew * Math.sin(t)));
            	}
            	return tmp;
            }
            
            def code(eh, ew, t):
            	tmp = 0
            	if t <= 0.00016:
            		tmp = math.fabs((eh / (ew * (1.0 / ew))))
            	else:
            		tmp = math.fabs((ew * math.sin(t)))
            	return tmp
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if (t <= 0.00016)
            		tmp = abs(Float64(eh / Float64(ew * Float64(1.0 / ew))));
            	else
            		tmp = abs(Float64(ew * sin(t)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(eh, ew, t)
            	tmp = 0.0;
            	if (t <= 0.00016)
            		tmp = abs((eh / (ew * (1.0 / ew))));
            	else
            		tmp = abs((ew * sin(t)));
            	end
            	tmp_2 = tmp;
            end
            
            code[eh_, ew_, t_] := If[LessEqual[t, 0.00016], N[Abs[N[(eh / N[(ew * N[(1.0 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;t \leq 0.00016:\\
            \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|ew \cdot \sin t\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if t < 1.60000000000000013e-4

              1. Initial program 99.9%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                3. lower-*.f6499.2

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              4. Applied rewrites99.2%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
                3. lower-*.f6493.1

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              7. Applied rewrites93.1%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
                2. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                3. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                4. lift-sin.f64N/A

                  \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
              9. Applied rewrites54.8%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
              10. Taylor expanded in t around 0

                \[\leadsto \left|\color{blue}{\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
              11. Step-by-step derivation
                1. cos-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                2. sin-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                3. lower-/.f64N/A

                  \[\leadsto \left|\frac{{eh}^{2}}{\color{blue}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                4. unpow2N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                5. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                6. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \color{blue}{\sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                7. lower-sqrt.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              12. Applied rewrites13.4%

                \[\leadsto \left|\color{blue}{\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{eh \cdot eh}{ew \cdot ew}}}}\right| \]
              13. Taylor expanded in eh around 0

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
              14. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \color{blue}{\sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
                2. pow-flipN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{\left(\mathsf{neg}\left(2\right)\right)}}}\right| \]
                3. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{-2}}}\right| \]
                4. sqrt-pow1N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{\left(\frac{-2}{\color{blue}{2}}\right)}}\right| \]
                5. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{-1}}\right| \]
                6. inv-powN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
                7. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{\color{blue}{ew}}}\right| \]
                8. lower-/.f6451.5

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
              15. Applied rewrites51.5%

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \frac{1}{ew}}}\right| \]

              if 1.60000000000000013e-4 < t

              1. Initial program 99.6%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Applied rewrites99.6%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\cos t \cdot eh, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right), \frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)} \cdot ew\right)}\right| \]
              3. Taylor expanded in eh around 0

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              4. Step-by-step derivation
                1. lift-sin.f64N/A

                  \[\leadsto \left|ew \cdot \sin t\right| \]
                2. lift-*.f6452.4

                  \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
              5. Applied rewrites52.4%

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 11: 42.1% accurate, 6.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 4.4 \cdot 10^{-56}:\\ \;\;\;\;ew \cdot \sin t\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (<= eh 4.4e-56) (* ew (sin t)) (fabs (/ eh (* ew (/ 1.0 ew))))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if (eh <= 4.4e-56) {
            		tmp = ew * sin(t);
            	} else {
            		tmp = fabs((eh / (ew * (1.0 / ew))));
            	}
            	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(eh, ew, t)
            use fmin_fmax_functions
                real(8), intent (in) :: eh
                real(8), intent (in) :: ew
                real(8), intent (in) :: t
                real(8) :: tmp
                if (eh <= 4.4d-56) then
                    tmp = ew * sin(t)
                else
                    tmp = abs((eh / (ew * (1.0d0 / ew))))
                end if
                code = tmp
            end function
            
            public static double code(double eh, double ew, double t) {
            	double tmp;
            	if (eh <= 4.4e-56) {
            		tmp = ew * Math.sin(t);
            	} else {
            		tmp = Math.abs((eh / (ew * (1.0 / ew))));
            	}
            	return tmp;
            }
            
            def code(eh, ew, t):
            	tmp = 0
            	if eh <= 4.4e-56:
            		tmp = ew * math.sin(t)
            	else:
            		tmp = math.fabs((eh / (ew * (1.0 / ew))))
            	return tmp
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if (eh <= 4.4e-56)
            		tmp = Float64(ew * sin(t));
            	else
            		tmp = abs(Float64(eh / Float64(ew * Float64(1.0 / ew))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(eh, ew, t)
            	tmp = 0.0;
            	if (eh <= 4.4e-56)
            		tmp = ew * sin(t);
            	else
            		tmp = abs((eh / (ew * (1.0 / ew))));
            	end
            	tmp_2 = tmp;
            end
            
            code[eh_, ew_, t_] := If[LessEqual[eh, 4.4e-56], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision], N[Abs[N[(eh / N[(ew * N[(1.0 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;eh \leq 4.4 \cdot 10^{-56}:\\
            \;\;\;\;ew \cdot \sin t\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if eh < 4.40000000000000008e-56

              1. Initial program 99.8%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Applied rewrites49.3%

                \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(\frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)}, ew, \left(\cos t \cdot eh\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{\sin t \cdot 1}{\cosh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)}, ew, \left(\cos t \cdot eh\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)}} \]
              3. Taylor expanded in ew around -inf

                \[\leadsto \color{blue}{{ew}^{2} \cdot \left(-1 \cdot \frac{-1 \cdot \frac{{eh}^{2} \cdot {\cos t}^{2}}{\sin t} + \frac{1}{2} \cdot \frac{{eh}^{2} \cdot {\cos t}^{2}}{\sin t}}{{ew}^{3}} + {\left(\sqrt{\frac{\sin t}{ew}}\right)}^{2}\right)} \]
              4. Step-by-step derivation
                1. rem-square-sqrtN/A

                  \[\leadsto \color{blue}{{ew}^{2}} \cdot \left(-1 \cdot \frac{-1 \cdot \frac{{eh}^{2} \cdot {\cos t}^{2}}{\sin t} + \frac{1}{2} \cdot \frac{{eh}^{2} \cdot {\cos t}^{2}}{\sin t}}{{ew}^{3}} + {\left(\sqrt{\frac{\sin t}{ew}}\right)}^{2}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto {ew}^{2} \cdot \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{{eh}^{2} \cdot {\cos t}^{2}}{\sin t} + \frac{1}{2} \cdot \frac{{eh}^{2} \cdot {\cos t}^{2}}{\sin t}}{{ew}^{3}} + {\left(\sqrt{\frac{\sin t}{ew}}\right)}^{2}\right)} \]
              5. Applied rewrites12.5%

                \[\leadsto \color{blue}{\left(ew \cdot ew\right) \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{{\left(eh \cdot \cos t\right)}^{2}}{\sin t}, 0.5 \cdot \frac{{\left(eh \cdot \cos t\right)}^{2}}{\sin t}\right)}{\left(ew \cdot ew\right) \cdot ew}, {\left(\frac{\sin t}{ew}\right)}^{1}\right)} \]
              6. Taylor expanded in eh around 0

                \[\leadsto \color{blue}{ew \cdot \sin t} \]
              7. Step-by-step derivation
                1. lift-sin.f64N/A

                  \[\leadsto ew \cdot \sin t \]
                2. lift-*.f6426.1

                  \[\leadsto ew \cdot \color{blue}{\sin t} \]
              8. Applied rewrites26.1%

                \[\leadsto \color{blue}{ew \cdot \sin t} \]

              if 4.40000000000000008e-56 < eh

              1. Initial program 99.8%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                3. lower-*.f6498.9

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              4. Applied rewrites98.9%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
                2. *-commutativeN/A

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
                3. lower-*.f6487.7

                  \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              7. Applied rewrites87.7%

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
                2. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                3. lift-*.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                4. lift-sin.f64N/A

                  \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
              9. Applied rewrites41.5%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
              10. Taylor expanded in t around 0

                \[\leadsto \left|\color{blue}{\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
              11. Step-by-step derivation
                1. cos-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                2. sin-atan-revN/A

                  \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                3. lower-/.f64N/A

                  \[\leadsto \left|\frac{{eh}^{2}}{\color{blue}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                4. unpow2N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                5. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
                6. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \color{blue}{\sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
                7. lower-sqrt.f64N/A

                  \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              12. Applied rewrites14.0%

                \[\leadsto \left|\color{blue}{\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{eh \cdot eh}{ew \cdot ew}}}}\right| \]
              13. Taylor expanded in eh around 0

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
              14. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \color{blue}{\sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
                2. pow-flipN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{\left(\mathsf{neg}\left(2\right)\right)}}}\right| \]
                3. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{-2}}}\right| \]
                4. sqrt-pow1N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{\left(\frac{-2}{\color{blue}{2}}\right)}}\right| \]
                5. metadata-evalN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{-1}}\right| \]
                6. inv-powN/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
                7. lower-*.f64N/A

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{\color{blue}{ew}}}\right| \]
                8. lower-/.f6452.9

                  \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
              15. Applied rewrites52.9%

                \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \frac{1}{ew}}}\right| \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 12: 34.1% accurate, 20.7× speedup?

            \[\begin{array}{l} \\ \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \end{array} \]
            (FPCore (eh ew t) :precision binary64 (fabs (/ eh (* ew (/ 1.0 ew)))))
            double code(double eh, double ew, double t) {
            	return fabs((eh / (ew * (1.0 / ew))));
            }
            
            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(eh, ew, t)
            use fmin_fmax_functions
                real(8), intent (in) :: eh
                real(8), intent (in) :: ew
                real(8), intent (in) :: t
                code = abs((eh / (ew * (1.0d0 / ew))))
            end function
            
            public static double code(double eh, double ew, double t) {
            	return Math.abs((eh / (ew * (1.0 / ew))));
            }
            
            def code(eh, ew, t):
            	return math.fabs((eh / (ew * (1.0 / ew))))
            
            function code(eh, ew, t)
            	return abs(Float64(eh / Float64(ew * Float64(1.0 / ew))))
            end
            
            function tmp = code(eh, ew, t)
            	tmp = abs((eh / (ew * (1.0 / ew))));
            end
            
            code[eh_, ew_, t_] := N[Abs[N[(eh / N[(ew * N[(1.0 / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right|
            \end{array}
            
            Derivation
            1. Initial program 99.8%

              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            2. Taylor expanded in t around 0

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. *-commutativeN/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              3. lower-*.f6499.0

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            4. Applied rewrites99.0%

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            5. Taylor expanded in t around 0

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{ew \cdot t}\right)}\right| \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right)\right| \]
              2. *-commutativeN/A

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
              3. lower-*.f6489.7

                \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot \color{blue}{ew}}\right)\right| \]
            7. Applied rewrites89.7%

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\frac{eh}{t \cdot ew}\right)}\right| \]
            8. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)}\right| \]
              2. lift-*.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
              3. lift-*.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
              4. lift-sin.f64N/A

                \[\leadsto \left|\left(ew \cdot \color{blue}{\sin t}\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right| \]
              5. lower-fma.f64N/A

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right)\right)}\right| \]
            9. Applied rewrites57.5%

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew \cdot \sin t, \frac{1}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}, \left(eh \cdot \cos t\right) \cdot \frac{\frac{eh}{t \cdot ew}}{\sqrt{1 + \frac{eh}{t \cdot ew} \cdot \frac{eh}{t \cdot ew}}}\right)}\right| \]
            10. Taylor expanded in t around 0

              \[\leadsto \left|\color{blue}{\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
            11. Step-by-step derivation
              1. cos-atan-revN/A

                \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              2. sin-atan-revN/A

                \[\leadsto \left|\frac{{eh}^{2}}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              3. lower-/.f64N/A

                \[\leadsto \left|\frac{{eh}^{2}}{\color{blue}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
              4. unpow2N/A

                \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              5. lower-*.f64N/A

                \[\leadsto \left|\frac{eh \cdot eh}{\color{blue}{ew} \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
              6. lower-*.f64N/A

                \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \color{blue}{\sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}}\right| \]
              7. lower-sqrt.f64N/A

                \[\leadsto \left|\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{{eh}^{2}}{{ew}^{2}}}}\right| \]
            12. Applied rewrites11.2%

              \[\leadsto \left|\color{blue}{\frac{eh \cdot eh}{ew \cdot \sqrt{\frac{eh \cdot eh}{ew \cdot ew}}}}\right| \]
            13. Taylor expanded in eh around 0

              \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
            14. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left|\frac{eh}{ew \cdot \color{blue}{\sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
              2. pow-flipN/A

                \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{\left(\mathsf{neg}\left(2\right)\right)}}}\right| \]
              3. metadata-evalN/A

                \[\leadsto \left|\frac{eh}{ew \cdot \sqrt{{ew}^{-2}}}\right| \]
              4. sqrt-pow1N/A

                \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{\left(\frac{-2}{\color{blue}{2}}\right)}}\right| \]
              5. metadata-evalN/A

                \[\leadsto \left|\frac{eh}{ew \cdot {ew}^{-1}}\right| \]
              6. inv-powN/A

                \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
              7. lower-*.f64N/A

                \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{\color{blue}{ew}}}\right| \]
              8. lower-/.f6442.1

                \[\leadsto \left|\frac{eh}{ew \cdot \frac{1}{ew}}\right| \]
            15. Applied rewrites42.1%

              \[\leadsto \left|\frac{eh}{\color{blue}{ew \cdot \frac{1}{ew}}}\right| \]
            16. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025134 
            (FPCore (eh ew t)
              :name "Example from Robby"
              :precision binary64
              (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))