Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.4s
Alternatives: 18
Speedup: N/A×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

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

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

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

Alternative 2: 88.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := ew \cdot \cos t\\
t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_4 := \sin t\_3\\
\mathbf{if}\;t\_2 \cdot \cos t\_3 - t\_1 \cdot t\_4 \leq -5 \cdot 10^{-269}:\\
\;\;\;\;\left|\frac{t\_2 + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\cos t}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}, ew, t\_4 \cdot \left(-t\_1\right)\right)\\


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

    1. Initial program 99.8%

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

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

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

    1. Initial program 99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \leq -5 \cdot 10^{-269}:\\ \;\;\;\;\left|\frac{ew \cdot \cos t + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\cos t}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}, ew, \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(-\sin t \cdot eh\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 51.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(\sin t \cdot eh\right) \cdot \sin t\_2 \leq 10^{-106}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* ew (cos t))) (t_2 (atan (/ (* (- eh) (tan t)) ew))))
   (if (<= (- (* t_1 (cos t_2)) (* (* (sin t) eh) (sin t_2))) 1e-106)
     (fabs ew)
     t_1)))
double code(double eh, double ew, double t) {
	double t_1 = ew * cos(t);
	double t_2 = atan(((-eh * tan(t)) / ew));
	double tmp;
	if (((t_1 * cos(t_2)) - ((sin(t) * eh) * sin(t_2))) <= 1e-106) {
		tmp = fabs(ew);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ew * cos(t)
    t_2 = atan(((-eh * tan(t)) / ew))
    if (((t_1 * cos(t_2)) - ((sin(t) * eh) * sin(t_2))) <= 1d-106) then
        tmp = abs(ew)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = ew * Math.cos(t);
	double t_2 = Math.atan(((-eh * Math.tan(t)) / ew));
	double tmp;
	if (((t_1 * Math.cos(t_2)) - ((Math.sin(t) * eh) * Math.sin(t_2))) <= 1e-106) {
		tmp = Math.abs(ew);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = ew * math.cos(t)
	t_2 = math.atan(((-eh * math.tan(t)) / ew))
	tmp = 0
	if ((t_1 * math.cos(t_2)) - ((math.sin(t) * eh) * math.sin(t_2))) <= 1e-106:
		tmp = math.fabs(ew)
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = Float64(ew * cos(t))
	t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	tmp = 0.0
	if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(sin(t) * eh) * sin(t_2))) <= 1e-106)
		tmp = abs(ew);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = ew * cos(t);
	t_2 = atan(((-eh * tan(t)) / ew));
	tmp = 0.0;
	if (((t_1 * cos(t_2)) - ((sin(t) * eh) * sin(t_2))) <= 1e-106)
		tmp = abs(ew);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-106], N[Abs[ew], $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6443.5

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites43.5%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6443.6

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites43.6%

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

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

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      2. lower-cos.f6464.9

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

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

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

Alternative 4: 76.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\ \mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 10^{-111}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;ew \leq 5.1 \cdot 10^{+75}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(ew, ew \cdot \cos t, \left(eh \cdot eh\right) \cdot \left(\sin t \cdot \tan t\right)\right)\right|}{ew \cdot \sqrt{{\left(eh \cdot \frac{\tan t}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1
         (fabs
          (fma (cos t) ew (* eh (* (* eh 0.5) (* (tan t) (/ (sin t) ew))))))))
   (if (<= ew -6.7e-32)
     t_1
     (if (<= ew 1e-111)
       (fabs (* (sin t) eh))
       (if (<= ew 5.1e+75)
         (/
          (fabs (fma ew (* ew (cos t)) (* (* eh eh) (* (sin t) (tan t)))))
          (* ew (sqrt (+ (pow (* eh (/ (tan t) ew)) 2.0) 1.0))))
         t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = fabs(fma(cos(t), ew, (eh * ((eh * 0.5) * (tan(t) * (sin(t) / ew))))));
	double tmp;
	if (ew <= -6.7e-32) {
		tmp = t_1;
	} else if (ew <= 1e-111) {
		tmp = fabs((sin(t) * eh));
	} else if (ew <= 5.1e+75) {
		tmp = fabs(fma(ew, (ew * cos(t)), ((eh * eh) * (sin(t) * tan(t))))) / (ew * sqrt((pow((eh * (tan(t) / ew)), 2.0) + 1.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = abs(fma(cos(t), ew, Float64(eh * Float64(Float64(eh * 0.5) * Float64(tan(t) * Float64(sin(t) / ew))))))
	tmp = 0.0
	if (ew <= -6.7e-32)
		tmp = t_1;
	elseif (ew <= 1e-111)
		tmp = abs(Float64(sin(t) * eh));
	elseif (ew <= 5.1e+75)
		tmp = Float64(abs(fma(ew, Float64(ew * cos(t)), Float64(Float64(eh * eh) * Float64(sin(t) * tan(t))))) / Float64(ew * sqrt(Float64((Float64(eh * Float64(tan(t) / ew)) ^ 2.0) + 1.0))));
	else
		tmp = t_1;
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Cos[t], $MachinePrecision] * ew + N[(eh * N[(N[(eh * 0.5), $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -6.7e-32], t$95$1, If[LessEqual[ew, 1e-111], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 5.1e+75], N[(N[Abs[N[(ew * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * eh), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(ew * N[Sqrt[N[(N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\
\mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;ew \leq 10^{-111}:\\
\;\;\;\;\left|\sin t \cdot eh\right|\\

\mathbf{elif}\;ew \leq 5.1 \cdot 10^{+75}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(ew, ew \cdot \cos t, \left(eh \cdot eh\right) \cdot \left(\sin t \cdot \tan t\right)\right)\right|}{ew \cdot \sqrt{{\left(eh \cdot \frac{\tan t}{ew}\right)}^{2} + 1}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if ew < -6.7e-32 or 5.10000000000000037e75 < 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. Add Preprocessing
    3. Applied rewrites84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(eh \cdot eh, 0.5 \cdot \frac{{\sin t}^{2}}{ew \cdot \cos t}, ew \cdot \color{blue}{\cos t}\right)\right| \]
    6. Applied rewrites70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.7e-32 < ew < 1.00000000000000009e-111

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites72.7%

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

    if 1.00000000000000009e-111 < ew < 5.10000000000000037e75

    1. Initial program 99.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\ \mathbf{elif}\;ew \leq 10^{-111}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;ew \leq 5.1 \cdot 10^{+75}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(ew, ew \cdot \cos t, \left(eh \cdot eh\right) \cdot \left(\sin t \cdot \tan t\right)\right)\right|}{ew \cdot \sqrt{{\left(eh \cdot \frac{\tan t}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;eh \leq 6.2 \cdot 10^{+112}:\\ \;\;\;\;\left|\frac{ew \cdot \cos t + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh)))
   (if (<= eh -1.45e+149)
     (fabs t_1)
     (if (<= eh 6.2e+112)
       (fabs
        (/
         (+ (* ew (cos t)) (* eh (* (sin t) (* eh (/ (tan t) ew)))))
         (sqrt (+ (pow (* eh (/ (tan t) (- ew))) 2.0) 1.0))))
       (/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double tmp;
	if (eh <= -1.45e+149) {
		tmp = fabs(t_1);
	} else if (eh <= 6.2e+112) {
		tmp = fabs((((ew * cos(t)) + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((pow((eh * (tan(t) / -ew)), 2.0) + 1.0))));
	} else {
		tmp = 1.0 / fabs((1.0 / t_1));
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sin(t) * eh
    if (eh <= (-1.45d+149)) then
        tmp = abs(t_1)
    else if (eh <= 6.2d+112) then
        tmp = abs((((ew * cos(t)) + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((((eh * (tan(t) / -ew)) ** 2.0d0) + 1.0d0))))
    else
        tmp = 1.0d0 / abs((1.0d0 / t_1))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.sin(t) * eh;
	double tmp;
	if (eh <= -1.45e+149) {
		tmp = Math.abs(t_1);
	} else if (eh <= 6.2e+112) {
		tmp = Math.abs((((ew * Math.cos(t)) + (eh * (Math.sin(t) * (eh * (Math.tan(t) / ew))))) / Math.sqrt((Math.pow((eh * (Math.tan(t) / -ew)), 2.0) + 1.0))));
	} else {
		tmp = 1.0 / Math.abs((1.0 / t_1));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.sin(t) * eh
	tmp = 0
	if eh <= -1.45e+149:
		tmp = math.fabs(t_1)
	elif eh <= 6.2e+112:
		tmp = math.fabs((((ew * math.cos(t)) + (eh * (math.sin(t) * (eh * (math.tan(t) / ew))))) / math.sqrt((math.pow((eh * (math.tan(t) / -ew)), 2.0) + 1.0))))
	else:
		tmp = 1.0 / math.fabs((1.0 / t_1))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	tmp = 0.0
	if (eh <= -1.45e+149)
		tmp = abs(t_1);
	elseif (eh <= 6.2e+112)
		tmp = abs(Float64(Float64(Float64(ew * cos(t)) + Float64(eh * Float64(sin(t) * Float64(eh * Float64(tan(t) / ew))))) / sqrt(Float64((Float64(eh * Float64(tan(t) / Float64(-ew))) ^ 2.0) + 1.0))));
	else
		tmp = Float64(1.0 / abs(Float64(1.0 / t_1)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = sin(t) * eh;
	tmp = 0.0;
	if (eh <= -1.45e+149)
		tmp = abs(t_1);
	elseif (eh <= 6.2e+112)
		tmp = abs((((ew * cos(t)) + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((((eh * (tan(t) / -ew)) ^ 2.0) + 1.0))));
	else
		tmp = 1.0 / abs((1.0 / t_1));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -1.45e+149], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 6.2e+112], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\
\;\;\;\;\left|t\_1\right|\\

\mathbf{elif}\;eh \leq 6.2 \cdot 10^{+112}:\\
\;\;\;\;\left|\frac{ew \cdot \cos t + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -1.4500000000000001e149

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6467.1

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites67.1%

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

    if -1.4500000000000001e149 < eh < 6.19999999999999965e112

    1. Initial program 99.7%

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

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

    if 6.19999999999999965e112 < eh

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \sin t}}\right|} \]
      3. lower-sin.f6481.1

        \[\leadsto \frac{1}{\left|\frac{1}{eh \cdot \color{blue}{\sin t}}\right|} \]
    6. Applied rewrites81.1%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 6.2 \cdot 10^{+112}:\\ \;\;\;\;\left|\frac{ew \cdot \cos t + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin t \cdot eh}\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 82.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+112}:\\ \;\;\;\;\left|\frac{ew \cdot \cos t + \frac{\sin t \cdot \left(\tan t \cdot \left(eh \cdot eh\right)\right)}{ew}}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh)))
   (if (<= eh -1.45e+149)
     (fabs t_1)
     (if (<= eh 5.8e+112)
       (fabs
        (/
         (+ (* ew (cos t)) (/ (* (sin t) (* (tan t) (* eh eh))) ew))
         (sqrt (+ (pow (/ (* eh (tan t)) ew) 2.0) 1.0))))
       (/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double tmp;
	if (eh <= -1.45e+149) {
		tmp = fabs(t_1);
	} else if (eh <= 5.8e+112) {
		tmp = fabs((((ew * cos(t)) + ((sin(t) * (tan(t) * (eh * eh))) / ew)) / sqrt((pow(((eh * tan(t)) / ew), 2.0) + 1.0))));
	} else {
		tmp = 1.0 / fabs((1.0 / t_1));
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sin(t) * eh
    if (eh <= (-1.45d+149)) then
        tmp = abs(t_1)
    else if (eh <= 5.8d+112) then
        tmp = abs((((ew * cos(t)) + ((sin(t) * (tan(t) * (eh * eh))) / ew)) / sqrt(((((eh * tan(t)) / ew) ** 2.0d0) + 1.0d0))))
    else
        tmp = 1.0d0 / abs((1.0d0 / t_1))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.sin(t) * eh;
	double tmp;
	if (eh <= -1.45e+149) {
		tmp = Math.abs(t_1);
	} else if (eh <= 5.8e+112) {
		tmp = Math.abs((((ew * Math.cos(t)) + ((Math.sin(t) * (Math.tan(t) * (eh * eh))) / ew)) / Math.sqrt((Math.pow(((eh * Math.tan(t)) / ew), 2.0) + 1.0))));
	} else {
		tmp = 1.0 / Math.abs((1.0 / t_1));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.sin(t) * eh
	tmp = 0
	if eh <= -1.45e+149:
		tmp = math.fabs(t_1)
	elif eh <= 5.8e+112:
		tmp = math.fabs((((ew * math.cos(t)) + ((math.sin(t) * (math.tan(t) * (eh * eh))) / ew)) / math.sqrt((math.pow(((eh * math.tan(t)) / ew), 2.0) + 1.0))))
	else:
		tmp = 1.0 / math.fabs((1.0 / t_1))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	tmp = 0.0
	if (eh <= -1.45e+149)
		tmp = abs(t_1);
	elseif (eh <= 5.8e+112)
		tmp = abs(Float64(Float64(Float64(ew * cos(t)) + Float64(Float64(sin(t) * Float64(tan(t) * Float64(eh * eh))) / ew)) / sqrt(Float64((Float64(Float64(eh * tan(t)) / ew) ^ 2.0) + 1.0))));
	else
		tmp = Float64(1.0 / abs(Float64(1.0 / t_1)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = sin(t) * eh;
	tmp = 0.0;
	if (eh <= -1.45e+149)
		tmp = abs(t_1);
	elseif (eh <= 5.8e+112)
		tmp = abs((((ew * cos(t)) + ((sin(t) * (tan(t) * (eh * eh))) / ew)) / sqrt(((((eh * tan(t)) / ew) ^ 2.0) + 1.0))));
	else
		tmp = 1.0 / abs((1.0 / t_1));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -1.45e+149], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 5.8e+112], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(eh * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\
\;\;\;\;\left|t\_1\right|\\

\mathbf{elif}\;eh \leq 5.8 \cdot 10^{+112}:\\
\;\;\;\;\left|\frac{ew \cdot \cos t + \frac{\sin t \cdot \left(\tan t \cdot \left(eh \cdot eh\right)\right)}{ew}}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\right|\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -1.4500000000000001e149

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6467.1

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites67.1%

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

    if -1.4500000000000001e149 < eh < 5.8000000000000004e112

    1. Initial program 99.7%

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

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

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

    if 5.8000000000000004e112 < eh

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \sin t}}\right|} \]
      3. lower-sin.f6481.1

        \[\leadsto \frac{1}{\left|\frac{1}{eh \cdot \color{blue}{\sin t}}\right|} \]
    6. Applied rewrites81.1%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 5.8 \cdot 10^{+112}:\\ \;\;\;\;\left|\frac{ew \cdot \cos t + \frac{\sin t \cdot \left(\tan t \cdot \left(eh \cdot eh\right)\right)}{ew}}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin t \cdot eh}\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 82.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -6.2 \cdot 10^{+111}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;eh \leq 5.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(\sin t, \tan t \cdot \frac{eh \cdot eh}{ew}, ew \cdot \cos t\right)\right|}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh)))
   (if (<= eh -6.2e+111)
     (fabs t_1)
     (if (<= eh 5.5e+112)
       (/
        (fabs (fma (sin t) (* (tan t) (/ (* eh eh) ew)) (* ew (cos t))))
        (sqrt (+ (pow (/ (* eh (tan t)) ew) 2.0) 1.0)))
       (/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double tmp;
	if (eh <= -6.2e+111) {
		tmp = fabs(t_1);
	} else if (eh <= 5.5e+112) {
		tmp = fabs(fma(sin(t), (tan(t) * ((eh * eh) / ew)), (ew * cos(t)))) / sqrt((pow(((eh * tan(t)) / ew), 2.0) + 1.0));
	} else {
		tmp = 1.0 / fabs((1.0 / t_1));
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	tmp = 0.0
	if (eh <= -6.2e+111)
		tmp = abs(t_1);
	elseif (eh <= 5.5e+112)
		tmp = Float64(abs(fma(sin(t), Float64(tan(t) * Float64(Float64(eh * eh) / ew)), Float64(ew * cos(t)))) / sqrt(Float64((Float64(Float64(eh * tan(t)) / ew) ^ 2.0) + 1.0)));
	else
		tmp = Float64(1.0 / abs(Float64(1.0 / t_1)));
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -6.2e+111], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 5.5e+112], N[(N[Abs[N[(N[Sin[t], $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(N[(eh * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] + N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -6.2 \cdot 10^{+111}:\\
\;\;\;\;\left|t\_1\right|\\

\mathbf{elif}\;eh \leq 5.5 \cdot 10^{+112}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(\sin t, \tan t \cdot \frac{eh \cdot eh}{ew}, ew \cdot \cos t\right)\right|}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -6.2000000000000001e111

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6466.0

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites66.0%

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

    if -6.2000000000000001e111 < eh < 5.50000000000000026e112

    1. Initial program 99.7%

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

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

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

    if 5.50000000000000026e112 < eh

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \sin t}}\right|} \]
      3. lower-sin.f6481.1

        \[\leadsto \frac{1}{\left|\frac{1}{eh \cdot \color{blue}{\sin t}}\right|} \]
    6. Applied rewrites81.1%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -6.2 \cdot 10^{+111}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 5.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{\left|\mathsf{fma}\left(\sin t, \tan t \cdot \frac{eh \cdot eh}{ew}, ew \cdot \cos t\right)\right|}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin t \cdot eh}\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.3% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\
\;\;\;\;\left|t\_1\right|\\

\mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\
\;\;\;\;\left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -8.99999999999999981e93

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites65.5%

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

    if -8.99999999999999981e93 < eh < 2.34999999999999999e112

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.34999999999999999e112 < eh

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \sin t}}\right|} \]
      3. lower-sin.f6481.1

        \[\leadsto \frac{1}{\left|\frac{1}{eh \cdot \color{blue}{\sin t}}\right|} \]
    6. Applied rewrites81.1%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\ \;\;\;\;\left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin t \cdot eh}\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.1% accurate, 6.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\ \;\;\;\;\left|t\_1\right|\\ \mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh)))
   (if (<= eh -9e+93)
     (fabs t_1)
     (if (<= eh 2.35e+112) (fabs (* ew (cos t))) (/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double tmp;
	if (eh <= -9e+93) {
		tmp = fabs(t_1);
	} else if (eh <= 2.35e+112) {
		tmp = fabs((ew * cos(t)));
	} else {
		tmp = 1.0 / fabs((1.0 / t_1));
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sin(t) * eh
    if (eh <= (-9d+93)) then
        tmp = abs(t_1)
    else if (eh <= 2.35d+112) then
        tmp = abs((ew * cos(t)))
    else
        tmp = 1.0d0 / abs((1.0d0 / t_1))
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.sin(t) * eh;
	double tmp;
	if (eh <= -9e+93) {
		tmp = Math.abs(t_1);
	} else if (eh <= 2.35e+112) {
		tmp = Math.abs((ew * Math.cos(t)));
	} else {
		tmp = 1.0 / Math.abs((1.0 / t_1));
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.sin(t) * eh
	tmp = 0
	if eh <= -9e+93:
		tmp = math.fabs(t_1)
	elif eh <= 2.35e+112:
		tmp = math.fabs((ew * math.cos(t)))
	else:
		tmp = 1.0 / math.fabs((1.0 / t_1))
	return tmp
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	tmp = 0.0
	if (eh <= -9e+93)
		tmp = abs(t_1);
	elseif (eh <= 2.35e+112)
		tmp = abs(Float64(ew * cos(t)));
	else
		tmp = Float64(1.0 / abs(Float64(1.0 / t_1)));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = sin(t) * eh;
	tmp = 0.0;
	if (eh <= -9e+93)
		tmp = abs(t_1);
	elseif (eh <= 2.35e+112)
		tmp = abs((ew * cos(t)));
	else
		tmp = 1.0 / abs((1.0 / t_1));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -9e+93], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 2.35e+112], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\
\;\;\;\;\left|t\_1\right|\\

\mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eh < -8.99999999999999981e93

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites65.5%

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

    if -8.99999999999999981e93 < eh < 2.34999999999999999e112

    1. Initial program 99.8%

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

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

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

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

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

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

    if 2.34999999999999999e112 < eh

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{eh \cdot \sin t}}\right|} \]
      3. lower-sin.f6481.1

        \[\leadsto \frac{1}{\left|\frac{1}{eh \cdot \color{blue}{\sin t}}\right|} \]
    6. Applied rewrites81.1%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{eh \cdot \sin t}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|\frac{1}{\sin t \cdot eh}\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 75.2% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin t \cdot eh\right|\\ \mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 2.1 \cdot 10^{+112}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* (sin t) eh))))
   (if (<= eh -9e+93) t_1 (if (<= eh 2.1e+112) (fabs (* ew (cos t))) t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((sin(t) * eh));
	double tmp;
	if (eh <= -9e+93) {
		tmp = t_1;
	} else if (eh <= 2.1e+112) {
		tmp = fabs((ew * cos(t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = abs((sin(t) * eh))
    if (eh <= (-9d+93)) then
        tmp = t_1
    else if (eh <= 2.1d+112) then
        tmp = abs((ew * cos(t)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs((Math.sin(t) * eh));
	double tmp;
	if (eh <= -9e+93) {
		tmp = t_1;
	} else if (eh <= 2.1e+112) {
		tmp = Math.abs((ew * Math.cos(t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((math.sin(t) * eh))
	tmp = 0
	if eh <= -9e+93:
		tmp = t_1
	elif eh <= 2.1e+112:
		tmp = math.fabs((ew * math.cos(t)))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(sin(t) * eh))
	tmp = 0.0
	if (eh <= -9e+93)
		tmp = t_1;
	elseif (eh <= 2.1e+112)
		tmp = abs(Float64(ew * cos(t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((sin(t) * eh));
	tmp = 0.0;
	if (eh <= -9e+93)
		tmp = t_1;
	elseif (eh <= 2.1e+112)
		tmp = abs((ew * cos(t)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+93], t$95$1, If[LessEqual[eh, 2.1e+112], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|\sin t \cdot eh\right|\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 2.1 \cdot 10^{+112}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -8.99999999999999981e93 or 2.0999999999999999e112 < eh

    1. Initial program 99.8%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6472.0

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites72.0%

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

    if -8.99999999999999981e93 < eh < 2.0999999999999999e112

    1. Initial program 99.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{elif}\;eh \leq 2.1 \cdot 10^{+112}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 62.0% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{elif}\;ew \leq 8000000:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= ew -6.7e-32)
   (fabs ew)
   (if (<= ew 8000000.0) (fabs (* (sin t) eh)) (* ew (cos t)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -6.7e-32) {
		tmp = fabs(ew);
	} else if (ew <= 8000000.0) {
		tmp = fabs((sin(t) * eh));
	} else {
		tmp = ew * cos(t);
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: tmp
    if (ew <= (-6.7d-32)) then
        tmp = abs(ew)
    else if (ew <= 8000000.0d0) then
        tmp = abs((sin(t) * eh))
    else
        tmp = ew * cos(t)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (ew <= -6.7e-32) {
		tmp = Math.abs(ew);
	} else if (ew <= 8000000.0) {
		tmp = Math.abs((Math.sin(t) * eh));
	} else {
		tmp = ew * Math.cos(t);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if ew <= -6.7e-32:
		tmp = math.fabs(ew)
	elif ew <= 8000000.0:
		tmp = math.fabs((math.sin(t) * eh))
	else:
		tmp = ew * math.cos(t)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (ew <= -6.7e-32)
		tmp = abs(ew);
	elseif (ew <= 8000000.0)
		tmp = abs(Float64(sin(t) * eh));
	else
		tmp = Float64(ew * cos(t));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (ew <= -6.7e-32)
		tmp = abs(ew);
	elseif (ew <= 8000000.0)
		tmp = abs((sin(t) * eh));
	else
		tmp = ew * cos(t);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[ew, -6.7e-32], N[Abs[ew], $MachinePrecision], If[LessEqual[ew, 8000000.0], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\
\;\;\;\;\left|ew\right|\\

\mathbf{elif}\;ew \leq 8000000:\\
\;\;\;\;\left|\sin t \cdot eh\right|\\

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


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

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6452.9

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites52.9%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6453.0

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites53.0%

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

    if -6.7e-32 < ew < 8e6

    1. Initial program 99.8%

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

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

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

        \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      2. lower-sin.f6466.9

        \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
    6. Applied rewrites66.9%

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

    if 8e6 < ew

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{ew \cdot \cos t} \]
      2. lower-cos.f6466.7

        \[\leadsto ew \cdot \color{blue}{\cos t} \]
    7. Applied rewrites66.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{elif}\;ew \leq 8000000:\\ \;\;\;\;\left|\sin t \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \cos t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 49.9% accurate, 7.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sin t \cdot eh\\ \mathbf{if}\;t \leq -7 \cdot 10^{+29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3400:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (sin t) eh)))
   (if (<= t -7e+29) t_1 (if (<= t 3400.0) (fabs ew) t_1))))
double code(double eh, double ew, double t) {
	double t_1 = sin(t) * eh;
	double tmp;
	if (t <= -7e+29) {
		tmp = t_1;
	} else if (t <= 3400.0) {
		tmp = fabs(ew);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sin(t) * eh
    if (t <= (-7d+29)) then
        tmp = t_1
    else if (t <= 3400.0d0) then
        tmp = abs(ew)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.sin(t) * eh;
	double tmp;
	if (t <= -7e+29) {
		tmp = t_1;
	} else if (t <= 3400.0) {
		tmp = Math.abs(ew);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.sin(t) * eh
	tmp = 0
	if t <= -7e+29:
		tmp = t_1
	elif t <= 3400.0:
		tmp = math.fabs(ew)
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = Float64(sin(t) * eh)
	tmp = 0.0
	if (t <= -7e+29)
		tmp = t_1;
	elseif (t <= 3400.0)
		tmp = abs(ew);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = sin(t) * eh;
	tmp = 0.0;
	if (t <= -7e+29)
		tmp = t_1;
	elseif (t <= 3400.0)
		tmp = abs(ew);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[t, -7e+29], t$95$1, If[LessEqual[t, 3400.0], N[Abs[ew], $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;t \leq -7 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3400:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.99999999999999958e29 or 3400 < t

    1. Initial program 99.5%

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

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

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

      \[\leadsto \color{blue}{eh \cdot \sin t} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{eh \cdot \sin t} \]
      2. lower-sin.f6427.9

        \[\leadsto eh \cdot \color{blue}{\sin t} \]
    7. Applied rewrites27.9%

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

    if -6.99999999999999958e29 < t < 3400

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6466.2

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites66.2%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6466.4

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites66.4%

      \[\leadsto \color{blue}{\left|ew\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+29}:\\ \;\;\;\;\sin t \cdot eh\\ \mathbf{elif}\;t \leq 3400:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\sin t \cdot eh\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 41.8% accurate, 18.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), -0.008333333333333333, eh \cdot 0.16666666666666666\right), -eh\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh 5.2e+112)
   (fabs ew)
   (*
    t
    (fma
     (* t t)
     (fma (* eh (* t t)) -0.008333333333333333 (* eh 0.16666666666666666))
     (- eh)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 5.2e+112) {
		tmp = fabs(ew);
	} else {
		tmp = t * fma((t * t), fma((eh * (t * t)), -0.008333333333333333, (eh * 0.16666666666666666)), -eh);
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= 5.2e+112)
		tmp = abs(ew);
	else
		tmp = Float64(t * fma(Float64(t * t), fma(Float64(eh * Float64(t * t)), -0.008333333333333333, Float64(eh * 0.16666666666666666)), Float64(-eh)));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[eh, 5.2e+112], N[Abs[ew], $MachinePrecision], N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] * -0.008333333333333333 + N[(eh * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + (-eh)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), -0.008333333333333333, eh \cdot 0.16666666666666666\right), -eh\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 5.2000000000000001e112

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6446.4

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites46.4%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6446.5

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites46.5%

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

    if 5.2000000000000001e112 < eh

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(eh \cdot \sin t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sin t \cdot eh}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\sin t \cdot \left(\mathsf{neg}\left(eh\right)\right)} \]
      4. mul-1-negN/A

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

        \[\leadsto \color{blue}{\sin t \cdot \left(-1 \cdot eh\right)} \]
      6. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin t} \cdot \left(-1 \cdot eh\right) \]
      7. mul-1-negN/A

        \[\leadsto \sin t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \]
      8. lower-neg.f6448.3

        \[\leadsto \sin t \cdot \color{blue}{\left(-eh\right)} \]
    7. Applied rewrites48.3%

      \[\leadsto \color{blue}{\sin t \cdot \left(-eh\right)} \]
    8. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \color{blue}{\left(t \cdot t\right)}, \frac{-1}{120}, \frac{1}{6} \cdot eh\right), -1 \cdot eh\right) \]
      11. *-commutativeN/A

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

        \[\leadsto t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), \frac{-1}{120}, \color{blue}{eh \cdot \frac{1}{6}}\right), -1 \cdot eh\right) \]
      13. mul-1-negN/A

        \[\leadsto t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), \frac{-1}{120}, eh \cdot \frac{1}{6}\right), \color{blue}{\mathsf{neg}\left(eh\right)}\right) \]
      14. lower-neg.f6430.4

        \[\leadsto t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), -0.008333333333333333, eh \cdot 0.16666666666666666\right), \color{blue}{-eh}\right) \]
    10. Applied rewrites30.4%

      \[\leadsto \color{blue}{t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), -0.008333333333333333, eh \cdot 0.16666666666666666\right), -eh\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 41.8% accurate, 21.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \left(\left(-t\right) \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh 5.2e+112)
   (fabs ew)
   (*
    eh
    (*
     (- t)
     (fma
      (* t t)
      (fma (* t t) 0.008333333333333333 -0.16666666666666666)
      1.0)))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 5.2e+112) {
		tmp = fabs(ew);
	} else {
		tmp = eh * (-t * fma((t * t), fma((t * t), 0.008333333333333333, -0.16666666666666666), 1.0));
	}
	return tmp;
}
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= 5.2e+112)
		tmp = abs(ew);
	else
		tmp = Float64(eh * Float64(Float64(-t) * fma(Float64(t * t), fma(Float64(t * t), 0.008333333333333333, -0.16666666666666666), 1.0)));
	end
	return tmp
end
code[eh_, ew_, t_] := If[LessEqual[eh, 5.2e+112], N[Abs[ew], $MachinePrecision], N[(eh * N[((-t) * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;eh \cdot \left(\left(-t\right) \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 5.2000000000000001e112

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6446.4

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites46.4%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6446.5

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites46.5%

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

    if 5.2000000000000001e112 < eh

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(eh \cdot \sin t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sin t \cdot eh}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\sin t \cdot \left(\mathsf{neg}\left(eh\right)\right)} \]
      4. mul-1-negN/A

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

        \[\leadsto \color{blue}{\sin t \cdot \left(-1 \cdot eh\right)} \]
      6. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin t} \cdot \left(-1 \cdot eh\right) \]
      7. mul-1-negN/A

        \[\leadsto \sin t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \]
      8. lower-neg.f6448.3

        \[\leadsto \sin t \cdot \color{blue}{\left(-eh\right)} \]
    7. Applied rewrites48.3%

      \[\leadsto \color{blue}{\sin t \cdot \left(-eh\right)} \]
    8. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\left(t \cdot \left(1 + {t}^{2} \cdot \left(\frac{1}{120} \cdot {t}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \left(\mathsf{neg}\left(eh\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

        \[\leadsto \left(t \cdot \mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{1}{120} \cdot {t}^{2} - \frac{1}{6}, 1\right)\right) \cdot \left(\mathsf{neg}\left(eh\right)\right) \]
      6. sub-negN/A

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

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

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

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

        \[\leadsto \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \left(\mathsf{neg}\left(eh\right)\right) \]
      11. lower-*.f6430.3

        \[\leadsto \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\color{blue}{t \cdot t}, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \left(-eh\right) \]
    10. Applied rewrites30.3%

      \[\leadsto \color{blue}{\left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)} \cdot \left(-eh\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;eh \cdot \left(\left(-t\right) \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 41.9% accurate, 28.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(eh \cdot \left(t \cdot t\right)\right) \cdot 0.16666666666666666 - eh\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh 5.2e+112)
   (fabs ew)
   (* t (- (* (* eh (* t t)) 0.16666666666666666) eh))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 5.2e+112) {
		tmp = fabs(ew);
	} else {
		tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh);
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: tmp
    if (eh <= 5.2d+112) then
        tmp = abs(ew)
    else
        tmp = t * (((eh * (t * t)) * 0.16666666666666666d0) - eh)
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 5.2e+112) {
		tmp = Math.abs(ew);
	} else {
		tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh);
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if eh <= 5.2e+112:
		tmp = math.fabs(ew)
	else:
		tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh)
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= 5.2e+112)
		tmp = abs(ew);
	else
		tmp = Float64(t * Float64(Float64(Float64(eh * Float64(t * t)) * 0.16666666666666666) - eh));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (eh <= 5.2e+112)
		tmp = abs(ew);
	else
		tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh);
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[eh, 5.2e+112], N[Abs[ew], $MachinePrecision], N[(t * N[(N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - eh), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(eh \cdot \left(t \cdot t\right)\right) \cdot 0.16666666666666666 - eh\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 5.2000000000000001e112

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6446.4

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites46.4%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6446.5

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites46.5%

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

    if 5.2000000000000001e112 < eh

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(eh \cdot \sin t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sin t \cdot eh}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\sin t \cdot \left(\mathsf{neg}\left(eh\right)\right)} \]
      4. mul-1-negN/A

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

        \[\leadsto \color{blue}{\sin t \cdot \left(-1 \cdot eh\right)} \]
      6. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin t} \cdot \left(-1 \cdot eh\right) \]
      7. mul-1-negN/A

        \[\leadsto \sin t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \]
      8. lower-neg.f6448.3

        \[\leadsto \sin t \cdot \color{blue}{\left(-eh\right)} \]
    7. Applied rewrites48.3%

      \[\leadsto \color{blue}{\sin t \cdot \left(-eh\right)} \]
    8. Taylor expanded in t around 0

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

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

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

        \[\leadsto t \cdot \left(\frac{1}{6} \cdot \left(eh \cdot {t}^{2}\right) + \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)}\right) \]
      4. unsub-negN/A

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

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

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

        \[\leadsto t \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(eh \cdot {t}^{2}\right)} - eh\right) \]
      8. unpow2N/A

        \[\leadsto t \cdot \left(\frac{1}{6} \cdot \left(eh \cdot \color{blue}{\left(t \cdot t\right)}\right) - eh\right) \]
      9. lower-*.f6429.8

        \[\leadsto t \cdot \left(0.16666666666666666 \cdot \left(eh \cdot \color{blue}{\left(t \cdot t\right)}\right) - eh\right) \]
    10. Applied rewrites29.8%

      \[\leadsto \color{blue}{t \cdot \left(0.16666666666666666 \cdot \left(eh \cdot \left(t \cdot t\right)\right) - eh\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\left(eh \cdot \left(t \cdot t\right)\right) \cdot 0.16666666666666666 - eh\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 41.9% accurate, 61.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 1.28 \cdot 10^{+113}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-eh\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (<= eh 1.28e+113) (fabs ew) (* t (- eh))))
double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 1.28e+113) {
		tmp = fabs(ew);
	} else {
		tmp = t * -eh;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: tmp
    if (eh <= 1.28d+113) then
        tmp = abs(ew)
    else
        tmp = t * -eh
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double tmp;
	if (eh <= 1.28e+113) {
		tmp = Math.abs(ew);
	} else {
		tmp = t * -eh;
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if eh <= 1.28e+113:
		tmp = math.fabs(ew)
	else:
		tmp = t * -eh
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if (eh <= 1.28e+113)
		tmp = abs(ew);
	else
		tmp = Float64(t * Float64(-eh));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if (eh <= 1.28e+113)
		tmp = abs(ew);
	else
		tmp = t * -eh;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[LessEqual[eh, 1.28e+113], N[Abs[ew], $MachinePrecision], N[(t * (-eh)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;eh \leq 1.28 \cdot 10^{+113}:\\
\;\;\;\;\left|ew\right|\\

\mathbf{else}:\\
\;\;\;\;t \cdot \left(-eh\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 1.27999999999999994e113

    1. Initial program 99.8%

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

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

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    5. Step-by-step derivation
      1. lower-/.f6446.4

        \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    6. Applied rewrites46.4%

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
    7. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
      3. remove-double-divN/A

        \[\leadsto \color{blue}{\left|ew\right|} \]
      4. lower-fabs.f6446.5

        \[\leadsto \color{blue}{\left|ew\right|} \]
    8. Applied rewrites46.5%

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

    if 1.27999999999999994e113 < eh

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot \sin t\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(eh \cdot \sin t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sin t \cdot eh}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\sin t \cdot \left(\mathsf{neg}\left(eh\right)\right)} \]
      4. mul-1-negN/A

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

        \[\leadsto \color{blue}{\sin t \cdot \left(-1 \cdot eh\right)} \]
      6. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin t} \cdot \left(-1 \cdot eh\right) \]
      7. mul-1-negN/A

        \[\leadsto \sin t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \]
      8. lower-neg.f6448.3

        \[\leadsto \sin t \cdot \color{blue}{\left(-eh\right)} \]
    7. Applied rewrites48.3%

      \[\leadsto \color{blue}{\sin t \cdot \left(-eh\right)} \]
    8. Taylor expanded in t around 0

      \[\leadsto \color{blue}{-1 \cdot \left(eh \cdot t\right)} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(eh \cdot t\right)} \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{t \cdot eh}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{t \cdot \left(\mathsf{neg}\left(eh\right)\right)} \]
      4. mul-1-negN/A

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

        \[\leadsto \color{blue}{t \cdot \left(-1 \cdot eh\right)} \]
      6. mul-1-negN/A

        \[\leadsto t \cdot \color{blue}{\left(\mathsf{neg}\left(eh\right)\right)} \]
      7. lower-neg.f6429.3

        \[\leadsto t \cdot \color{blue}{\left(-eh\right)} \]
    10. Applied rewrites29.3%

      \[\leadsto \color{blue}{t \cdot \left(-eh\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 43.5% accurate, 287.3× speedup?

\[\begin{array}{l} \\ \left|ew\right| \end{array} \]
(FPCore (eh ew t) :precision binary64 (fabs ew))
double code(double eh, double ew, double t) {
	return fabs(ew);
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = abs(ew)
end function
public static double code(double eh, double ew, double t) {
	return Math.abs(ew);
}
def code(eh, ew, t):
	return math.fabs(ew)
function code(eh, ew, t)
	return abs(ew)
end
function tmp = code(eh, ew, t)
	tmp = abs(ew);
end
code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
\begin{array}{l}

\\
\left|ew\right|
\end{array}
Derivation
  1. Initial program 99.8%

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

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

    \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
  5. Step-by-step derivation
    1. lower-/.f6441.6

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
  6. Applied rewrites41.6%

    \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
  7. Step-by-step derivation
    1. fabs-divN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{\left|1\right|}{\left|ew\right|}}} \]
    2. metadata-evalN/A

      \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left|ew\right|}} \]
    3. remove-double-divN/A

      \[\leadsto \color{blue}{\left|ew\right|} \]
    4. lower-fabs.f6441.7

      \[\leadsto \color{blue}{\left|ew\right|} \]
  8. Applied rewrites41.7%

    \[\leadsto \color{blue}{\left|ew\right|} \]
  9. Add Preprocessing

Alternative 18: 22.3% accurate, 862.0× speedup?

\[\begin{array}{l} \\ ew \end{array} \]
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
	return ew;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    code = ew
end function
public static double code(double eh, double ew, double t) {
	return ew;
}
def code(eh, ew, t):
	return ew
function code(eh, ew, t)
	return ew
end
function tmp = code(eh, ew, t)
	tmp = ew;
end
code[eh_, ew_, t_] := ew
\begin{array}{l}

\\
ew
\end{array}
Derivation
  1. Initial program 99.8%

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

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

    \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
  5. Step-by-step derivation
    1. lower-/.f6441.6

      \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
  6. Applied rewrites41.6%

    \[\leadsto \frac{1}{\left|\color{blue}{\frac{1}{ew}}\right|} \]
  7. Step-by-step derivation
    1. inv-powN/A

      \[\leadsto \frac{1}{\left|\color{blue}{{ew}^{-1}}\right|} \]
    2. sqr-powN/A

      \[\leadsto \frac{1}{\left|\color{blue}{{ew}^{\left(\frac{-1}{2}\right)} \cdot {ew}^{\left(\frac{-1}{2}\right)}}\right|} \]
    3. fabs-sqrN/A

      \[\leadsto \frac{1}{\color{blue}{{ew}^{\left(\frac{-1}{2}\right)} \cdot {ew}^{\left(\frac{-1}{2}\right)}}} \]
    4. sqr-powN/A

      \[\leadsto \frac{1}{\color{blue}{{ew}^{-1}}} \]
    5. pow-flipN/A

      \[\leadsto \color{blue}{{ew}^{\left(\mathsf{neg}\left(-1\right)\right)}} \]
    6. metadata-evalN/A

      \[\leadsto {ew}^{\color{blue}{1}} \]
    7. unpow120.2

      \[\leadsto \color{blue}{ew} \]
  8. Applied rewrites20.2%

    \[\leadsto \color{blue}{ew} \]
  9. Add Preprocessing

Reproduce

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