Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 13.8s
Alternatives: 14
Speedup: 1.0×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} t\_1, \tanh \sinh^{-1} t\_1 \cdot \left(\cos t \cdot eh\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
    4. lower-sin.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
    5. lower-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
    6. lower-atan.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
    7. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
    8. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
    9. lower-tan.f64N/A

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

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

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

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\mathsf{fma}\left(ew, \sin t \cdot \frac{1}{\sqrt{1 + {t\_1}^{2}}}, \tanh \sinh^{-1} t\_1 \cdot \left(\cos t \cdot eh\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
    4. lower-sin.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
    5. lower-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
    6. lower-atan.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
    7. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
    8. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
    9. lower-tan.f64N/A

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

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

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

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
  5. Step-by-step derivation
    1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(ew, \sin t \cdot \frac{1}{\sqrt{1 + {\left(\frac{\frac{eh}{ew}}{\tan t}\right)}^{2}}}, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (fma
   ew
   (* (sin t) (/ 1.0 (sqrt (+ 1.0 (pow (/ (/ eh ew) (tan t)) 2.0)))))
   (* (tanh (/ (* eh (cos t)) (* ew (sin t)))) (* (cos t) eh)))))
double code(double eh, double ew, double t) {
	return fabs(fma(ew, (sin(t) * (1.0 / sqrt((1.0 + pow(((eh / ew) / tan(t)), 2.0))))), (tanh(((eh * cos(t)) / (ew * sin(t)))) * (cos(t) * eh))));
}
function code(eh, ew, t)
	return abs(fma(ew, Float64(sin(t) * Float64(1.0 / sqrt(Float64(1.0 + (Float64(Float64(eh / ew) / tan(t)) ^ 2.0))))), Float64(tanh(Float64(Float64(eh * cos(t)) / Float64(ew * sin(t)))) * Float64(cos(t) * eh))))
end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[Power[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Tanh[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(ew, \sin t \cdot \frac{1}{\sqrt{1 + {\left(\frac{\frac{eh}{ew}}{\tan t}\right)}^{2}}}, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
    4. lower-sin.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
    5. lower-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
    6. lower-atan.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
    7. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
    8. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
    9. lower-tan.f64N/A

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

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

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

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
  5. Step-by-step derivation
    1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \frac{1}{\sqrt{1 + {\left(\frac{\frac{eh}{ew}}{\tan t}\right)}^{2}}}, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
    5. lower-sin.f6497.3

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \frac{1}{\sqrt{1 + {\left(\frac{\frac{eh}{ew}}{\tan t}\right)}^{2}}}, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
  11. Applied rewrites97.3%

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

Alternative 4: 99.1% accurate, 1.1× speedup?

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

\\
\left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
    4. lower-sin.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
    5. lower-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
    6. lower-atan.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
    7. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
    8. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
    9. lower-tan.f64N/A

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot t}}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
    2. lower-*.f6497.2

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

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

Alternative 5: 99.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{eh}{ew}}{\tan t}\\ \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (/ (/ eh ew) (tan t))))
   (fabs
    (+
     (* (* ew (sin t)) (/ 1.0 (sqrt (+ 1.0 (* t_1 t_1)))))
     (*
      (* eh (cos t))
      (sin
       (atan (/ (/ (fma -0.3333333333333333 (* (* t t) eh) eh) ew) t))))))))
double code(double eh, double ew, double t) {
	double t_1 = (eh / ew) / tan(t);
	return fabs((((ew * sin(t)) * (1.0 / sqrt((1.0 + (t_1 * t_1))))) + ((eh * cos(t)) * sin(atan(((fma(-0.3333333333333333, ((t * t) * eh), eh) / ew) / t))))));
}
function code(eh, ew, t)
	t_1 = Float64(Float64(eh / ew) / tan(t))
	return abs(Float64(Float64(Float64(ew * sin(t)) * Float64(1.0 / sqrt(Float64(1.0 + Float64(t_1 * t_1))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(fma(-0.3333333333333333, Float64(Float64(t * t) * eh), eh) / ew) / t))))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(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]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\sqrt{1 + t\_1 \cdot t\_1}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\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. Add Preprocessing
  3. Taylor expanded in t around 0

    \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
  4. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

      \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
    6. *-commutativeN/A

      \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
    7. lower-*.f64N/A

      \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
    8. unpow2N/A

      \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
    9. lower-*.f6496.9

      \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
  5. Applied rewrites96.9%

    \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
  6. Step-by-step derivation
    1. cos-atanN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\color{blue}{\frac{eh}{ew}}}{\tan t}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
    11. lower-tan.f6496.9

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

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

