
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (fma (+ (tan y) (tan z)) (/ 1.0 (- 1.0 (/ (tan z) (/ (cos y) (sin y))))) (- (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + fma((tan(y) + tan(z)), (1.0 / (1.0 - (tan(z) / (cos(y) / sin(y))))), -tan(a));
}
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + fma(Float64(tan(y) + tan(z)), Float64(1.0 / Float64(1.0 - Float64(tan(z) / Float64(cos(y) / sin(y))))), Float64(-tan(a)))) end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(N[Tan[z], $MachinePrecision] / N[(N[Cos[y], $MachinePrecision] / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \mathsf{fma}\left(\tan y + \tan z, \frac{1}{1 - \frac{\tan z}{\frac{\cos y}{\sin y}}}, -\tan a\right)
\end{array}
Initial program 79.8%
tan-sum99.7%
div-inv99.7%
fma-neg99.7%
Applied egg-rr99.7%
*-commutative99.7%
tan-quot99.7%
associate-*r/99.7%
Applied egg-rr99.7%
associate-/l*99.7%
Simplified99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (tan (+ y z))))
(if (<= (tan a) -1e-5)
(+ x (- (log (exp t_0)) (tan a)))
(if (<= (tan a) 5e-11)
(fma (/ 1.0 (- 1.0 (* (tan y) (tan z)))) (+ (tan y) (tan z)) x)
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan((y + z));
double tmp;
if (tan(a) <= -1e-5) {
tmp = x + (log(exp(t_0)) - tan(a));
} else if (tan(a) <= 5e-11) {
tmp = fma((1.0 / (1.0 - (tan(y) * tan(z)))), (tan(y) + tan(z)), x);
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = tan(Float64(y + z)) tmp = 0.0 if (tan(a) <= -1e-5) tmp = Float64(x + Float64(log(exp(t_0)) - tan(a))); elseif (tan(a) <= 5e-11) tmp = fma(Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z)))), Float64(tan(y) + tan(z)), x); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -1e-5], N[(x + N[(N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-11], N[(N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan \left(y + z\right)\\
\mathbf{if}\;\tan a \leq -1 \cdot 10^{-5}:\\
\;\;\;\;x + \left(\log \left(e^{t_0}\right) - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{1 - \tan y \cdot \tan z}, \tan y + \tan z, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t_0 - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -1.00000000000000008e-5Initial program 80.5%
add-log-exp80.6%
Applied egg-rr80.6%
if -1.00000000000000008e-5 < (tan.f64 a) < 5.00000000000000018e-11Initial program 76.5%
+-commutative76.5%
associate-+l-76.5%
Applied egg-rr76.5%
Taylor expanded in a around 0 76.5%
neg-mul-176.5%
Simplified76.5%
sub-neg76.5%
+-commutative76.5%
Applied egg-rr76.5%
remove-double-neg76.5%
+-commutative76.5%
Simplified76.5%
+-commutative76.5%
+-commutative76.5%
tan-sum99.2%
un-div-inv99.2%
*-commutative99.2%
fma-def99.2%
*-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
if 5.00000000000000018e-11 < (tan.f64 a) Initial program 86.0%
Final simplification91.2%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (tan (+ y z))))
(if (<= (tan a) -1e-5)
(+ x (- (log (exp t_0)) (tan a)))
(if (<= (tan a) 5e-11)
(+ x (* (+ (tan y) (tan z)) (/ 1.0 (- 1.0 (* (tan y) (tan z))))))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan((y + z));
double tmp;
if (tan(a) <= -1e-5) {
tmp = x + (log(exp(t_0)) - tan(a));
} else if (tan(a) <= 5e-11) {
tmp = x + ((tan(y) + tan(z)) * (1.0 / (1.0 - (tan(y) * tan(z)))));
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = tan((y + z))
if (tan(a) <= (-1d-5)) then
tmp = x + (log(exp(t_0)) - tan(a))
else if (tan(a) <= 5d-11) then
tmp = x + ((tan(y) + tan(z)) * (1.0d0 / (1.0d0 - (tan(y) * tan(z)))))
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan((y + z));
double tmp;
if (Math.tan(a) <= -1e-5) {
tmp = x + (Math.log(Math.exp(t_0)) - Math.tan(a));
} else if (Math.tan(a) <= 5e-11) {
tmp = x + ((Math.tan(y) + Math.tan(z)) * (1.0 / (1.0 - (Math.tan(y) * Math.tan(z)))));
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan((y + z)) tmp = 0 if math.tan(a) <= -1e-5: tmp = x + (math.log(math.exp(t_0)) - math.tan(a)) elif math.tan(a) <= 5e-11: tmp = x + ((math.tan(y) + math.tan(z)) * (1.0 / (1.0 - (math.tan(y) * math.tan(z))))) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = tan(Float64(y + z)) tmp = 0.0 if (tan(a) <= -1e-5) tmp = Float64(x + Float64(log(exp(t_0)) - tan(a))); elseif (tan(a) <= 5e-11) tmp = Float64(x + Float64(Float64(tan(y) + tan(z)) * Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z)))))); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan((y + z));
tmp = 0.0;
if (tan(a) <= -1e-5)
tmp = x + (log(exp(t_0)) - tan(a));
elseif (tan(a) <= 5e-11)
tmp = x + ((tan(y) + tan(z)) * (1.0 / (1.0 - (tan(y) * tan(z)))));
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -1e-5], N[(x + N[(N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-11], N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan \left(y + z\right)\\
\mathbf{if}\;\tan a \leq -1 \cdot 10^{-5}:\\
\;\;\;\;x + \left(\log \left(e^{t_0}\right) - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-11}:\\
\;\;\;\;x + \left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t_0 - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -1.00000000000000008e-5Initial program 80.5%
add-log-exp80.6%
Applied egg-rr80.6%
if -1.00000000000000008e-5 < (tan.f64 a) < 5.00000000000000018e-11Initial program 76.5%
+-commutative76.5%
associate-+l-76.5%
Applied egg-rr76.5%
Taylor expanded in a around 0 76.5%
neg-mul-176.5%
Simplified76.5%
sub-neg76.5%
+-commutative76.5%
Applied egg-rr76.5%
remove-double-neg76.5%
+-commutative76.5%
Simplified76.5%
+-commutative76.5%
tan-sum99.2%
un-div-inv99.2%
*-commutative99.2%
*-commutative99.2%
+-commutative99.2%
Applied egg-rr99.2%
if 5.00000000000000018e-11 < (tan.f64 a) Initial program 86.0%
Final simplification91.2%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (tan (+ y z))))
(if (<= (tan a) -1e-5)
(+ x (- (log (exp t_0)) (tan a)))
(if (<= (tan a) 5e-11)
(+ x (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan((y + z));
double tmp;
if (tan(a) <= -1e-5) {
tmp = x + (log(exp(t_0)) - tan(a));
} else if (tan(a) <= 5e-11) {
tmp = x + ((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z))));
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: t_0
real(8) :: tmp
t_0 = tan((y + z))
if (tan(a) <= (-1d-5)) then
tmp = x + (log(exp(t_0)) - tan(a))
else if (tan(a) <= 5d-11) then
tmp = x + ((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z))))
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan((y + z));
double tmp;
if (Math.tan(a) <= -1e-5) {
tmp = x + (Math.log(Math.exp(t_0)) - Math.tan(a));
} else if (Math.tan(a) <= 5e-11) {
tmp = x + ((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z))));
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan((y + z)) tmp = 0 if math.tan(a) <= -1e-5: tmp = x + (math.log(math.exp(t_0)) - math.tan(a)) elif math.tan(a) <= 5e-11: tmp = x + ((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = tan(Float64(y + z)) tmp = 0.0 if (tan(a) <= -1e-5) tmp = Float64(x + Float64(log(exp(t_0)) - tan(a))); elseif (tan(a) <= 5e-11) tmp = Float64(x + Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z))))); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan((y + z));
tmp = 0.0;
if (tan(a) <= -1e-5)
tmp = x + (log(exp(t_0)) - tan(a));
elseif (tan(a) <= 5e-11)
tmp = x + ((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z))));
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -1e-5], N[(x + N[(N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-11], N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan \left(y + z\right)\\
\mathbf{if}\;\tan a \leq -1 \cdot 10^{-5}:\\
\;\;\;\;x + \left(\log \left(e^{t_0}\right) - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-11}:\\
\;\;\;\;x + \frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t_0 - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -1.00000000000000008e-5Initial program 80.5%
add-log-exp80.6%
Applied egg-rr80.6%
if -1.00000000000000008e-5 < (tan.f64 a) < 5.00000000000000018e-11Initial program 76.5%
+-commutative76.5%
associate-+l-76.5%
Applied egg-rr76.5%
Taylor expanded in a around 0 76.5%
neg-mul-176.5%
Simplified76.5%
sub-neg76.5%
+-commutative76.5%
Applied egg-rr76.5%
remove-double-neg76.5%
+-commutative76.5%
Simplified76.5%
+-commutative76.5%
+-commutative76.5%
tan-sum99.2%
un-div-inv99.2%
fma-def99.2%
+-commutative99.2%
*-commutative99.2%
Applied egg-rr99.2%
fma-udef99.2%
associate-*r/99.2%
*-rgt-identity99.2%
Simplified99.2%
if 5.00000000000000018e-11 < (tan.f64 a) Initial program 86.0%
Final simplification91.2%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (fma (+ (tan y) (tan z)) (/ 1.0 (- 1.0 (* (tan y) (tan z)))) (- (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + fma((tan(y) + tan(z)), (1.0 / (1.0 - (tan(y) * tan(z)))), -tan(a));
}
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + fma(Float64(tan(y) + tan(z)), Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z)))), Float64(-tan(a)))) end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \mathsf{fma}\left(\tan y + \tan z, \frac{1}{1 - \tan y \cdot \tan z}, -\tan a\right)
\end{array}
Initial program 79.8%
tan-sum99.7%
div-inv99.7%
fma-neg99.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (* (+ (tan y) (tan z)) (/ 1.0 (- 1.0 (* (tan y) (tan z))))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) * (1.0 / (1.0 - (tan(y) * tan(z))))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(y) + tan(z)) * (1.0d0 / (1.0d0 - (tan(y) * tan(z))))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(y) + Math.tan(z)) * (1.0 / (1.0 - (Math.tan(y) * Math.tan(z))))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) * (1.0 / (1.0 - (math.tan(y) * math.tan(z))))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) * Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z))))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(y) + tan(z)) * (1.0 / (1.0 - (tan(y) * tan(z))))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 79.8%
tan-sum99.7%
div-inv99.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z)))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 79.8%
tan-sum99.7%
div-inv99.7%
Applied egg-rr99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (log (exp (tan (+ y z)))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (log(exp(tan((y + z)))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (log(exp(tan((y + z)))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (Math.log(Math.exp(Math.tan((y + z)))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (math.log(math.exp(math.tan((y + z)))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(log(exp(tan(Float64(y + z)))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (log(exp(tan((y + z)))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[Log[N[Exp[N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\log \left(e^{\tan \left(y + z\right)}\right) - \tan a\right)
\end{array}
Initial program 79.8%
add-log-exp79.9%
Applied egg-rr79.9%
Final simplification79.9%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (or (<= (tan a) -0.12) (not (<= (tan a) 0.15))) (- x (tan a)) (+ x (tan (+ y z)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if ((tan(a) <= -0.12) || !(tan(a) <= 0.15)) {
tmp = x - tan(a);
} else {
tmp = x + tan((y + z));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((tan(a) <= (-0.12d0)) .or. (.not. (tan(a) <= 0.15d0))) then
tmp = x - tan(a)
else
tmp = x + tan((y + z))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if ((Math.tan(a) <= -0.12) || !(Math.tan(a) <= 0.15)) {
tmp = x - Math.tan(a);
} else {
tmp = x + Math.tan((y + z));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if (math.tan(a) <= -0.12) or not (math.tan(a) <= 0.15): tmp = x - math.tan(a) else: tmp = x + math.tan((y + z)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if ((tan(a) <= -0.12) || !(tan(a) <= 0.15)) tmp = Float64(x - tan(a)); else tmp = Float64(x + tan(Float64(y + z))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if ((tan(a) <= -0.12) || ~((tan(a) <= 0.15)))
tmp = x - tan(a);
else
tmp = x + tan((y + z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[Or[LessEqual[N[Tan[a], $MachinePrecision], -0.12], N[Not[LessEqual[N[Tan[a], $MachinePrecision], 0.15]], $MachinePrecision]], N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision], N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;\tan a \leq -0.12 \lor \neg \left(\tan a \leq 0.15\right):\\
\;\;\;\;x - \tan a\\
\mathbf{else}:\\
\;\;\;\;x + \tan \left(y + z\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.12 or 0.149999999999999994 < (tan.f64 a) Initial program 82.1%
add-cbrt-cube81.6%
pow381.6%
+-commutative81.6%
associate-+l-81.5%
Applied egg-rr81.5%
Taylor expanded in y around 0 60.7%
Taylor expanded in z around 0 40.8%
rem-cbrt-cube41.0%
sub-neg41.0%
quot-tan41.0%
Applied egg-rr41.0%
sub-neg41.0%
Simplified41.0%
if -0.12 < (tan.f64 a) < 0.149999999999999994Initial program 78.0%
+-commutative78.0%
associate-+l-77.9%
Applied egg-rr77.9%
Taylor expanded in a around 0 73.1%
neg-mul-173.1%
Simplified73.1%
sub-neg73.1%
+-commutative73.1%
Applied egg-rr73.1%
remove-double-neg73.1%
+-commutative73.1%
Simplified73.1%
Final simplification58.5%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (<= (+ y z) -50.0) (+ x (tan (+ y z))) (+ x (- (tan z) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -50.0) {
tmp = x + tan((y + z));
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-50.0d0)) then
tmp = x + tan((y + z))
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -50.0) {
tmp = x + Math.tan((y + z));
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if (y + z) <= -50.0: tmp = x + math.tan((y + z)) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -50.0) tmp = Float64(x + tan(Float64(y + z))); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if ((y + z) <= -50.0)
tmp = x + tan((y + z));
else
tmp = x + (tan(z) - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -50.0], N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -50:\\
\;\;\;\;x + \tan \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -50Initial program 71.0%
+-commutative71.0%
associate-+l-71.0%
Applied egg-rr71.0%
Taylor expanded in a around 0 46.7%
neg-mul-146.7%
Simplified46.7%
sub-neg46.7%
+-commutative46.7%
Applied egg-rr46.7%
remove-double-neg46.7%
+-commutative46.7%
Simplified46.7%
if -50 < (+.f64 y z) Initial program 86.4%
add-cbrt-cube85.8%
pow385.8%
+-commutative85.8%
associate-+l-85.8%
Applied egg-rr85.8%
Taylor expanded in y around 0 69.2%
rem-cbrt-cube69.6%
tan-quot69.6%
associate--r-69.6%
Applied egg-rr69.6%
Final simplification59.8%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (<= (+ y z) -50.0) (+ x (/ (sin y) (cos y))) (+ x (- (tan z) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -50.0) {
tmp = x + (sin(y) / cos(y));
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((y + z) <= (-50.0d0)) then
tmp = x + (sin(y) / cos(y))
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if ((y + z) <= -50.0) {
tmp = x + (Math.sin(y) / Math.cos(y));
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if (y + z) <= -50.0: tmp = x + (math.sin(y) / math.cos(y)) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if (Float64(y + z) <= -50.0) tmp = Float64(x + Float64(sin(y) / cos(y))); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if ((y + z) <= -50.0)
tmp = x + (sin(y) / cos(y));
else
tmp = x + (tan(z) - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -50.0], N[(x + N[(N[Sin[y], $MachinePrecision] / N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y + z \leq -50:\\
\;\;\;\;x + \frac{\sin y}{\cos y}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -50Initial program 71.0%
+-commutative71.0%
associate-+l-71.0%
Applied egg-rr71.0%
Taylor expanded in a around 0 46.7%
neg-mul-146.7%
Simplified46.7%
Taylor expanded in z around 0 31.3%
+-commutative31.3%
Simplified31.3%
if -50 < (+.f64 y z) Initial program 86.4%
add-cbrt-cube85.8%
pow385.8%
+-commutative85.8%
associate-+l-85.8%
Applied egg-rr85.8%
Taylor expanded in y around 0 69.2%
rem-cbrt-cube69.6%
tan-quot69.6%
associate--r-69.6%
Applied egg-rr69.6%
Final simplification53.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (tan((y + z)) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Initial program 79.8%
Final simplification79.8%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (or (<= a -7e+30) (not (<= a 0.08))) (- x (tan a)) (+ (tan (+ y z)) (- x a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if ((a <= -7e+30) || !(a <= 0.08)) {
tmp = x - tan(a);
} else {
tmp = tan((y + z)) + (x - a);
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-7d+30)) .or. (.not. (a <= 0.08d0))) then
tmp = x - tan(a)
else
tmp = tan((y + z)) + (x - a)
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if ((a <= -7e+30) || !(a <= 0.08)) {
tmp = x - Math.tan(a);
} else {
tmp = Math.tan((y + z)) + (x - a);
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if (a <= -7e+30) or not (a <= 0.08): tmp = x - math.tan(a) else: tmp = math.tan((y + z)) + (x - a) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if ((a <= -7e+30) || !(a <= 0.08)) tmp = Float64(x - tan(a)); else tmp = Float64(tan(Float64(y + z)) + Float64(x - a)); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if ((a <= -7e+30) || ~((a <= 0.08)))
tmp = x - tan(a);
else
tmp = tan((y + z)) + (x - a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[Or[LessEqual[a, -7e+30], N[Not[LessEqual[a, 0.08]], $MachinePrecision]], N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision], N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(x - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+30} \lor \neg \left(a \leq 0.08\right):\\
\;\;\;\;x - \tan a\\
\mathbf{else}:\\
\;\;\;\;\tan \left(y + z\right) + \left(x - a\right)\\
\end{array}
\end{array}
if a < -7.00000000000000042e30 or 0.0800000000000000017 < a Initial program 82.5%
add-cbrt-cube82.0%
pow382.0%
+-commutative82.0%
associate-+l-81.9%
Applied egg-rr81.9%
Taylor expanded in y around 0 59.0%
Taylor expanded in z around 0 40.0%
rem-cbrt-cube40.1%
sub-neg40.1%
quot-tan40.1%
Applied egg-rr40.1%
sub-neg40.1%
Simplified40.1%
if -7.00000000000000042e30 < a < 0.0800000000000000017Initial program 77.4%
+-commutative77.4%
associate-+l-77.4%
Applied egg-rr77.4%
Taylor expanded in a around 0 75.9%
neg-mul-175.9%
unsub-neg75.9%
Simplified75.9%
Final simplification58.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (- x (tan a)))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x - tan(a);
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x - tan(a)
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x - Math.tan(a);
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x - math.tan(a)
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x - tan(a)) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x - tan(a);
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x - \tan a
\end{array}
Initial program 79.8%
add-cbrt-cube79.3%
pow379.3%
+-commutative79.3%
associate-+l-79.3%
Applied egg-rr79.3%
Taylor expanded in y around 0 59.6%
Taylor expanded in z around 0 38.2%
rem-cbrt-cube38.4%
sub-neg38.4%
quot-tan38.4%
Applied egg-rr38.4%
sub-neg38.4%
Simplified38.4%
Final simplification38.4%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 x)
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return x end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := x
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x
\end{array}
Initial program 79.8%
Taylor expanded in x around inf 29.5%
Final simplification29.5%
herbie shell --seed 2023322
(FPCore (x y z a)
:name "tan-example (used to crash)"
:precision binary64
:pre (and (and (and (or (== x 0.0) (and (<= 0.5884142 x) (<= x 505.5909))) (or (and (<= -1.796658e+308 y) (<= y -9.425585e-310)) (and (<= 1.284938e-309 y) (<= y 1.751224e+308)))) (or (and (<= -1.776707e+308 z) (<= z -8.599796e-310)) (and (<= 3.293145e-311 z) (<= z 1.725154e+308)))) (or (and (<= -1.796658e+308 a) (<= a -9.425585e-310)) (and (<= 1.284938e-309 a) (<= a 1.751224e+308))))
(+ x (- (tan (+ y z)) (tan a))))