Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 8.6s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\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} \]
(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}
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}

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 15 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} 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} \]
(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}
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}

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\mathsf{neg}\left(\color{blue}{\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| \]
    7. distribute-neg-fracN/A

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \color{blue}{\left(\frac{\mathsf{neg}\left(\left(-eh\right) \cdot \tan t\right)}{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-atan.f64N/A

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \cdot \tan t\right)}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    12. distribute-lft-neg-outN/A

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

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

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

      \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\color{blue}{\tan t \cdot eh}}{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.8%

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

Alternative 2: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} t_1 := \frac{\tan t \cdot eh}{ew}\\ \left|\frac{\cos t}{\sqrt{{t\_1}^{2} - -1}} \cdot ew + \sin \tan^{-1} t\_1 \cdot \left(\sin t \cdot eh\right)\right| \end{array} \]
(FPCore (eh ew t)
  :precision binary64
  (let* ((t_1 (/ (* (tan t) eh) ew)))
  (fabs
   (+
    (* (/ (cos t) (sqrt (- (pow t_1 2.0) -1.0))) ew)
    (* (sin (atan t_1)) (* (sin t) eh))))))
double code(double eh, double ew, double t) {
	double t_1 = (tan(t) * eh) / ew;
	return fabs((((cos(t) / sqrt((pow(t_1, 2.0) - -1.0))) * ew) + (sin(atan(t_1)) * (sin(t) * eh))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Alternative 3: 98.4% accurate, 1.6× speedup?

\[\left|\cos t \cdot ew + \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right| \]
(FPCore (eh ew t)
  :precision binary64
  (fabs
 (+
  (* (cos t) ew)
  (* (sin (atan (/ (* (tan t) eh) ew))) (* (sin t) eh)))))
double code(double eh, double ew, double t) {
	return fabs(((cos(t) * ew) + (sin(atan(((tan(t) * eh) / ew))) * (sin(t) * eh))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 2.0× speedup?

\[\left|\cos t \cdot ew + \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right| \]
(FPCore (eh ew t)
  :precision binary64
  (fabs
 (+ (* (cos t) ew) (* (sin (atan (/ (* eh t) ew))) (* (sin t) eh)))))
double code(double eh, double ew, double t) {
	return fabs(((cos(t) * ew) + (sin(atan(((eh * t) / ew))) * (sin(t) * eh))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

    \[\leadsto \left|\frac{\cos t}{\sqrt{{\left(\frac{\color{blue}{eh \cdot t}}{ew}\right)}^{2} - -1}} \cdot ew + \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right| \]
  4. Step-by-step derivation
    1. lower-*.f6489.1%

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

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

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

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

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

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

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

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

Alternative 5: 74.5% accurate, 1.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot \left(-eh\right)\right)\right) \cdot t\_1\right|\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.1999999999999999e-5

    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 rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1999999999999999e-5 < t

    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. Applied rewrites41.4%

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

      \[\leadsto \left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{ew} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right| \]
    7. Step-by-step derivation
      1. lower-/.f6441.6%

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

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

Alternative 6: 67.3% accurate, 1.9× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|ew\right| \leq 9.2 \cdot 10^{-82}:\\ \;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{\left|ew\right|} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{\cos t}{\sqrt{{\left(\frac{eh \cdot t}{\left|ew\right|}\right)}^{2} - -1}} \cdot \left|ew\right| + \left(\frac{eh \cdot t}{\left|ew\right| \cdot \sqrt{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{\left|ew\right| \cdot \left|ew\right|} - -1}} \cdot \sin t\right) \cdot eh\right|\\ \end{array} \]
(FPCore (eh ew t)
  :precision binary64
  (if (<= (fabs ew) 9.2e-82)
  (fabs
   (* (* (- eh) (tanh (asinh (* (/ t (fabs ew)) (- eh))))) (sin t)))
  (fabs
   (+
    (*
     (/ (cos t) (sqrt (- (pow (/ (* eh t) (fabs ew)) 2.0) -1.0)))
     (fabs ew))
    (*
     (*
      (/
       (* eh t)
       (*
        (fabs ew)
        (sqrt
         (- (/ (* (* eh t) (* eh t)) (* (fabs ew) (fabs ew))) -1.0))))
      (sin t))
     eh)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (fabs(ew) <= 9.2e-82) {
		tmp = fabs(((-eh * tanh(asinh(((t / fabs(ew)) * -eh)))) * sin(t)));
	} else {
		tmp = fabs((((cos(t) / sqrt((pow(((eh * t) / fabs(ew)), 2.0) - -1.0))) * fabs(ew)) + ((((eh * t) / (fabs(ew) * sqrt(((((eh * t) * (eh * t)) / (fabs(ew) * fabs(ew))) - -1.0)))) * sin(t)) * eh)));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if math.fabs(ew) <= 9.2e-82:
		tmp = math.fabs(((-eh * math.tanh(math.asinh(((t / math.fabs(ew)) * -eh)))) * math.sin(t)))
	else:
		tmp = math.fabs((((math.cos(t) / math.sqrt((math.pow(((eh * t) / math.fabs(ew)), 2.0) - -1.0))) * math.fabs(ew)) + ((((eh * t) / (math.fabs(ew) * math.sqrt(((((eh * t) * (eh * t)) / (math.fabs(ew) * math.fabs(ew))) - -1.0)))) * math.sin(t)) * eh)))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (abs(ew) <= 9.2e-82)
		tmp = abs(Float64(Float64(Float64(-eh) * tanh(asinh(Float64(Float64(t / abs(ew)) * Float64(-eh))))) * sin(t)));
	else
		tmp = abs(Float64(Float64(Float64(cos(t) / sqrt(Float64((Float64(Float64(eh * t) / abs(ew)) ^ 2.0) - -1.0))) * abs(ew)) + Float64(Float64(Float64(Float64(eh * t) / Float64(abs(ew) * sqrt(Float64(Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(abs(ew) * abs(ew))) - -1.0)))) * sin(t)) * eh)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (abs(ew) <= 9.2e-82)
		tmp = abs(((-eh * tanh(asinh(((t / abs(ew)) * -eh)))) * sin(t)));
	else
		tmp = abs((((cos(t) / sqrt(((((eh * t) / abs(ew)) ^ 2.0) - -1.0))) * abs(ew)) + ((((eh * t) / (abs(ew) * sqrt(((((eh * t) * (eh * t)) / (abs(ew) * abs(ew))) - -1.0)))) * sin(t)) * eh)));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[ew], $MachinePrecision], 9.2e-82], N[Abs[N[(N[((-eh) * N[Tanh[N[ArcSinh[N[(N[(t / N[Abs[ew], $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * t), $MachinePrecision] / N[Abs[ew], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(eh * t), $MachinePrecision] / N[(N[Abs[ew], $MachinePrecision] * N[Sqrt[N[(N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[ew], $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|ew\right| \leq 9.2 \cdot 10^{-82}:\\
\;\;\;\;\left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{\left|ew\right|} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right|\\

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


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

    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. Applied rewrites41.4%

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

      \[\leadsto \left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{ew} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right| \]
    7. Step-by-step derivation
      1. lower-/.f6441.6%

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

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

    if 9.1999999999999999e-82 < 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 rewrites99.8%

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

      \[\leadsto \left|\frac{\cos t}{\sqrt{{\left(\frac{\color{blue}{eh \cdot t}}{ew}\right)}^{2} - -1}} \cdot ew + \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right| \]
    4. Step-by-step derivation
      1. lower-*.f6489.1%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.3% accurate, 2.4× speedup?

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

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


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

    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. Applied rewrites41.4%

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

      \[\leadsto \left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{ew} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right| \]
    7. Step-by-step derivation
      1. lower-/.f6441.6%

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

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

    if 9.1999999999999999e-82 < 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 rewrites99.8%

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

      \[\leadsto \left|\frac{\cos t}{\sqrt{{\left(\frac{\color{blue}{eh \cdot t}}{ew}\right)}^{2} - -1}} \cdot ew + \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{ew}\right) \cdot \left(\sin t \cdot eh\right)\right| \]
    4. Step-by-step derivation
      1. lower-*.f6489.1%

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

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

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

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

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

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

    Alternative 8: 61.2% accurate, 2.5× speedup?

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

      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|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.1999999999999999e-5 < t

      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. Applied rewrites41.4%

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

        \[\leadsto \left|\left(\left(-eh\right) \cdot \tanh \sinh^{-1} \left(\frac{t}{ew} \cdot \left(-eh\right)\right)\right) \cdot \sin t\right| \]
      7. Step-by-step derivation
        1. lower-/.f6441.6%

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

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

    Alternative 9: 49.7% accurate, 2.8× speedup?

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

      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|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.1999999999999999e-5 < t

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

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

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

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

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

          \[\leadsto \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 \frac{\color{blue}{\frac{\mathsf{neg}\left(\left(-eh\right) \cdot \tan t\right)}{\mathsf{neg}\left(ew\right)}}}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
        6. associate-/l/N/A

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

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

          \[\leadsto \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 \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \cdot \tan t\right)}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
        9. distribute-lft-neg-outN/A

          \[\leadsto \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 \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(eh \cdot \tan t\right)\right)}\right)}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
        10. remove-double-negN/A

          \[\leadsto \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 \frac{\color{blue}{eh \cdot \tan t}}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
        11. *-commutativeN/A

          \[\leadsto \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 \frac{\color{blue}{\tan t \cdot eh}}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
        12. times-fracN/A

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

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

        \[\leadsto \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 \color{blue}{\left(\frac{\tan t}{-ew} \cdot \frac{eh}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} - -1}}\right)}\right| \]
      4. Taylor expanded in eh around inf

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

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

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

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

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

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

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

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

          \[\leadsto \left|\frac{eh \cdot {\sin t}^{2}}{ew \cdot \left(\cos t \cdot \sqrt{\frac{{\sin t}^{2}}{{ew}^{2} \cdot {\cos t}^{2}}}\right)}\right| \]
      6. Applied rewrites19.8%

        \[\leadsto \left|\color{blue}{\frac{eh \cdot {\sin t}^{2}}{ew \cdot \left(\cos t \cdot \sqrt{\frac{{\sin t}^{2}}{{ew}^{2} \cdot {\cos t}^{2}}}\right)}}\right| \]
      7. Applied rewrites14.6%

        \[\leadsto \left|\frac{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)\right) \cdot eh}{\color{blue}{\left(\cos t \cdot ew\right) \cdot \frac{\sqrt{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)}{ew \cdot ew}}}{\left|\cos t\right|}}}\right| \]
      8. Taylor expanded in t around 0

        \[\leadsto \left|\frac{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)\right) \cdot eh}{\left(1 \cdot ew\right) \cdot \frac{\sqrt{\color{blue}{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)}{ew \cdot ew}}}}{\left|\cos t\right|}}\right| \]
      9. Step-by-step derivation
        1. Applied rewrites5.0%

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

          \[\leadsto \left|\frac{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)\right) \cdot eh}{\left(1 \cdot ew\right) \cdot \frac{\sqrt{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)}{ew \cdot ew}}}{\left|1\right|}}\right| \]
        3. Step-by-step derivation
          1. Applied rewrites14.6%

            \[\leadsto \left|\frac{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)\right) \cdot eh}{\left(1 \cdot ew\right) \cdot \frac{\sqrt{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot t\right)}{ew \cdot ew}}}{\left|1\right|}}\right| \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 10: 41.6% accurate, 3.5× speedup?

        \[\left|\frac{ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} - -1}}\right| \]
        (FPCore (eh ew t)
          :precision binary64
          (fabs (/ ew (sqrt (- (pow (/ (* (tan t) eh) ew) 2.0) -1.0)))))
        double code(double eh, double ew, double t) {
        	return fabs((ew / sqrt((pow(((tan(t) * eh) / ew), 2.0) - -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((ew / sqrt(((((tan(t) * eh) / ew) ** 2.0d0) - (-1.0d0)))))
        end function
        
        public static double code(double eh, double ew, double t) {
        	return Math.abs((ew / Math.sqrt((Math.pow(((Math.tan(t) * eh) / ew), 2.0) - -1.0))));
        }
        
        def code(eh, ew, t):
        	return math.fabs((ew / math.sqrt((math.pow(((math.tan(t) * eh) / ew), 2.0) - -1.0))))
        
        function code(eh, ew, t)
        	return abs(Float64(ew / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) - -1.0))))
        end
        
        function tmp = code(eh, ew, t)
        	tmp = abs((ew / sqrt(((((tan(t) * eh) / ew) ^ 2.0) - -1.0))));
        end
        
        code[eh_, ew_, t_] := N[Abs[N[(ew / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
        
        \left|\frac{ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} - -1}}\right|
        
        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. 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|\color{blue}{ew \cdot \cos \tan^{-1} \left(-1 \cdot \frac{eh \cdot \sin t}{ew \cdot \cos t}\right)}\right| \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 11: 40.6% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 12: 11.2% accurate, 5.9× speedup?

        \[\left|\frac{eh \cdot t}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}\right| \]
        (FPCore (eh ew t)
          :precision binary64
          (fabs (/ (* eh t) (* ew (sqrt (/ 1.0 (pow ew 2.0)))))))
        double code(double eh, double ew, double t) {
        	return fabs(((eh * t) / (ew * sqrt((1.0 / pow(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 * t) / (ew * sqrt((1.0d0 / (ew ** 2.0d0))))))
        end function
        
        public static double code(double eh, double ew, double t) {
        	return Math.abs(((eh * t) / (ew * Math.sqrt((1.0 / Math.pow(ew, 2.0))))));
        }
        
        def code(eh, ew, t):
        	return math.fabs(((eh * t) / (ew * math.sqrt((1.0 / math.pow(ew, 2.0))))))
        
        function code(eh, ew, t)
        	return abs(Float64(Float64(eh * t) / Float64(ew * sqrt(Float64(1.0 / (ew ^ 2.0))))))
        end
        
        function tmp = code(eh, ew, t)
        	tmp = abs(((eh * t) / (ew * sqrt((1.0 / (ew ^ 2.0))))));
        end
        
        code[eh_, ew_, t_] := N[Abs[N[(N[(eh * t), $MachinePrecision] / N[(ew * N[Sqrt[N[(1.0 / N[Power[ew, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
        
        \left|\frac{eh \cdot t}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}\right|
        
        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-sin.f64N/A

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

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

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

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

            \[\leadsto \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 \frac{\color{blue}{\frac{\mathsf{neg}\left(\left(-eh\right) \cdot \tan t\right)}{\mathsf{neg}\left(ew\right)}}}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
          6. associate-/l/N/A

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

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

            \[\leadsto \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 \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \cdot \tan t\right)}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
          9. distribute-lft-neg-outN/A

            \[\leadsto \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 \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(eh \cdot \tan t\right)\right)}\right)}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
          10. remove-double-negN/A

            \[\leadsto \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 \frac{\color{blue}{eh \cdot \tan t}}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
          11. *-commutativeN/A

            \[\leadsto \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 \frac{\color{blue}{\tan t \cdot eh}}{\left(\mathsf{neg}\left(ew\right)\right) \cdot \sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}\right| \]
          12. times-fracN/A

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

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

          \[\leadsto \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 \color{blue}{\left(\frac{\tan t}{-ew} \cdot \frac{eh}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} - -1}}\right)}\right| \]
        4. Taylor expanded in eh around inf

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

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

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

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

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

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

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

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

            \[\leadsto \left|\frac{eh \cdot {\sin t}^{2}}{ew \cdot \left(\cos t \cdot \sqrt{\frac{{\sin t}^{2}}{{ew}^{2} \cdot {\cos t}^{2}}}\right)}\right| \]
        6. Applied rewrites19.8%

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

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

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

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

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

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

            \[\leadsto \left|\frac{eh \cdot t}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}\right| \]
          6. lower-pow.f6411.2%

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

          \[\leadsto \left|\frac{eh \cdot t}{\color{blue}{ew \cdot \sqrt{\frac{1}{{ew}^{2}}}}}\right| \]
        10. Add Preprocessing

        Alternative 13: 4.6% accurate, 22.1× speedup?

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

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

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

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{eh \cdot {t}^{2}}{ew}\right)\right)\right| \]
          4. lower-pow.f644.5%

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

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{eh \cdot {t}^{2}}{ew}\right)\right)\right| \]
          3. unpow2N/A

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{eh \cdot \left(t \cdot t\right)}{ew}\right)\right)\right| \]
          4. associate-*r*N/A

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{\left(eh \cdot t\right) \cdot t}{ew}\right)\right)\right| \]
          6. lower-*.f644.6%

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{\left(eh \cdot t\right) \cdot t}{ew}\right)\right)\right| \]
        10. Applied rewrites4.6%

          \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{\left(eh \cdot t\right) \cdot t}{ew}\right)\right)\right| \]
        11. Add Preprocessing

        Alternative 14: 4.5% accurate, 23.9× speedup?

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

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

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

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{eh \cdot {t}^{2}}{ew}\right)\right)\right| \]
          4. lower-pow.f644.5%

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

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(\mathsf{neg}\left(\frac{eh \cdot {t}^{2}}{ew}\right)\right)\right)\right| \]
          3. lift-/.f64N/A

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(\mathsf{neg}\left(\frac{eh \cdot {t}^{2}}{ew}\right)\right)\right)\right| \]
          4. distribute-neg-fracN/A

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

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \frac{\mathsf{neg}\left({t}^{2} \cdot eh\right)}{ew}\right)\right| \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \left|-1 \cdot \left(eh \cdot \frac{{t}^{2} \cdot \left(\mathsf{neg}\left(eh\right)\right)}{ew}\right)\right| \]
          9. lift-neg.f64N/A

            \[\leadsto \left|-1 \cdot \left(eh \cdot \frac{{t}^{2} \cdot \left(-eh\right)}{ew}\right)\right| \]
          10. lower-*.f644.5%

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \frac{\left(t \cdot t\right) \cdot \left(-eh\right)}{ew}\right)\right| \]
          13. lower-*.f644.5%

            \[\leadsto \left|-1 \cdot \left(eh \cdot \frac{\left(t \cdot t\right) \cdot \left(-eh\right)}{ew}\right)\right| \]
        10. Applied rewrites4.5%

          \[\leadsto \left|-1 \cdot \left(eh \cdot \frac{\left(t \cdot t\right) \cdot \left(-eh\right)}{ew}\right)\right| \]
        11. Add Preprocessing

        Alternative 15: 4.4% accurate, 26.1× speedup?

        \[\left|\left(-\left(-eh\right) \cdot \frac{t \cdot t}{ew}\right) \cdot eh\right| \]
        (FPCore (eh ew t)
          :precision binary64
          (fabs (* (- (* (- eh) (/ (* t t) ew))) eh)))
        double code(double eh, double ew, double t) {
        	return fabs((-(-eh * ((t * t) / ew)) * eh));
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(eh, ew, t)
        use fmin_fmax_functions
            real(8), intent (in) :: eh
            real(8), intent (in) :: ew
            real(8), intent (in) :: t
            code = abs((-(-eh * ((t * t) / ew)) * eh))
        end function
        
        public static double code(double eh, double ew, double t) {
        	return Math.abs((-(-eh * ((t * t) / ew)) * eh));
        }
        
        def code(eh, ew, t):
        	return math.fabs((-(-eh * ((t * t) / ew)) * eh))
        
        function code(eh, ew, t)
        	return abs(Float64(Float64(-Float64(Float64(-eh) * Float64(Float64(t * t) / ew))) * eh))
        end
        
        function tmp = code(eh, ew, t)
        	tmp = abs((-(-eh * ((t * t) / ew)) * eh));
        end
        
        code[eh_, ew_, t_] := N[Abs[N[((-N[((-eh) * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]) * eh), $MachinePrecision]], $MachinePrecision]
        
        \left|\left(-\left(-eh\right) \cdot \frac{t \cdot t}{ew}\right) \cdot eh\right|
        
        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. 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. Applied rewrites19.0%

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

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

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

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

            \[\leadsto \left|-1 \cdot \left(eh \cdot \left(-1 \cdot \frac{eh \cdot {t}^{2}}{ew}\right)\right)\right| \]
          4. lower-pow.f644.5%

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

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

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

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

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

            \[\leadsto \left|\mathsf{neg}\left(\left(-1 \cdot \frac{eh \cdot {t}^{2}}{ew}\right) \cdot eh\right)\right| \]
          5. distribute-lft-neg-inN/A

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

            \[\leadsto \left|\left(\mathsf{neg}\left(-1 \cdot \frac{eh \cdot {t}^{2}}{ew}\right)\right) \cdot \color{blue}{eh}\right| \]
        10. Applied rewrites4.4%

          \[\leadsto \left|\left(-\left(-eh\right) \cdot \frac{t \cdot t}{ew}\right) \cdot \color{blue}{eh}\right| \]
        11. Add Preprocessing

        Reproduce

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