Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 18.4s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{eh \cdot \tan t}{-ew}\\
\left|\mathsf{fma}\left(\frac{ew}{\sqrt{{t\_1}^{2} + 1}}, \cos t, eh \cdot \left(\sin \tan^{-1} t\_1 \cdot \left(-\sin t\right)\right)\right)\right|
\end{array}
\end{array}
Derivation
  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. Step-by-step derivation
    1. sub-negN/A

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

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

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

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

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

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

Alternative 2: 98.6% accurate, 1.9× speedup?

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

\\
\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{{\left(\tan t \cdot \frac{eh}{ew}\right)}^{2} + 1}}, ew, -eh \cdot \sin t\right)\right|
\end{array}
Derivation
  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. Step-by-step derivation
    1. sub-negN/A

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
  6. Step-by-step derivation
    1. cos-lowering-cos.f6498.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 2.7× speedup?

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

\\
\left|\mathsf{fma}\left(\tan t \cdot \left(-eh\right), \cos t, ew \cdot \cos t\right)\right|
\end{array}
Derivation
  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. Step-by-step derivation
    1. sub-negN/A

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

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

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

    \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
  6. Step-by-step derivation
    1. cos-lowering-cos.f6498.4

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

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

    \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \cos t, \frac{ew \cdot \cos t}{\color{blue}{1}}\right)\right| \]
  9. Step-by-step derivation
    1. Simplified98.1%

      \[\leadsto \left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\color{blue}{1}}\right)\right| \]
    2. Final simplification98.1%

      \[\leadsto \left|\mathsf{fma}\left(\tan t \cdot \left(-eh\right), \cos t, ew \cdot \cos t\right)\right| \]
    3. Add Preprocessing

    Alternative 4: 86.0% accurate, 3.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\mathsf{fma}\left(\tan t \cdot \left(-eh\right), \cos t, ew\right)\right|\\ \mathbf{if}\;eh \leq -9500000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 3.3 \cdot 10^{-85}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (let* ((t_1 (fabs (fma (* (tan t) (- eh)) (cos t) ew))))
       (if (<= eh -9500000.0) t_1 (if (<= eh 3.3e-85) (fabs (* ew (cos t))) t_1))))
    double code(double eh, double ew, double t) {
    	double t_1 = fabs(fma((tan(t) * -eh), cos(t), ew));
    	double tmp;
    	if (eh <= -9500000.0) {
    		tmp = t_1;
    	} else if (eh <= 3.3e-85) {
    		tmp = fabs((ew * cos(t)));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	t_1 = abs(fma(Float64(tan(t) * Float64(-eh)), cos(t), ew))
    	tmp = 0.0
    	if (eh <= -9500000.0)
    		tmp = t_1;
    	elseif (eh <= 3.3e-85)
    		tmp = abs(Float64(ew * cos(t)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(N[Tan[t], $MachinePrecision] * (-eh)), $MachinePrecision] * N[Cos[t], $MachinePrecision] + ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9500000.0], t$95$1, If[LessEqual[eh, 3.3e-85], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left|\mathsf{fma}\left(\tan t \cdot \left(-eh\right), \cos t, ew\right)\right|\\
    \mathbf{if}\;eh \leq -9500000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;eh \leq 3.3 \cdot 10^{-85}:\\
    \;\;\;\;\left|ew \cdot \cos t\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if eh < -9.5e6 or 3.29999999999999973e-85 < 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. Step-by-step derivation
        1. sub-negN/A

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

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

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

        \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
      6. Step-by-step derivation
        1. cos-lowering-cos.f6497.8

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

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

        \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \cos t, \frac{ew \cdot \cos t}{\sqrt{1 + {\color{blue}{\left(-1 \cdot \frac{eh \cdot t}{ew}\right)}}^{2}}}\right)\right| \]
      9. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \cos t, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{\color{blue}{t \cdot \left(\mathsf{neg}\left(eh\right)\right)}}{ew}\right)}^{2}}}\right)\right| \]
        9. neg-lowering-neg.f6492.0

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

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

        \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \cos t, \color{blue}{ew}\right)\right| \]
      12. Step-by-step derivation
        1. Simplified87.3%

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

        if -9.5e6 < eh < 3.29999999999999973e-85

        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. Step-by-step derivation
          1. sub-negN/A

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

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

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

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

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

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

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

            \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
        7. Simplified91.8%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -9500000:\\ \;\;\;\;\left|\mathsf{fma}\left(\tan t \cdot \left(-eh\right), \cos t, ew\right)\right|\\ \mathbf{elif}\;eh \leq 3.3 \cdot 10^{-85}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\mathsf{fma}\left(\tan t \cdot \left(-eh\right), \cos t, ew\right)\right|\\ \end{array} \]
      15. Add Preprocessing

      Alternative 5: 74.9% accurate, 6.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;t \leq -7.4 \cdot 10^{+118}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \mathbf{elif}\;t \leq -0.00017:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 0.0062:\\ \;\;\;\;\left|eh \cdot t - ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (fabs (* ew (cos t)))))
         (if (<= t -7.4e+118)
           (fabs (* eh (sin t)))
           (if (<= t -0.00017) t_1 (if (<= t 0.0062) (fabs (- (* eh t) ew)) t_1)))))
      double code(double eh, double ew, double t) {
      	double t_1 = fabs((ew * cos(t)));
      	double tmp;
      	if (t <= -7.4e+118) {
      		tmp = fabs((eh * sin(t)));
      	} else if (t <= -0.00017) {
      		tmp = t_1;
      	} else if (t <= 0.0062) {
      		tmp = fabs(((eh * t) - 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 = abs((ew * cos(t)))
          if (t <= (-7.4d+118)) then
              tmp = abs((eh * sin(t)))
          else if (t <= (-0.00017d0)) then
              tmp = t_1
          else if (t <= 0.0062d0) then
              tmp = abs(((eh * t) - 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.abs((ew * Math.cos(t)));
      	double tmp;
      	if (t <= -7.4e+118) {
      		tmp = Math.abs((eh * Math.sin(t)));
      	} else if (t <= -0.00017) {
      		tmp = t_1;
      	} else if (t <= 0.0062) {
      		tmp = Math.abs(((eh * t) - ew));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.fabs((ew * math.cos(t)))
      	tmp = 0
      	if t <= -7.4e+118:
      		tmp = math.fabs((eh * math.sin(t)))
      	elif t <= -0.00017:
      		tmp = t_1
      	elif t <= 0.0062:
      		tmp = math.fabs(((eh * t) - ew))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = abs(Float64(ew * cos(t)))
      	tmp = 0.0
      	if (t <= -7.4e+118)
      		tmp = abs(Float64(eh * sin(t)));
      	elseif (t <= -0.00017)
      		tmp = t_1;
      	elseif (t <= 0.0062)
      		tmp = abs(Float64(Float64(eh * t) - ew));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = abs((ew * cos(t)));
      	tmp = 0.0;
      	if (t <= -7.4e+118)
      		tmp = abs((eh * sin(t)));
      	elseif (t <= -0.00017)
      		tmp = t_1;
      	elseif (t <= 0.0062)
      		tmp = abs(((eh * t) - ew));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7.4e+118], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -0.00017], t$95$1, If[LessEqual[t, 0.0062], N[Abs[N[(N[(eh * t), $MachinePrecision] - ew), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left|ew \cdot \cos t\right|\\
      \mathbf{if}\;t \leq -7.4 \cdot 10^{+118}:\\
      \;\;\;\;\left|eh \cdot \sin t\right|\\
      
      \mathbf{elif}\;t \leq -0.00017:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 0.0062:\\
      \;\;\;\;\left|eh \cdot t - ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -7.39999999999999973e118

        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. Step-by-step derivation
          1. sub-negN/A

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

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

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

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

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

            \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
        7. Simplified65.8%

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

        if -7.39999999999999973e118 < t < -1.7e-4 or 0.00619999999999999978 < t

        1. Initial program 99.7%

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
          2. cos-lowering-cos.f6464.0

            \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
        7. Simplified64.0%

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

        if -1.7e-4 < t < 0.00619999999999999978

        1. Initial program 100.0%

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
        6. Step-by-step derivation
          1. cos-lowering-cos.f6498.9

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

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

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

            \[\leadsto \left|ew + \color{blue}{\left(\mathsf{neg}\left(eh \cdot t\right)\right)}\right| \]
          2. unsub-negN/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          3. --lowering--.f64N/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          4. *-commutativeN/A

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
          5. *-lowering-*.f6498.3

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
        10. Simplified98.3%

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

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

      Alternative 6: 73.6% accurate, 7.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|eh \cdot \sin t\right|\\ \mathbf{if}\;t \leq -48000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-18}:\\ \;\;\;\;\left|eh \cdot t - ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (fabs (* eh (sin t)))))
         (if (<= t -48000000.0)
           t_1
           (if (<= t 1.75e-18) (fabs (- (* eh t) ew)) t_1))))
      double code(double eh, double ew, double t) {
      	double t_1 = fabs((eh * sin(t)));
      	double tmp;
      	if (t <= -48000000.0) {
      		tmp = t_1;
      	} else if (t <= 1.75e-18) {
      		tmp = fabs(((eh * t) - 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 = abs((eh * sin(t)))
          if (t <= (-48000000.0d0)) then
              tmp = t_1
          else if (t <= 1.75d-18) then
              tmp = abs(((eh * t) - 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.abs((eh * Math.sin(t)));
      	double tmp;
      	if (t <= -48000000.0) {
      		tmp = t_1;
      	} else if (t <= 1.75e-18) {
      		tmp = Math.abs(((eh * t) - ew));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = math.fabs((eh * math.sin(t)))
      	tmp = 0
      	if t <= -48000000.0:
      		tmp = t_1
      	elif t <= 1.75e-18:
      		tmp = math.fabs(((eh * t) - ew))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = abs(Float64(eh * sin(t)))
      	tmp = 0.0
      	if (t <= -48000000.0)
      		tmp = t_1;
      	elseif (t <= 1.75e-18)
      		tmp = abs(Float64(Float64(eh * t) - ew));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = abs((eh * sin(t)));
      	tmp = 0.0;
      	if (t <= -48000000.0)
      		tmp = t_1;
      	elseif (t <= 1.75e-18)
      		tmp = abs(((eh * t) - ew));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -48000000.0], t$95$1, If[LessEqual[t, 1.75e-18], N[Abs[N[(N[(eh * t), $MachinePrecision] - ew), $MachinePrecision]], $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left|eh \cdot \sin t\right|\\
      \mathbf{if}\;t \leq -48000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 1.75 \cdot 10^{-18}:\\
      \;\;\;\;\left|eh \cdot t - ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -4.8e7 or 1.7499999999999999e-18 < t

        1. Initial program 99.7%

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

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

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

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

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

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          2. sin-lowering-sin.f6447.6

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

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

        if -4.8e7 < t < 1.7499999999999999e-18

        1. Initial program 100.0%

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
        6. Step-by-step derivation
          1. cos-lowering-cos.f6499.6

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

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

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

            \[\leadsto \left|ew + \color{blue}{\left(\mathsf{neg}\left(eh \cdot t\right)\right)}\right| \]
          2. unsub-negN/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          3. --lowering--.f64N/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          4. *-commutativeN/A

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
          5. *-lowering-*.f6498.3

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
        10. Simplified98.3%

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

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

      Alternative 7: 61.8% accurate, 7.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \cos t\\ \mathbf{if}\;t \leq -3.1 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6600000000:\\ \;\;\;\;\left|eh \cdot t - ew\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (let* ((t_1 (* ew (cos t))))
         (if (<= t -3.1e+25)
           t_1
           (if (<= t 6600000000.0) (fabs (- (* eh t) ew)) t_1))))
      double code(double eh, double ew, double t) {
      	double t_1 = ew * cos(t);
      	double tmp;
      	if (t <= -3.1e+25) {
      		tmp = t_1;
      	} else if (t <= 6600000000.0) {
      		tmp = fabs(((eh * t) - 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 = ew * cos(t)
          if (t <= (-3.1d+25)) then
              tmp = t_1
          else if (t <= 6600000000.0d0) then
              tmp = abs(((eh * t) - 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 tmp;
      	if (t <= -3.1e+25) {
      		tmp = t_1;
      	} else if (t <= 6600000000.0) {
      		tmp = Math.abs(((eh * t) - ew));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	t_1 = ew * math.cos(t)
      	tmp = 0
      	if t <= -3.1e+25:
      		tmp = t_1
      	elif t <= 6600000000.0:
      		tmp = math.fabs(((eh * t) - ew))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(eh, ew, t)
      	t_1 = Float64(ew * cos(t))
      	tmp = 0.0
      	if (t <= -3.1e+25)
      		tmp = t_1;
      	elseif (t <= 6600000000.0)
      		tmp = abs(Float64(Float64(eh * t) - ew));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	t_1 = ew * cos(t);
      	tmp = 0.0;
      	if (t <= -3.1e+25)
      		tmp = t_1;
      	elseif (t <= 6600000000.0)
      		tmp = abs(((eh * t) - 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]}, If[LessEqual[t, -3.1e+25], t$95$1, If[LessEqual[t, 6600000000.0], N[Abs[N[(N[(eh * t), $MachinePrecision] - ew), $MachinePrecision]], $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := ew \cdot \cos t\\
      \mathbf{if}\;t \leq -3.1 \cdot 10^{+25}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 6600000000:\\
      \;\;\;\;\left|eh \cdot t - ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -3.0999999999999998e25 or 6.6e9 < t

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto \frac{1}{\left|\frac{1}{\color{blue}{ew \cdot \cos t}}\right|} \]
          3. cos-lowering-cos.f6457.0

            \[\leadsto \frac{1}{\left|\frac{1}{ew \cdot \color{blue}{\cos t}}\right|} \]
        6. Simplified57.0%

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

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

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

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

            \[\leadsto \frac{1}{\color{blue}{{\left(ew \cdot \cos t\right)}^{-1}}} \]
          5. inv-powN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{1}{ew \cdot \cos t}}} \]
          6. clear-numN/A

            \[\leadsto \color{blue}{\frac{ew \cdot \cos t}{1}} \]
          7. /-rgt-identityN/A

            \[\leadsto \color{blue}{ew \cdot \cos t} \]
          8. *-commutativeN/A

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

            \[\leadsto \color{blue}{\cos t \cdot ew} \]
          10. cos-lowering-cos.f6426.6

            \[\leadsto \color{blue}{\cos t} \cdot ew \]
        8. Applied egg-rr26.6%

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

        if -3.0999999999999998e25 < t < 6.6e9

        1. Initial program 100.0%

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

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
        6. Step-by-step derivation
          1. cos-lowering-cos.f6499.0

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

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

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

            \[\leadsto \left|ew + \color{blue}{\left(\mathsf{neg}\left(eh \cdot t\right)\right)}\right| \]
          2. unsub-negN/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          3. --lowering--.f64N/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          4. *-commutativeN/A

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
          5. *-lowering-*.f6491.7

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
        10. Simplified91.7%

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

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

      Alternative 8: 43.4% accurate, 61.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;eh \leq 4.2 \cdot 10^{+177}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot t\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (<= eh 4.2e+177) (fabs ew) (fabs (* eh t))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if (eh <= 4.2e+177) {
      		tmp = fabs(ew);
      	} else {
      		tmp = fabs((eh * 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 (eh <= 4.2d+177) then
              tmp = abs(ew)
          else
              tmp = abs((eh * t))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double tmp;
      	if (eh <= 4.2e+177) {
      		tmp = Math.abs(ew);
      	} else {
      		tmp = Math.abs((eh * t));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	tmp = 0
      	if eh <= 4.2e+177:
      		tmp = math.fabs(ew)
      	else:
      		tmp = math.fabs((eh * t))
      	return tmp
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if (eh <= 4.2e+177)
      		tmp = abs(ew);
      	else
      		tmp = abs(Float64(eh * t));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	tmp = 0.0;
      	if (eh <= 4.2e+177)
      		tmp = abs(ew);
      	else
      		tmp = abs((eh * t));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := If[LessEqual[eh, 4.2e+177], N[Abs[ew], $MachinePrecision], N[Abs[N[(eh * t), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;eh \leq 4.2 \cdot 10^{+177}:\\
      \;\;\;\;\left|ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|eh \cdot t\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if eh < 4.20000000000000026e177

        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. Step-by-step derivation
          1. sub-negN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{ew}\right| \]
        6. Step-by-step derivation
          1. Simplified44.4%

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

          if 4.20000000000000026e177 < 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. Step-by-step derivation
            1. sub-negN/A

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

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

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

            \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
          6. Step-by-step derivation
            1. cos-lowering-cos.f6496.9

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

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

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

              \[\leadsto \left|ew + \color{blue}{\left(\mathsf{neg}\left(eh \cdot t\right)\right)}\right| \]
            2. unsub-negN/A

              \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
            3. --lowering--.f64N/A

              \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
            4. *-commutativeN/A

              \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
            5. *-lowering-*.f6465.1

              \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
          10. Simplified65.1%

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

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

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

              \[\leadsto \left|\color{blue}{\mathsf{neg}\left(eh \cdot t\right)}\right| \]
            3. *-lowering-*.f6448.2

              \[\leadsto \left|-\color{blue}{eh \cdot t}\right| \]
          13. Simplified48.2%

            \[\leadsto \left|\color{blue}{-eh \cdot t}\right| \]
        7. Recombined 2 regimes into one program.
        8. Final simplification44.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq 4.2 \cdot 10^{+177}:\\ \;\;\;\;\left|ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot t\right|\\ \end{array} \]
        9. Add Preprocessing

        Alternative 9: 53.9% accurate, 78.4× speedup?

        \[\begin{array}{l} \\ \left|eh \cdot t - ew\right| \end{array} \]
        (FPCore (eh ew t) :precision binary64 (fabs (- (* eh t) ew)))
        double code(double eh, double ew, double t) {
        	return fabs(((eh * t) - 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(((eh * t) - ew))
        end function
        
        public static double code(double eh, double ew, double t) {
        	return Math.abs(((eh * t) - ew));
        }
        
        def code(eh, ew, t):
        	return math.fabs(((eh * t) - ew))
        
        function code(eh, ew, t)
        	return abs(Float64(Float64(eh * t) - ew))
        end
        
        function tmp = code(eh, ew, t)
        	tmp = abs(((eh * t) - ew));
        end
        
        code[eh_, ew_, t_] := N[Abs[N[(N[(eh * t), $MachinePrecision] - ew), $MachinePrecision]], $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \left|eh \cdot t - ew\right|
        \end{array}
        
        Derivation
        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. Step-by-step derivation
          1. sub-negN/A

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

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

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

          \[\leadsto \left|\mathsf{fma}\left(\mathsf{neg}\left(eh \cdot \tan t\right), \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\frac{eh \cdot \tan t}{\mathsf{neg}\left(ew\right)}\right)}^{2}}}\right)\right| \]
        6. Step-by-step derivation
          1. cos-lowering-cos.f6498.4

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

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

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

            \[\leadsto \left|ew + \color{blue}{\left(\mathsf{neg}\left(eh \cdot t\right)\right)}\right| \]
          2. unsub-negN/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          3. --lowering--.f64N/A

            \[\leadsto \left|\color{blue}{ew - eh \cdot t}\right| \]
          4. *-commutativeN/A

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
          5. *-lowering-*.f6455.3

            \[\leadsto \left|ew - \color{blue}{t \cdot eh}\right| \]
        10. Simplified55.3%

          \[\leadsto \left|\color{blue}{ew - t \cdot eh}\right| \]
        11. Final simplification55.3%

          \[\leadsto \left|eh \cdot t - ew\right| \]
        12. Add Preprocessing

        Alternative 10: 42.2% 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.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. Step-by-step derivation
          1. sub-negN/A

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

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

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

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

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

          \[\leadsto \left|\color{blue}{ew}\right| \]
        6. Step-by-step derivation
          1. Simplified42.2%

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

          Reproduce

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