Average Error: 0.1 → 0.3
Time: 18.5s
Precision: binary64
Cost: 71616
\[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
\[\left|\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(ew \cdot \sin t\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right| \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+
   (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t)))))
   (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+
   (* (cos (atan (/ (/ eh ew) (tan t)))) (* ew (sin t)))
   (* (* eh (cos t)) (sin (atan (log1p (expm1 (/ eh (* ew (tan t)))))))))))
double code(double eh, double ew, double t) {
	return fabs((((ew * sin(t)) * cos(atan(((eh / ew) / tan(t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
}
double code(double eh, double ew, double t) {
	return fabs(((cos(atan(((eh / ew) / tan(t)))) * (ew * sin(t))) + ((eh * cos(t)) * sin(atan(log1p(expm1((eh / (ew * tan(t))))))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs((((ew * Math.sin(t)) * Math.cos(Math.atan(((eh / ew) / Math.tan(t))))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs(((Math.cos(Math.atan(((eh / ew) / Math.tan(t)))) * (ew * Math.sin(t))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(Math.log1p(Math.expm1((eh / (ew * Math.tan(t))))))))));
}
def code(eh, ew, t):
	return math.fabs((((ew * math.sin(t)) * math.cos(math.atan(((eh / ew) / math.tan(t))))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
def code(eh, ew, t):
	return math.fabs(((math.cos(math.atan(((eh / ew) / math.tan(t)))) * (ew * math.sin(t))) + ((eh * math.cos(t)) * math.sin(math.atan(math.log1p(math.expm1((eh / (ew * math.tan(t))))))))))
function code(eh, ew, t)
	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / tan(t))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))
end
function code(eh, ew, t)
	return abs(Float64(Float64(cos(atan(Float64(Float64(eh / ew) / tan(t)))) * Float64(ew * sin(t))) + Float64(Float64(eh * cos(t)) * sin(atan(log1p(expm1(Float64(eh / Float64(ew * tan(t))))))))))
end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[Log[1 + N[(Exp[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\left|\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \left(ew \cdot \sin t\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Applied egg-rr0.3

    \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \color{blue}{\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)}\right| \]
  3. Final simplification0.3

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

Alternatives

Alternative 1
Error0.1
Cost58816
\[\begin{array}{l} t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \left|\cos t_1 \cdot \left(ew \cdot \sin t\right) + \left(eh \cdot \cos t\right) \cdot \sin t_1\right| \end{array} \]
Alternative 2
Error0.2
Cost52608
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{1}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{ew \cdot \sin t}}\right| \]
Alternative 3
Error0.6
Cost52416
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot \left(ew \cdot \sin t\right)\right| \]
Alternative 4
Error0.9
Cost39232
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + ew \cdot \sin t\right| \]
Alternative 5
Error2.1
Cost33609
\[\begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;ew \leq -2 \cdot 10^{-145} \lor \neg \left(ew \leq 3.5 \cdot 10^{-186}\right):\\ \;\;\;\;\left|ew \cdot \sin t + t_1 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t} + -0.3333333333333333 \cdot \frac{t \cdot eh}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{t \cdot 0.16666666666666666 + \frac{1}{t}}\right|\\ \end{array} \]
Alternative 6
Error7.0
Cost33481
\[\begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;ew \leq -1.35 \cdot 10^{-146} \lor \neg \left(ew \leq 4.6 \cdot 10^{-202}\right):\\ \;\;\;\;\left|ew \cdot \sin t + t_1 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + t \cdot \left(t \cdot \left(ew \cdot \frac{ew}{eh}\right)\right)\right|\\ \end{array} \]
Alternative 7
Error7.0
Cost33481
\[\begin{array}{l} t_1 := eh \cdot \cos t\\ \mathbf{if}\;ew \leq -9.8 \cdot 10^{+83} \lor \neg \left(ew \leq 1.35 \cdot 10^{-124}\right):\\ \;\;\;\;\left|ew \cdot \sin t + t_1 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{t \cdot 0.16666666666666666 + \frac{1}{t}}\right|\\ \end{array} \]
Alternative 8
Error6.9
Cost32832
\[\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right| \]
Alternative 9
Error8.2
Cost27145
\[\begin{array}{l} t_1 := \frac{eh}{ew \cdot t}\\ \mathbf{if}\;t \leq -7.5 \cdot 10^{-6} \lor \neg \left(t \leq 2.4\right):\\ \;\;\;\;\left|ew \cdot \sin t + \left(\cos t \cdot t_1\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, t_1\right)}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} t_1\right|\\ \end{array} \]
Alternative 10
Error11.1
Cost26697
\[\begin{array}{l} \mathbf{if}\;ew \leq -2.1 \cdot 10^{-90} \lor \neg \left(ew \leq 7.2 \cdot 10^{-129}\right):\\ \;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\ \end{array} \]
Alternative 11
Error14.1
Cost26304
\[\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right| \]
Alternative 12
Error41.2
Cost20288
\[\left|\frac{t \cdot t}{\frac{\frac{eh}{ew}}{ew}} + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right| \]

Error

Reproduce

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