Alternative 6: 98.5% accurate, 1.6× speedup?

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

\\
\left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
    4. lower-sin.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
    5. lower-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
    6. lower-atan.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
    7. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
    8. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
    9. lower-tan.f64N/A

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

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

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

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
  5. Step-by-step derivation
    1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 98.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(ew, \sin t, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (fma
   ew
   (sin t)
   (* (tanh (/ (* eh (cos t)) (* ew (sin t)))) (* (cos t) eh)))))
double code(double eh, double ew, double t) {
	return fabs(fma(ew, sin(t), (tanh(((eh * cos(t)) / (ew * sin(t)))) * (cos(t) * eh))));
}
function code(eh, ew, t)
	return abs(fma(ew, sin(t), Float64(tanh(Float64(Float64(eh * cos(t)) / Float64(ew * sin(t)))) * Float64(cos(t) * eh))))
end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Sin[t], $MachinePrecision] + N[(N[Tanh[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(ew, \sin t, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l*N/A

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
    3. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
    4. lower-sin.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
    5. lower-cos.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
    6. lower-atan.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
    7. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
    8. lower-/.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
    9. lower-tan.f64N/A

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

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

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

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
  5. Step-by-step derivation
    1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
    4. lower-*.f64N/A

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \color{blue}{\sin t}}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
    5. lower-sin.f6496.3

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t, \tanh \left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right) \cdot \left(\cos t \cdot eh\right)\right)\right| \]
  12. Applied rewrites96.3%

    \[\leadsto \left|\mathsf{fma}\left(ew, \sin t, \tanh \color{blue}{\left(\frac{eh \cdot \cos t}{ew \cdot \sin t}\right)} \cdot \left(\cos t \cdot eh\right)\right)\right| \]
  13. Add Preprocessing

Alternative 8: 89.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.1 \cdot 10^{-63} \lor \neg \left(ew \leq 2.05 \cdot 10^{-111}\right):\\ \;\;\;\;\left|ew \cdot \left(\sin t + \frac{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= ew -2.1e-63) (not (<= ew 2.05e-111)))
   (fabs
    (* ew (+ (sin t) (/ (* eh (* (cos t) (sin (atan (/ eh (* ew t)))))) ew))))
   (fabs (* eh (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -2.1e-63) || !(ew <= 2.05e-111)) {
		tmp = fabs((ew * (sin(t) + ((eh * (cos(t) * sin(atan((eh / (ew * t)))))) / ew))));
	} else {
		tmp = fabs((eh * cos(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 ((ew <= (-2.1d-63)) .or. (.not. (ew <= 2.05d-111))) then
        tmp = abs((ew * (sin(t) + ((eh * (cos(t) * sin(atan((eh / (ew * t)))))) / ew))))
    else
        tmp = abs((eh * cos(t)))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((ew <= -2.1e-63) || !(ew <= 2.05e-111)) {
		tmp = Math.abs((ew * (Math.sin(t) + ((eh * (Math.cos(t) * Math.sin(Math.atan((eh / (ew * t)))))) / ew))));
	} else {
		tmp = Math.abs((eh * Math.cos(t)));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (ew <= -2.1e-63) or not (ew <= 2.05e-111):
		tmp = math.fabs((ew * (math.sin(t) + ((eh * (math.cos(t) * math.sin(math.atan((eh / (ew * t)))))) / ew))))
	else:
		tmp = math.fabs((eh * math.cos(t)))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((ew <= -2.1e-63) || !(ew <= 2.05e-111))
		tmp = abs(Float64(ew * Float64(sin(t) + Float64(Float64(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * t)))))) / ew))));
	else
		tmp = abs(Float64(eh * cos(t)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((ew <= -2.1e-63) || ~((ew <= 2.05e-111)))
		tmp = abs((ew * (sin(t) + ((eh * (cos(t) * sin(atan((eh / (ew * t)))))) / ew))));
	else
		tmp = abs((eh * cos(t)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.1e-63], N[Not[LessEqual[ew, 2.05e-111]], $MachinePrecision]], N[Abs[N[(ew * N[(N[Sin[t], $MachinePrecision] + N[(N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -2.1 \cdot 10^{-63} \lor \neg \left(ew \leq 2.05 \cdot 10^{-111}\right):\\
\;\;\;\;\left|ew \cdot \left(\sin t + \frac{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)}{ew}\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|eh \cdot \cos t\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ew < -2.1e-63 or 2.04999999999999984e-111 < ew

    1. Initial program 99.7%

      \[\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. Add Preprocessing
    3. Step-by-step derivation
      1. cos-atanN/A

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

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

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \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 \frac{1}{\sqrt{\color{blue}{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      5. pow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|ew \cdot \left(\sin t + \frac{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)}{ew}\right)\right| \]

    if -2.1e-63 < ew < 2.04999999999999984e-111

    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. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

        \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
      6. *-commutativeN/A

        \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
      7. lower-*.f64N/A

        \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
      8. unpow2N/A

        \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
      9. lower-*.f6498.0

        \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
    5. Applied rewrites98.0%

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
    6. Step-by-step derivation
      1. sin-atanN/A

        \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
      2. lower-/.f64N/A

        \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
    7. Applied rewrites17.0%

      \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
    8. Taylor expanded in eh around inf

      \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
      2. lower-cos.f6490.3

        \[\leadsto \left|eh \cdot \cos t\right| \]
    10. Applied rewrites90.3%

      \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.1 \cdot 10^{-63} \lor \neg \left(ew \leq 2.05 \cdot 10^{-111}\right):\\ \;\;\;\;\left|ew \cdot \left(\sin t + \frac{eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 86.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{ew}}{\tan t}\\
\mathbf{if}\;ew \leq -3.1 \cdot 10^{-64}:\\
\;\;\;\;\left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} t\_1 \cdot eh\right)\right|\\

\mathbf{elif}\;ew \leq 1.55 \cdot 10^{-151}:\\
\;\;\;\;\left|eh \cdot \cos t\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} t\_1 + eh\right|\\


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

    1. Initial program 99.7%

      \[\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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*N/A

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

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
      3. lower-*.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
      4. lower-sin.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
      5. lower-cos.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
      6. lower-atan.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
      7. lower-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
      8. lower-/.f64N/A

        \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
      9. lower-tan.f64N/A

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

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

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

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
    5. Step-by-step derivation
      1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \color{blue}{eh}\right)\right| \]
    11. Step-by-step derivation
      1. Applied rewrites88.3%

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

      if -3.10000000000000025e-64 < ew < 1.54999999999999992e-151

      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. Add Preprocessing
      3. Taylor expanded in t around 0

        \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
        6. *-commutativeN/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
        7. lower-*.f64N/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
        8. unpow2N/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
        9. lower-*.f6497.9

          \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
      5. Applied rewrites97.9%

        \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
      6. Step-by-step derivation
        1. sin-atanN/A

          \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
        2. lower-/.f64N/A

          \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
      7. Applied rewrites17.9%

        \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
      8. Taylor expanded in eh around inf

        \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
      9. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
        2. lower-cos.f6490.8

          \[\leadsto \left|eh \cdot \cos t\right| \]
      10. Applied rewrites90.8%

        \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]

      if 1.54999999999999992e-151 < 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. Add Preprocessing
      3. Taylor expanded in t around 0

        \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
        6. *-commutativeN/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
        7. lower-*.f64N/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
        8. unpow2N/A

          \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
        9. lower-*.f6497.0

          \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
      5. Applied rewrites97.0%

        \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
      6. Step-by-step derivation
        1. sin-atanN/A

          \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
        2. lower-/.f64N/A

          \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
      7. Applied rewrites42.0%

        \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
      8. Taylor expanded in t around 0

        \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \color{blue}{eh}\right| \]
      9. Step-by-step derivation
        1. Applied rewrites82.8%

          \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \color{blue}{eh}\right| \]
      10. Recombined 3 regimes into one program.
      11. Add Preprocessing

      Alternative 10: 87.0% accurate, 1.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -3.1 \cdot 10^{-64} \lor \neg \left(ew \leq 1.55 \cdot 10^{-151}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (or (<= ew -3.1e-64) (not (<= ew 1.55e-151)))
         (fabs (fma ew (sin t) (* (tanh (asinh (/ (/ eh ew) (tan t)))) eh)))
         (fabs (* eh (cos t)))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if ((ew <= -3.1e-64) || !(ew <= 1.55e-151)) {
      		tmp = fabs(fma(ew, sin(t), (tanh(asinh(((eh / ew) / tan(t)))) * eh)));
      	} else {
      		tmp = fabs((eh * cos(t)));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if ((ew <= -3.1e-64) || !(ew <= 1.55e-151))
      		tmp = abs(fma(ew, sin(t), Float64(tanh(asinh(Float64(Float64(eh / ew) / tan(t)))) * eh)));
      	else
      		tmp = abs(Float64(eh * cos(t)));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := If[Or[LessEqual[ew, -3.1e-64], N[Not[LessEqual[ew, 1.55e-151]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision] + N[(N[Tanh[N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;ew \leq -3.1 \cdot 10^{-64} \lor \neg \left(ew \leq 1.55 \cdot 10^{-151}\right):\\
      \;\;\;\;\left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot eh\right)\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|eh \cdot \cos t\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -3.10000000000000025e-64 or 1.54999999999999992e-151 < 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. Add Preprocessing
        3. Step-by-step derivation
          1. associate-*l*N/A

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

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
          3. lower-*.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
          4. lower-sin.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
          5. lower-cos.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
          6. lower-atan.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
          7. lower-/.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
          8. lower-/.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
          9. lower-tan.f64N/A

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

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

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

          \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
        5. Step-by-step derivation
          1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \color{blue}{eh}\right)\right| \]
        11. Step-by-step derivation
          1. Applied rewrites85.0%

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

          if -3.10000000000000025e-64 < ew < 1.54999999999999992e-151

          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. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
            6. *-commutativeN/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            7. lower-*.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            8. unpow2N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            9. lower-*.f6497.9

              \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
          5. Applied rewrites97.9%

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
          6. Step-by-step derivation
            1. sin-atanN/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
            2. lower-/.f64N/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
          7. Applied rewrites17.9%

            \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
          8. Taylor expanded in eh around inf

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
            2. lower-cos.f6490.8

              \[\leadsto \left|eh \cdot \cos t\right| \]
          10. Applied rewrites90.8%

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
        12. Recombined 2 regimes into one program.
        13. Final simplification87.1%

          \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -3.1 \cdot 10^{-64} \lor \neg \left(ew \leq 1.55 \cdot 10^{-151}\right):\\ \;\;\;\;\left|\mathsf{fma}\left(ew, \sin t, \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot eh\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \]
        14. Add Preprocessing

        Alternative 11: 75.2% accurate, 7.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.15 \cdot 10^{+52} \lor \neg \left(ew \leq 2.6 \cdot 10^{+89}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (if (or (<= ew -2.15e+52) (not (<= ew 2.6e+89)))
           (fabs (* ew (sin t)))
           (fabs (* eh (cos t)))))
        double code(double eh, double ew, double t) {
        	double tmp;
        	if ((ew <= -2.15e+52) || !(ew <= 2.6e+89)) {
        		tmp = fabs((ew * sin(t)));
        	} else {
        		tmp = fabs((eh * cos(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 ((ew <= (-2.15d+52)) .or. (.not. (ew <= 2.6d+89))) then
                tmp = abs((ew * sin(t)))
            else
                tmp = abs((eh * cos(t)))
            end if
            code = tmp
        end function
        
        public static double code(double eh, double ew, double t) {
        	double tmp;
        	if ((ew <= -2.15e+52) || !(ew <= 2.6e+89)) {
        		tmp = Math.abs((ew * Math.sin(t)));
        	} else {
        		tmp = Math.abs((eh * Math.cos(t)));
        	}
        	return tmp;
        }
        
        def code(eh, ew, t):
        	tmp = 0
        	if (ew <= -2.15e+52) or not (ew <= 2.6e+89):
        		tmp = math.fabs((ew * math.sin(t)))
        	else:
        		tmp = math.fabs((eh * math.cos(t)))
        	return tmp
        
        function code(eh, ew, t)
        	tmp = 0.0
        	if ((ew <= -2.15e+52) || !(ew <= 2.6e+89))
        		tmp = abs(Float64(ew * sin(t)));
        	else
        		tmp = abs(Float64(eh * cos(t)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(eh, ew, t)
        	tmp = 0.0;
        	if ((ew <= -2.15e+52) || ~((ew <= 2.6e+89)))
        		tmp = abs((ew * sin(t)));
        	else
        		tmp = abs((eh * cos(t)));
        	end
        	tmp_2 = tmp;
        end
        
        code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.15e+52], N[Not[LessEqual[ew, 2.6e+89]], $MachinePrecision]], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;ew \leq -2.15 \cdot 10^{+52} \lor \neg \left(ew \leq 2.6 \cdot 10^{+89}\right):\\
        \;\;\;\;\left|ew \cdot \sin t\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|eh \cdot \cos t\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < -2.15e52 or 2.6000000000000001e89 < ew

          1. Initial program 99.7%

            \[\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. Add Preprocessing
          3. Step-by-step derivation
            1. cos-atanN/A

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

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

              \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \frac{1}{\color{blue}{\sqrt{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \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 \frac{1}{\sqrt{\color{blue}{1 + \frac{\frac{eh}{ew}}{\tan t} \cdot \frac{\frac{eh}{ew}}{\tan t}}}} + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
            5. pow2N/A

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

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

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

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

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

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

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

              \[\leadsto \left|ew \cdot \sin t\right| \]
            2. cos-atan-revN/A

              \[\leadsto \left|ew \cdot \sin t\right| \]
            3. sin-atan-revN/A

              \[\leadsto \left|ew \cdot \sin t\right| \]
            4. lower-*.f64N/A

              \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
            5. lower-sin.f6477.6

              \[\leadsto \left|ew \cdot \sin t\right| \]
          7. Applied rewrites77.6%

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

          if -2.15e52 < ew < 2.6000000000000001e89

          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. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
            6. *-commutativeN/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            7. lower-*.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            8. unpow2N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            9. lower-*.f6496.4

              \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
          5. Applied rewrites96.4%

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
          6. Step-by-step derivation
            1. sin-atanN/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
            2. lower-/.f64N/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
          7. Applied rewrites25.0%

            \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
          8. Taylor expanded in eh around inf

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
            2. lower-cos.f6478.7

              \[\leadsto \left|eh \cdot \cos t\right| \]
          10. Applied rewrites78.7%

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
        3. Recombined 2 regimes into one program.
        4. Final simplification78.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.15 \cdot 10^{+52} \lor \neg \left(ew \leq 2.6 \cdot 10^{+89}\right):\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \end{array} \]
        5. Add Preprocessing

        Alternative 12: 61.9% accurate, 7.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh \cdot eh}{ew}\\ \mathbf{if}\;ew \leq 1.8 \cdot 10^{+202}:\\ \;\;\;\;\left|eh \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(0.5, t\_1, \left(t \cdot t\right) \cdot \left(ew + -0.4166666666666667 \cdot t\_1\right)\right)}{t}\right|\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (/ (* eh eh) ew)))
           (if (<= ew 1.8e+202)
             (fabs (* eh (cos t)))
             (fabs
              (/ (fma 0.5 t_1 (* (* t t) (+ ew (* -0.4166666666666667 t_1)))) t)))))
        double code(double eh, double ew, double t) {
        	double t_1 = (eh * eh) / ew;
        	double tmp;
        	if (ew <= 1.8e+202) {
        		tmp = fabs((eh * cos(t)));
        	} else {
        		tmp = fabs((fma(0.5, t_1, ((t * t) * (ew + (-0.4166666666666667 * t_1)))) / t));
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = Float64(Float64(eh * eh) / ew)
        	tmp = 0.0
        	if (ew <= 1.8e+202)
        		tmp = abs(Float64(eh * cos(t)));
        	else
        		tmp = abs(Float64(fma(0.5, t_1, Float64(Float64(t * t) * Float64(ew + Float64(-0.4166666666666667 * t_1)))) / t));
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh * eh), $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[ew, 1.8e+202], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(0.5 * t$95$1 + N[(N[(t * t), $MachinePrecision] * N[(ew + N[(-0.4166666666666667 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{eh \cdot eh}{ew}\\
        \mathbf{if}\;ew \leq 1.8 \cdot 10^{+202}:\\
        \;\;\;\;\left|eh \cdot \cos t\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|\frac{\mathsf{fma}\left(0.5, t\_1, \left(t \cdot t\right) \cdot \left(ew + -0.4166666666666667 \cdot t\_1\right)\right)}{t}\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < 1.80000000000000004e202

          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. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
            6. *-commutativeN/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            7. lower-*.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            8. unpow2N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            9. lower-*.f6496.7

              \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
          5. Applied rewrites96.7%

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
          6. Step-by-step derivation
            1. sin-atanN/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
            2. lower-/.f64N/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
          7. Applied rewrites33.3%

            \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
          8. Taylor expanded in eh around inf

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]
          9. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|eh \cdot \color{blue}{\cos t}\right| \]
            2. lower-cos.f6462.5

              \[\leadsto \left|eh \cdot \cos t\right| \]
          10. Applied rewrites62.5%

            \[\leadsto \left|\color{blue}{eh \cdot \cos t}\right| \]

          if 1.80000000000000004e202 < ew

          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. Add Preprocessing
          3. Step-by-step derivation
            1. associate-*l*N/A

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

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
            3. lower-*.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
            4. lower-sin.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
            5. lower-cos.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
            6. lower-atan.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
            7. lower-/.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
            8. lower-/.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
            9. lower-tan.f64N/A

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

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

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

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
          5. Step-by-step derivation
            1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|\frac{\frac{1}{2} \cdot \frac{{eh}^{2}}{ew} + {t}^{2} \cdot \left(ew + \frac{-5}{12} \cdot \frac{{eh}^{2}}{ew}\right)}{t}\right| \]
          12. Applied rewrites37.1%

            \[\leadsto \left|\frac{\mathsf{fma}\left(0.5, \frac{eh \cdot eh}{ew}, \left(t \cdot t\right) \cdot \left(ew + -0.4166666666666667 \cdot \frac{eh \cdot eh}{ew}\right)\right)}{\color{blue}{t}}\right| \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 13: 42.9% accurate, 11.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{eh \cdot eh}{ew}\\ \mathbf{if}\;ew \leq 2.2 \cdot 10^{+185}:\\ \;\;\;\;\left|eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\mathsf{fma}\left(0.5, t\_1, \left(t \cdot t\right) \cdot \left(ew + -0.4166666666666667 \cdot t\_1\right)\right)}{t}\right|\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (/ (* eh eh) ew)))
           (if (<= ew 2.2e+185)
             (fabs eh)
             (fabs
              (/ (fma 0.5 t_1 (* (* t t) (+ ew (* -0.4166666666666667 t_1)))) t)))))
        double code(double eh, double ew, double t) {
        	double t_1 = (eh * eh) / ew;
        	double tmp;
        	if (ew <= 2.2e+185) {
        		tmp = fabs(eh);
        	} else {
        		tmp = fabs((fma(0.5, t_1, ((t * t) * (ew + (-0.4166666666666667 * t_1)))) / t));
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = Float64(Float64(eh * eh) / ew)
        	tmp = 0.0
        	if (ew <= 2.2e+185)
        		tmp = abs(eh);
        	else
        		tmp = abs(Float64(fma(0.5, t_1, Float64(Float64(t * t) * Float64(ew + Float64(-0.4166666666666667 * t_1)))) / t));
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh * eh), $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[ew, 2.2e+185], N[Abs[eh], $MachinePrecision], N[Abs[N[(N[(0.5 * t$95$1 + N[(N[(t * t), $MachinePrecision] * N[(ew + N[(-0.4166666666666667 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{eh \cdot eh}{ew}\\
        \mathbf{if}\;ew \leq 2.2 \cdot 10^{+185}:\\
        \;\;\;\;\left|eh\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|\frac{\mathsf{fma}\left(0.5, t\_1, \left(t \cdot t\right) \cdot \left(ew + -0.4166666666666667 \cdot t\_1\right)\right)}{t}\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < 2.2000000000000001e185

          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. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
            6. *-commutativeN/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            7. lower-*.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            8. unpow2N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            9. lower-*.f6496.7

              \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
          5. Applied rewrites96.7%

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
          6. Step-by-step derivation
            1. sin-atanN/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
            2. lower-/.f64N/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
          7. Applied rewrites32.9%

            \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
          8. Taylor expanded in t around 0

            \[\leadsto \left|\color{blue}{eh}\right| \]
          9. Step-by-step derivation
            1. Applied rewrites42.4%

              \[\leadsto \left|\color{blue}{eh}\right| \]

            if 2.2000000000000001e185 < ew

            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. Add Preprocessing
            3. Step-by-step derivation
              1. associate-*l*N/A

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

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \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)}\right| \]
              3. lower-*.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t \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)\right| \]
              4. lower-sin.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew, \color{blue}{\sin t} \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)\right| \]
              5. lower-cos.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \color{blue}{\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)\right| \]
              6. lower-atan.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \color{blue}{\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)\right| \]
              7. lower-/.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \color{blue}{\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)\right| \]
              8. lower-/.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\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)\right| \]
              9. lower-tan.f64N/A

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

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

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

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(ew, \sin t \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \tanh \sinh^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(\cos t \cdot eh\right)\right)}\right| \]
            5. Step-by-step derivation
              1. cos-atanN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\frac{\frac{1}{2} \cdot \frac{{eh}^{2}}{ew} + {t}^{2} \cdot \left(ew + \frac{-5}{12} \cdot \frac{{eh}^{2}}{ew}\right)}{t}\right| \]
            12. Applied rewrites36.6%

              \[\leadsto \left|\frac{\mathsf{fma}\left(0.5, \frac{eh \cdot eh}{ew}, \left(t \cdot t\right) \cdot \left(ew + -0.4166666666666667 \cdot \frac{eh \cdot eh}{ew}\right)\right)}{\color{blue}{t}}\right| \]
          10. Recombined 2 regimes into one program.
          11. Add Preprocessing

          Alternative 14: 42.7% accurate, 290.0× speedup?

          \[\begin{array}{l} \\ \left|eh\right| \end{array} \]
          (FPCore (eh ew t) :precision binary64 (fabs eh))
          double code(double eh, double ew, double t) {
          	return fabs(eh);
          }
          
          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)
          end function
          
          public static double code(double eh, double ew, double t) {
          	return Math.abs(eh);
          }
          
          def code(eh, ew, t):
          	return math.fabs(eh)
          
          function code(eh, ew, t)
          	return abs(eh)
          end
          
          function tmp = code(eh, ew, t)
          	tmp = abs(eh);
          end
          
          code[eh_, ew_, t_] := N[Abs[eh], $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \left|eh\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. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{-1}{3} \cdot \frac{eh \cdot {t}^{2}}{ew} + \frac{eh}{ew}}{t}\right)}\right| \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \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{-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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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{eh}{ew}}{\tan 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. lower-fma.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, eh \cdot {t}^{2}, eh\right)}{ew}}{t}\right)\right| \]
            6. *-commutativeN/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            7. lower-*.f64N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, {t}^{2} \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            8. unpow2N/A

              \[\leadsto \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{\mathsf{fma}\left(\frac{-1}{3}, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
            9. lower-*.f6496.9

              \[\leadsto \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{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)\right| \]
          5. Applied rewrites96.9%

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}\right)}\right| \]
          6. Step-by-step derivation
            1. sin-atanN/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
            2. lower-/.f64N/A

              \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}{\sqrt{1 + \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t} \cdot \frac{\frac{\frac{-1}{3} \cdot \left(\left(t \cdot t\right) \cdot eh\right) + eh}{ew}}{t}}}}\right| \]
          7. Applied rewrites36.0%

            \[\leadsto \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 \color{blue}{\frac{\frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}{\sqrt{1 + \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t} \cdot \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, \left(t \cdot t\right) \cdot eh, eh\right)}{ew}}{t}}}}\right| \]
          8. Taylor expanded in t around 0

            \[\leadsto \left|\color{blue}{eh}\right| \]
          9. Step-by-step derivation
            1. Applied rewrites39.9%

              \[\leadsto \left|\color{blue}{eh}\right| \]
            2. Add Preprocessing

            Reproduce

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