Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 14.0s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \frac{\cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    14. cosh-asinh-revN/A

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

    \[\leadsto \left|\color{blue}{\frac{\cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  5. Final simplification99.8%

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

Alternative 2: 33.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\ \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -5 \cdot 10^{-240}:\\ \;\;\;\;-\left(-ew\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
   (if (<=
        (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
        -5e-240)
     (- (- ew))
     (* (cos t) ew))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((eh * tan(t)) / -ew));
	double tmp;
	if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -5e-240) {
		tmp = -(-ew);
	} else {
		tmp = cos(t) * ew;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(eh, ew, t)
use fmin_fmax_functions
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = atan(((eh * tan(t)) / -ew))
    if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= (-5d-240)) then
        tmp = -(-ew)
    else
        tmp = cos(t) * ew
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((eh * Math.tan(t)) / -ew));
	double tmp;
	if ((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))) <= -5e-240) {
		tmp = -(-ew);
	} else {
		tmp = Math.cos(t) * ew;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.atan(((eh * math.tan(t)) / -ew))
	tmp = 0
	if (((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))) <= -5e-240:
		tmp = -(-ew)
	else:
		tmp = math.cos(t) * ew
	return tmp
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew)))
	tmp = 0.0
	if (Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))) <= -5e-240)
		tmp = Float64(-Float64(-ew));
	else
		tmp = Float64(cos(t) * ew);
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = atan(((eh * tan(t)) / -ew));
	tmp = 0.0;
	if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -5e-240)
		tmp = -(-ew);
	else
		tmp = cos(t) * ew;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-240], (-(-ew)), N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -5 \cdot 10^{-240}:\\
\;\;\;\;-\left(-ew\right)\\

