Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 8.8s
Alternatives: 9
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}

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 9 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} \\ \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}
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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\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. 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-cos.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\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. lift-atan.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\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| \]
    4. cos-atanN/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\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| \]
    5. mult-flip-revN/A

      \[\leadsto \left|\color{blue}{\frac{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| \]
    6. div-flipN/A

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

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

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

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

      \[\leadsto \left|\color{blue}{\frac{1}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \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|\frac{1}{\color{blue}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    3. lift-*.f64N/A

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

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

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \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|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    7. lower-/.f6499.8

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

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

Alternative 3: 99.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
\left|\mathsf{fma}\left(\frac{1}{\frac{\cosh t\_1}{\cos t}}, ew, \left(\tanh t\_1 \cdot \sin \left(-t\right)\right) \cdot \left(-eh\right)\right)\right|
\end{array}
\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. 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-cos.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\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. lift-atan.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\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| \]
    4. cos-atanN/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\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| \]
    5. mult-flip-revN/A

      \[\leadsto \left|\color{blue}{\frac{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| \]
    6. div-flipN/A

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

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

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

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

Alternative 4: 98.4% accurate, 1.5× speedup?

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

\\
\left|\frac{ew}{\frac{1}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\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. 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-cos.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\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. lift-atan.f64N/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\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| \]
    4. cos-atanN/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\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| \]
    5. mult-flip-revN/A

      \[\leadsto \left|\color{blue}{\frac{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| \]
    6. div-flipN/A

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

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

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

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

      \[\leadsto \left|\color{blue}{\frac{1}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \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|\frac{1}{\color{blue}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    3. lift-*.f64N/A

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

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

      \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \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|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    7. lower-/.f6499.8

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

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

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

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

    Alternative 5: 91.2% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\tan t}{ew} \cdot eh\\ \mathbf{if}\;ew \leq 6.5 \cdot 10^{+137}:\\ \;\;\;\;\left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left({t\_1}^{2} - -1\right) \cdot \left(\cos t \cdot ew\right)\right|}{\cosh \sinh^{-1} t\_1}\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (* (/ (tan t) ew) eh)))
       (if (<= ew 6.5e+137)
         (fabs
          (-
           (/ ew (/ (cosh (asinh (* (/ t ew) eh))) (cos t)))
           (* (* eh (sin t)) (sin (atan (/ (* (- eh) t) ew))))))
         (/ (fabs (* (- (pow t_1 2.0) -1.0) (* (cos t) ew))) (cosh (asinh t_1))))))
    double code(double eh, double ew, double t) {
    	double t_1 = (tan(t) / ew) * eh;
    	double tmp;
    	if (ew <= 6.5e+137) {
    		tmp = fabs(((ew / (cosh(asinh(((t / ew) * eh))) / cos(t))) - ((eh * sin(t)) * sin(atan(((-eh * t) / ew))))));
    	} else {
    		tmp = fabs(((pow(t_1, 2.0) - -1.0) * (cos(t) * ew))) / cosh(asinh(t_1));
    	}
    	return tmp;
    }
    
    def code(eh, ew, t):
    	t_1 = (math.tan(t) / ew) * eh
    	tmp = 0
    	if ew <= 6.5e+137:
    		tmp = math.fabs(((ew / (math.cosh(math.asinh(((t / ew) * eh))) / math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((-eh * t) / ew))))))
    	else:
    		tmp = math.fabs(((math.pow(t_1, 2.0) - -1.0) * (math.cos(t) * ew))) / math.cosh(math.asinh(t_1))
    	return tmp
    
    function code(eh, ew, t)
    	t_1 = Float64(Float64(tan(t) / ew) * eh)
    	tmp = 0.0
    	if (ew <= 6.5e+137)
    		tmp = abs(Float64(Float64(ew / Float64(cosh(asinh(Float64(Float64(t / ew) * eh))) / cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * t) / ew))))));
    	else
    		tmp = Float64(abs(Float64(Float64((t_1 ^ 2.0) - -1.0) * Float64(cos(t) * ew))) / cosh(asinh(t_1)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(eh, ew, t)
    	t_1 = (tan(t) / ew) * eh;
    	tmp = 0.0;
    	if (ew <= 6.5e+137)
    		tmp = abs(((ew / (cosh(asinh(((t / ew) * eh))) / cos(t))) - ((eh * sin(t)) * sin(atan(((-eh * t) / ew))))));
    	else
    		tmp = abs((((t_1 ^ 2.0) - -1.0) * (cos(t) * ew))) / cosh(asinh(t_1));
    	end
    	tmp_2 = tmp;
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[ew, 6.5e+137], N[Abs[N[(N[(ew / N[(N[Cosh[N[ArcSinh[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Abs[N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{\tan t}{ew} \cdot eh\\
    \mathbf{if}\;ew \leq 6.5 \cdot 10^{+137}:\\
    \;\;\;\;\left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left|\left({t\_1}^{2} - -1\right) \cdot \left(\cos t \cdot ew\right)\right|}{\cosh \sinh^{-1} t\_1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if ew < 6.5000000000000002e137

      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. 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-cos.f64N/A

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\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. lift-atan.f64N/A

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\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| \]
        4. cos-atanN/A

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\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| \]
        5. mult-flip-revN/A

          \[\leadsto \left|\color{blue}{\frac{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| \]
        6. div-flipN/A

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

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

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

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

          \[\leadsto \left|\color{blue}{\frac{1}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \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|\frac{1}{\color{blue}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        3. lift-*.f64N/A

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

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

          \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \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|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        7. lower-/.f6499.8

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

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

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

          \[\leadsto \left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\color{blue}{t}}{ew} \cdot eh\right)}{\cos t}} - \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{ew}{\frac{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \color{blue}{t}}{ew}\right)\right| \]
        3. Step-by-step derivation
          1. Applied rewrites90.1%

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

          if 6.5000000000000002e137 < ew

          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. Step-by-step derivation
            1. lift-cos.f64N/A

              \[\leadsto \left|\left(ew \cdot \color{blue}{\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. sin-+PI/2-revN/A

              \[\leadsto \left|\left(ew \cdot \color{blue}{\sin \left(t + \frac{\mathsf{PI}\left(\right)}{2}\right)}\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. sin-sumN/A

              \[\leadsto \left|\left(ew \cdot \color{blue}{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\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| \]
            4. flip3-+N/A

              \[\leadsto \left|\left(ew \cdot \color{blue}{\frac{{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{3} + {\left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{3}}{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) + \left(\left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}}\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| \]
            5. lower-unsound-/.f64N/A

              \[\leadsto \left|\left(ew \cdot \color{blue}{\frac{{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{3} + {\left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{3}}{\left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) + \left(\left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \left(\sin t \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \left(\cos t \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}}\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. Applied rewrites99.7%

            \[\leadsto \left|\left(ew \cdot \color{blue}{\frac{{\left(\sin t \cdot 0\right)}^{3} + {\left(\cos t \cdot 1\right)}^{3}}{\mathsf{fma}\left(\sin t \cdot 0, \sin t \cdot 0, \left(\cos t \cdot 1\right) \cdot \left(\cos t \cdot 1\right) - \left(\sin t \cdot 0\right) \cdot \left(\cos t \cdot 1\right)\right)}}\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| \]
          4. Applied rewrites76.6%

            \[\leadsto \color{blue}{\frac{\left|\left({\left(\frac{\tan t}{ew} \cdot eh\right)}^{2} - -1\right) \cdot \left(\cos t \cdot ew\right)\right|}{\cosh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)}} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 6: 90.6% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq 1.8 \cdot 10^{+232}:\\ \;\;\;\;\left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (if (<= ew 1.8e+232)
           (fabs
            (-
             (/ ew (/ (cosh (asinh (* (/ t ew) eh))) (cos t)))
             (* (* eh (sin t)) (sin (atan (/ (* (- eh) t) ew))))))
           (fabs (* ew (cos t)))))
        double code(double eh, double ew, double t) {
        	double tmp;
        	if (ew <= 1.8e+232) {
        		tmp = fabs(((ew / (cosh(asinh(((t / ew) * eh))) / cos(t))) - ((eh * sin(t)) * sin(atan(((-eh * t) / ew))))));
        	} else {
        		tmp = fabs((ew * cos(t)));
        	}
        	return tmp;
        }
        
        def code(eh, ew, t):
        	tmp = 0
        	if ew <= 1.8e+232:
        		tmp = math.fabs(((ew / (math.cosh(math.asinh(((t / ew) * eh))) / math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((-eh * t) / ew))))))
        	else:
        		tmp = math.fabs((ew * math.cos(t)))
        	return tmp
        
        function code(eh, ew, t)
        	tmp = 0.0
        	if (ew <= 1.8e+232)
        		tmp = abs(Float64(Float64(ew / Float64(cosh(asinh(Float64(Float64(t / ew) * eh))) / cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-eh) * t) / ew))))));
        	else
        		tmp = abs(Float64(ew * cos(t)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(eh, ew, t)
        	tmp = 0.0;
        	if (ew <= 1.8e+232)
        		tmp = abs(((ew / (cosh(asinh(((t / ew) * eh))) / cos(t))) - ((eh * sin(t)) * sin(atan(((-eh * t) / ew))))));
        	else
        		tmp = abs((ew * cos(t)));
        	end
        	tmp_2 = tmp;
        end
        
        code[eh_, ew_, t_] := If[LessEqual[ew, 1.8e+232], N[Abs[N[(N[(ew / N[(N[Cosh[N[ArcSinh[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;ew \leq 1.8 \cdot 10^{+232}:\\
        \;\;\;\;\left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|ew \cdot \cos t\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < 1.79999999999999996e232

          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. 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-cos.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\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. lift-atan.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\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| \]
            4. cos-atanN/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\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| \]
            5. mult-flip-revN/A

              \[\leadsto \left|\color{blue}{\frac{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| \]
            6. div-flipN/A

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

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

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

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

              \[\leadsto \left|\color{blue}{\frac{1}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \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|\frac{1}{\color{blue}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t \cdot ew}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            3. lift-*.f64N/A

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

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

              \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \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|\color{blue}{\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}{\cos t}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            7. lower-/.f6499.8

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

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

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

              \[\leadsto \left|\frac{ew}{\frac{\cosh \sinh^{-1} \left(\frac{\color{blue}{t}}{ew} \cdot eh\right)}{\cos t}} - \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{ew}{\frac{\cosh \sinh^{-1} \left(\frac{t}{ew} \cdot eh\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \color{blue}{t}}{ew}\right)\right| \]
            3. Step-by-step derivation
              1. Applied rewrites90.1%

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

              if 1.79999999999999996e232 < ew

              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. Applied rewrites82.0%

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

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

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

                  \[\leadsto \left|ew \cdot \cos t\right| \]
              5. Applied rewrites61.8%

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

            Alternative 7: 61.8% accurate, 2.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq 1.9 \cdot 10^{-149}:\\ \;\;\;\;\left|-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (<= ew 1.9e-149)
               (fabs (* -1.0 (* eh (* (sin t) (sin (atan (* -1.0 (/ (* eh t) ew))))))))
               (fabs (* ew (cos t)))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if (ew <= 1.9e-149) {
            		tmp = fabs((-1.0 * (eh * (sin(t) * sin(atan((-1.0 * ((eh * t) / ew))))))));
            	} else {
            		tmp = fabs((ew * cos(t)));
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(eh, ew, t)
            use fmin_fmax_functions
                real(8), intent (in) :: eh
                real(8), intent (in) :: ew
                real(8), intent (in) :: t
                real(8) :: tmp
                if (ew <= 1.9d-149) then
                    tmp = abs(((-1.0d0) * (eh * (sin(t) * sin(atan(((-1.0d0) * ((eh * t) / ew))))))))
                else
                    tmp = abs((ew * cos(t)))
                end if
                code = tmp
            end function
            
            public static double code(double eh, double ew, double t) {
            	double tmp;
            	if (ew <= 1.9e-149) {
            		tmp = Math.abs((-1.0 * (eh * (Math.sin(t) * Math.sin(Math.atan((-1.0 * ((eh * t) / ew))))))));
            	} else {
            		tmp = Math.abs((ew * Math.cos(t)));
            	}
            	return tmp;
            }
            
            def code(eh, ew, t):
            	tmp = 0
            	if ew <= 1.9e-149:
            		tmp = math.fabs((-1.0 * (eh * (math.sin(t) * math.sin(math.atan((-1.0 * ((eh * t) / ew))))))))
            	else:
            		tmp = math.fabs((ew * math.cos(t)))
            	return tmp
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if (ew <= 1.9e-149)
            		tmp = abs(Float64(-1.0 * Float64(eh * Float64(sin(t) * sin(atan(Float64(-1.0 * Float64(Float64(eh * t) / ew))))))));
            	else
            		tmp = abs(Float64(ew * cos(t)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(eh, ew, t)
            	tmp = 0.0;
            	if (ew <= 1.9e-149)
            		tmp = abs((-1.0 * (eh * (sin(t) * sin(atan((-1.0 * ((eh * t) / ew))))))));
            	else
            		tmp = abs((ew * cos(t)));
            	end
            	tmp_2 = tmp;
            end
            
            code[eh_, ew_, t_] := If[LessEqual[ew, 1.9e-149], N[Abs[N[(-1.0 * N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(-1.0 * N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;ew \leq 1.9 \cdot 10^{-149}:\\
            \;\;\;\;\left|-1 \cdot \left(eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot t}{ew}\right)\right)\right)\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;\left|ew \cdot \cos t\right|\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if ew < 1.90000000000000003e-149

              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. Taylor expanded in eh around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 1.90000000000000003e-149 < ew

              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. Applied rewrites82.0%

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

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

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

                  \[\leadsto \left|ew \cdot \cos t\right| \]
              5. Applied rewrites61.8%

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

            Alternative 8: 58.0% accurate, 6.7× speedup?

            \[\begin{array}{l} \\ \left|ew \cdot \cos t\right| \end{array} \]
            (FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
            double code(double eh, double ew, double t) {
            	return fabs((ew * cos(t)));
            }
            
            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((ew * cos(t)))
            end function
            
            public static double code(double eh, double ew, double t) {
            	return Math.abs((ew * Math.cos(t)));
            }
            
            def code(eh, ew, t):
            	return math.fabs((ew * math.cos(t)))
            
            function code(eh, ew, t)
            	return abs(Float64(ew * cos(t)))
            end
            
            function tmp = code(eh, ew, t)
            	tmp = abs((ew * cos(t)));
            end
            
            code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \left|ew \cdot \cos t\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. Applied rewrites82.0%

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

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

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

                \[\leadsto \left|ew \cdot \cos t\right| \]
            5. Applied rewrites61.8%

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

            Alternative 9: 38.1% accurate, 18.9× speedup?

            \[\begin{array}{l} \\ \left|\mathsf{fma}\left(t \cdot t, -0.5, 1\right) \cdot ew\right| \end{array} \]
            (FPCore (eh ew t) :precision binary64 (fabs (* (fma (* t t) -0.5 1.0) ew)))
            double code(double eh, double ew, double t) {
            	return fabs((fma((t * t), -0.5, 1.0) * ew));
            }
            
            function code(eh, ew, t)
            	return abs(Float64(fma(Float64(t * t), -0.5, 1.0) * ew))
            end
            
            code[eh_, ew_, t_] := N[Abs[N[(N[(N[(t * t), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \left|\mathsf{fma}\left(t \cdot t, -0.5, 1\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. Applied rewrites82.0%

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

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

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

                \[\leadsto \left|ew \cdot \cos t\right| \]
            5. Applied rewrites61.8%

              \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
            6. Taylor expanded in t around 0

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

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

                \[\leadsto \left|ew \cdot \left(1 + \frac{-1}{2} \cdot {t}^{\color{blue}{2}}\right)\right| \]
              3. lower-pow.f6438.1

                \[\leadsto \left|ew \cdot \left(1 + -0.5 \cdot {t}^{2}\right)\right| \]
            8. Applied rewrites38.1%

              \[\leadsto \left|ew \cdot \left(1 + \color{blue}{-0.5 \cdot {t}^{2}}\right)\right| \]
            9. Step-by-step derivation
              1. lift-*.f64N/A

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

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

                \[\leadsto \left|\left(1 + -0.5 \cdot {t}^{2}\right) \cdot \color{blue}{ew}\right| \]
              4. lift-+.f64N/A

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

                \[\leadsto \left|\left(\frac{-1}{2} \cdot {t}^{2} + 1\right) \cdot ew\right| \]
              6. lift-*.f64N/A

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

                \[\leadsto \left|\left({t}^{2} \cdot \frac{-1}{2} + 1\right) \cdot ew\right| \]
              8. lower-fma.f6438.1

                \[\leadsto \left|\mathsf{fma}\left({t}^{2}, -0.5, 1\right) \cdot ew\right| \]
              9. lift-pow.f64N/A

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

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \frac{-1}{2}, 1\right) \cdot ew\right| \]
              11. lower-*.f6438.1

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, -0.5, 1\right) \cdot ew\right| \]
            10. Applied rewrites38.1%

              \[\leadsto \color{blue}{\left|\mathsf{fma}\left(t \cdot t, -0.5, 1\right) \cdot ew\right|} \]
            11. Add Preprocessing

            Reproduce

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