\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -5.0000000000000004e-240

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot \frac{1}{2}, \color{blue}{t \cdot t}, ew\right) \]
      15. lower-*.f641.3

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot 0.5, \color{blue}{t \cdot t}, ew\right) \]
    6. Applied rewrites1.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot 0.5, t \cdot t, ew\right)} \]
    7. Taylor expanded in ew around -inf

      \[\leadsto -1 \cdot \color{blue}{\left(ew \cdot \left(\left(\frac{1}{2} \cdot {t}^{2} + \frac{{t}^{2} \cdot \left(-1 \cdot {eh}^{2} - \frac{-1}{2} \cdot {eh}^{2}\right)}{{ew}^{2}}\right) - 1\right)\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites1.1%

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

        \[\leadsto --1 \cdot ew \]
      3. Step-by-step derivation
        1. Applied rewrites5.2%

          \[\leadsto -\left(-ew\right) \]

        if -5.0000000000000004e-240 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))))

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot \frac{1}{2}, \color{blue}{t \cdot t}, ew\right) \]
          15. lower-*.f6433.4

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot 0.5, \color{blue}{t \cdot t}, ew\right) \]
        6. Applied rewrites33.4%

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

          \[\leadsto \color{blue}{ew \cdot \cos t} \]
        8. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          3. lower-cos.f6462.3

            \[\leadsto \color{blue}{\cos t} \cdot ew \]
        9. Applied rewrites62.3%

          \[\leadsto \color{blue}{\cos t \cdot ew} \]
      4. Recombined 2 regimes into one program.
      5. Final simplification29.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) \leq -5 \cdot 10^{-240}:\\ \;\;\;\;-\left(-ew\right)\\ \mathbf{else}:\\ \;\;\;\;\cos t \cdot ew\\ \end{array} \]
      6. Add Preprocessing

      Alternative 3: 99.8% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew\right| \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (fabs
        (-
         (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew)))))
         (* (* (cos (atan (* (/ (tan t) ew) eh))) (cos t)) ew))))
      double code(double eh, double ew, double t) {
      	return fabs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(atan(((tan(t) / ew) * eh))) * cos(t)) * ew)));
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(eh, ew, t)
      use fmin_fmax_functions
          real(8), intent (in) :: eh
          real(8), intent (in) :: ew
          real(8), intent (in) :: t
          code = abs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(atan(((tan(t) / ew) * eh))) * cos(t)) * ew)))
      end function
      
      public static double code(double eh, double ew, double t) {
      	return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew)))) - ((Math.cos(Math.atan(((Math.tan(t) / ew) * eh))) * Math.cos(t)) * ew)));
      }
      
      def code(eh, ew, t):
      	return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((eh * math.tan(t)) / -ew)))) - ((math.cos(math.atan(((math.tan(t) / ew) * eh))) * math.cos(t)) * ew)))
      
      function code(eh, ew, t)
      	return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))) - Float64(Float64(cos(atan(Float64(Float64(tan(t) / ew) * eh))) * cos(t)) * ew)))
      end
      
      function tmp = code(eh, ew, t)
      	tmp = abs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(atan(((tan(t) / ew) * eh))) * cos(t)) * ew)));
      end
      
      code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew\right|
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto \left|\color{blue}{\left(\cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right) \cdot \cos t\right) \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      5. Final simplification99.8%

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

      Alternative 4: 99.8% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \frac{\cos t \cdot ew}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}}\right| \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (fabs
        (-
         (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew)))))
         (/ (* (cos t) ew) (sqrt (+ 1.0 (pow (* eh (/ (tan t) ew)) 2.0)))))))
      double code(double eh, double ew, double t) {
      	return fabs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) / sqrt((1.0 + pow((eh * (tan(t) / ew)), 2.0))))));
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(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 * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) / sqrt((1.0d0 + ((eh * (tan(t) / ew)) ** 2.0d0))))))
      end function
      
      public static double code(double eh, double ew, double t) {
      	return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew)))) - ((Math.cos(t) * ew) / Math.sqrt((1.0 + Math.pow((eh * (Math.tan(t) / ew)), 2.0))))));
      }
      
      def code(eh, ew, t):
      	return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((eh * math.tan(t)) / -ew)))) - ((math.cos(t) * ew) / math.sqrt((1.0 + math.pow((eh * (math.tan(t) / ew)), 2.0))))))
      
      function code(eh, ew, t)
      	return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))) - Float64(Float64(cos(t) * ew) / sqrt(Float64(1.0 + (Float64(eh * Float64(tan(t) / ew)) ^ 2.0))))))
      end
      
      function tmp = code(eh, ew, t)
      	tmp = abs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) / sqrt((1.0 + ((eh * (tan(t) / ew)) ^ 2.0))))));
      end
      
      code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \frac{\cos t \cdot ew}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        14. cosh-asinh-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 98.5% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \frac{\cos t \cdot ew}{1}\right| \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (fabs
        (-
         (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew)))))
         (/ (* (cos t) ew) 1.0))))
      double code(double eh, double ew, double t) {
      	return fabs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) / 1.0)));
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(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 * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) / 1.0d0)))
      end function
      
      public static double code(double eh, double ew, double t) {
      	return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew)))) - ((Math.cos(t) * ew) / 1.0)));
      }
      
      def code(eh, ew, t):
      	return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((eh * math.tan(t)) / -ew)))) - ((math.cos(t) * ew) / 1.0)))
      
      function code(eh, ew, t)
      	return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))) - Float64(Float64(cos(t) * ew) / 1.0)))
      end
      
      function tmp = code(eh, ew, t)
      	tmp = abs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) / 1.0)));
      end
      
      code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \frac{\cos t \cdot ew}{1}\right|
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        14. cosh-asinh-revN/A

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

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

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

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

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

        Alternative 6: 98.3% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right) - \frac{\cos t \cdot ew}{1}\right| \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (fabs
          (-
           (* (* eh (sin t)) (sin (atan (/ (* (- eh) t) ew))))
           (/ (* (cos t) ew) 1.0))))
        double code(double eh, double ew, double t) {
        	return fabs((((eh * sin(t)) * sin(atan(((-eh * t) / ew)))) - ((cos(t) * ew) / 1.0)));
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(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 * sin(t)) * sin(atan(((-eh * t) / ew)))) - ((cos(t) * ew) / 1.0d0)))
        end function
        
        public static double code(double eh, double ew, double t) {
        	return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((-eh * t) / ew)))) - ((Math.cos(t) * ew) / 1.0)));
        }
        
        def code(eh, ew, t):
        	return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((-eh * t) / ew)))) - ((math.cos(t) * ew) / 1.0)))
        
        function code(eh, ew, t)
        	return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * t) / ew)))) - Float64(Float64(cos(t) * ew) / 1.0)))
        end
        
        function tmp = code(eh, ew, t)
        	tmp = abs((((eh * sin(t)) * sin(atan(((-eh * t) / ew)))) - ((cos(t) * ew) / 1.0)));
        end
        
        code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right) - \frac{\cos t \cdot ew}{1}\right|
        \end{array}
        
        Derivation
        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          14. cosh-asinh-revN/A

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

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

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

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

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

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

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

              \[\leadsto \left|\frac{\cos t \cdot ew}{1} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \cdot t}{ew}\right)\right| \]
            4. lower-neg.f6498.7

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

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

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

          Alternative 7: 75.3% accurate, 2.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0013 \lor \neg \left(t \leq 0.0011\right):\\ \;\;\;\;\left|\cos t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-eh\right), t, ew\right)\right|\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (if (or (<= t -0.0013) (not (<= t 0.0011)))
             (fabs (* (cos t) ew))
             (fabs (fma (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (- eh)) t ew))))
          double code(double eh, double ew, double t) {
          	double tmp;
          	if ((t <= -0.0013) || !(t <= 0.0011)) {
          		tmp = fabs((cos(t) * ew));
          	} else {
          		tmp = fabs(fma((tanh(asinh(((tan(t) / ew) * -eh))) * -eh), t, ew));
          	}
          	return tmp;
          }
          
          function code(eh, ew, t)
          	tmp = 0.0
          	if ((t <= -0.0013) || !(t <= 0.0011))
          		tmp = abs(Float64(cos(t) * ew));
          	else
          		tmp = abs(fma(Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * Float64(-eh)), t, ew));
          	end
          	return tmp
          end
          
          code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0013], N[Not[LessEqual[t, 0.0011]], $MachinePrecision]], N[Abs[N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * (-eh)), $MachinePrecision] * t + ew), $MachinePrecision]], $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -0.0013 \lor \neg \left(t \leq 0.0011\right):\\
          \;\;\;\;\left|\cos t \cdot ew\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|\mathsf{fma}\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-eh\right), t, ew\right)\right|\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -0.0012999999999999999 or 0.00110000000000000007 < t

            1. Initial program 99.7%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              14. cosh-asinh-revN/A

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

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

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

                \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
              2. lower-*.f64N/A

                \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
              3. lower-cos.f6449.5

                \[\leadsto \left|\color{blue}{\cos t} \cdot ew\right| \]
            7. Applied rewrites49.5%

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

            if -0.0012999999999999999 < t < 0.00110000000000000007

            1. Initial program 100.0%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              14. cosh-asinh-revN/A

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

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

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

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

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

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}, {t}^{2}, ew\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              4. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\mathsf{fma}\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-eh\right), \color{blue}{t}, ew\right)\right| \]
            12. Recombined 2 regimes into one program.
            13. Final simplification72.8%

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

            Alternative 8: 72.5% accurate, 3.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0013 \lor \neg \left(t \leq 0.0011\right):\\ \;\;\;\;\left|\cos t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(-eh, \sin \tan^{-1} \left(\mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right) \cdot \left(-t\right)\right) \cdot t, ew\right)\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (or (<= t -0.0013) (not (<= t 0.0011)))
               (fabs (* (cos t) ew))
               (fabs
                (fma
                 (- eh)
                 (*
                  (sin
                   (atan
                    (* (fma (* 0.3333333333333333 (/ eh ew)) (* t t) (/ eh ew)) (- t))))
                  t)
                 ew))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if ((t <= -0.0013) || !(t <= 0.0011)) {
            		tmp = fabs((cos(t) * ew));
            	} else {
            		tmp = fabs(fma(-eh, (sin(atan((fma((0.3333333333333333 * (eh / ew)), (t * t), (eh / ew)) * -t))) * t), ew));
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if ((t <= -0.0013) || !(t <= 0.0011))
            		tmp = abs(Float64(cos(t) * ew));
            	else
            		tmp = abs(fma(Float64(-eh), Float64(sin(atan(Float64(fma(Float64(0.3333333333333333 * Float64(eh / ew)), Float64(t * t), Float64(eh / ew)) * Float64(-t)))) * t), ew));
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := If[Or[LessEqual[t, -0.0013], N[Not[LessEqual[t, 0.0011]], $MachinePrecision]], N[Abs[N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[((-eh) * N[(N[Sin[N[ArcTan[N[(N[(N[(0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] * (-t)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t), $MachinePrecision] + ew), $MachinePrecision]], $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;t \leq -0.0013 \lor \neg \left(t \leq 0.0011\right):\\
            \;\;\;\;\left|\cos t \cdot ew\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|\mathsf{fma}\left(-eh, \sin \tan^{-1} \left(\mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right) \cdot \left(-t\right)\right) \cdot t, ew\right)\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if t < -0.0012999999999999999 or 0.00110000000000000007 < t

              1. Initial program 99.7%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
                14. cosh-asinh-revN/A

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

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

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

                  \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
                2. lower-*.f64N/A

                  \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
                3. lower-cos.f6449.5

                  \[\leadsto \left|\color{blue}{\cos t} \cdot ew\right| \]
              7. Applied rewrites49.5%

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

              if -0.0012999999999999999 < t < 0.00110000000000000007

              1. Initial program 100.0%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
                14. cosh-asinh-revN/A

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

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

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

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

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

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\frac{-1}{2} \cdot ew - \frac{1}{2} \cdot \frac{{eh}^{2}}{ew}, {t}^{2}, ew\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
                4. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\mathsf{fma}\left(-1 \cdot eh, \sin \tan^{-1} \left(t \cdot \left(-1 \cdot \left({t}^{2} \cdot \left(\frac{-1}{6} \cdot \frac{eh}{ew} - \frac{-1}{2} \cdot \frac{eh}{ew}\right)\right) + -1 \cdot \frac{eh}{ew}\right)\right) \cdot t, ew\right)\right| \]
              12. Step-by-step derivation
                1. Applied rewrites93.3%

                  \[\leadsto \left|\mathsf{fma}\left(-1 \cdot eh, \sin \tan^{-1} \left(\left(-1 \cdot \mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right)\right) \cdot t\right) \cdot t, ew\right)\right| \]
              13. Recombined 2 regimes into one program.
              14. Final simplification70.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0013 \lor \neg \left(t \leq 0.0011\right):\\ \;\;\;\;\left|\cos t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(-eh, \sin \tan^{-1} \left(\mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right) \cdot \left(-t\right)\right) \cdot t, ew\right)\right|\\ \end{array} \]
              15. Add Preprocessing

              Alternative 9: 62.0% accurate, 8.0× speedup?

              \[\begin{array}{l} \\ \left|\cos t \cdot ew\right| \end{array} \]
              (FPCore (eh ew t) :precision binary64 (fabs (* (cos t) ew)))
              double code(double eh, double ew, double t) {
              	return fabs((cos(t) * ew));
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(eh, ew, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  code = abs((cos(t) * ew))
              end function
              
              public static double code(double eh, double ew, double t) {
              	return Math.abs((Math.cos(t) * ew));
              }
              
              def code(eh, ew, t):
              	return math.fabs((math.cos(t) * ew))
              
              function code(eh, ew, t)
              	return abs(Float64(cos(t) * ew))
              end
              
              function tmp = code(eh, ew, t)
              	tmp = abs((cos(t) * ew));
              end
              
              code[eh_, ew_, t_] := N[Abs[N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \left|\cos t \cdot ew\right|
              \end{array}
              
              Derivation
              1. Initial program 99.8%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\frac{\cos t \cdot ew}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)} + 1}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
                14. cosh-asinh-revN/A

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

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

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

                  \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
                2. lower-*.f64N/A

                  \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
                3. lower-cos.f6458.1

                  \[\leadsto \left|\color{blue}{\cos t} \cdot ew\right| \]
              7. Applied rewrites58.1%

                \[\leadsto \left|\color{blue}{\cos t \cdot ew}\right| \]
              8. Add Preprocessing

              Alternative 10: 22.0% accurate, 172.4× speedup?

              \[\begin{array}{l} \\ -\left(-ew\right) \end{array} \]
              (FPCore (eh ew t) :precision binary64 (- (- ew)))
              double code(double eh, double ew, double t) {
              	return -(-ew);
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(eh, ew, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  code = -(-ew)
              end function
              
              public static double code(double eh, double ew, double t) {
              	return -(-ew);
              }
              
              def code(eh, ew, t):
              	return -(-ew)
              
              function code(eh, ew, t)
              	return Float64(-Float64(-ew))
              end
              
              function tmp = code(eh, ew, t)
              	tmp = -(-ew);
              end
              
              code[eh_, ew_, t_] := (-(-ew))
              
              \begin{array}{l}
              
              \\
              -\left(-ew\right)
              \end{array}
              
              Derivation
              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot \frac{1}{2}, \color{blue}{t \cdot t}, ew\right) \]
                15. lower-*.f6414.8

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.5, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot 0.5, \color{blue}{t \cdot t}, ew\right) \]
              6. Applied rewrites14.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, ew, \frac{eh \cdot eh}{ew}\right) - \frac{eh \cdot eh}{ew} \cdot 0.5, t \cdot t, ew\right)} \]
              7. Taylor expanded in ew around -inf

                \[\leadsto -1 \cdot \color{blue}{\left(ew \cdot \left(\left(\frac{1}{2} \cdot {t}^{2} + \frac{{t}^{2} \cdot \left(-1 \cdot {eh}^{2} - \frac{-1}{2} \cdot {eh}^{2}\right)}{{ew}^{2}}\right) - 1\right)\right)} \]
              8. Step-by-step derivation
                1. Applied rewrites15.2%

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

                  \[\leadsto --1 \cdot ew \]
                3. Step-by-step derivation
                  1. Applied rewrites20.1%

                    \[\leadsto -\left(-ew\right) \]
                  2. Add Preprocessing

                  Reproduce

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