
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x + y) - (((z - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- a z) t))))
(t_2 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-260)
(+ (+ x y) (/ 1.0 (/ (- a t) (* y (- t z)))))
(if (<= t_2 5e-222) t_1 (fma (- z t) (/ y (- t a)) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((a - z) / t));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-260) {
tmp = (x + y) + (1.0 / ((a - t) / (y * (t - z))));
} else if (t_2 <= 5e-222) {
tmp = t_1;
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(a - z) / t))) t_2 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-260) tmp = Float64(Float64(x + y) + Float64(1.0 / Float64(Float64(a - t) / Float64(y * Float64(t - z))))); elseif (t_2 <= 5e-222) tmp = t_1; else tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-260], N[(N[(x + y), $MachinePrecision] + N[(1.0 / N[(N[(a - t), $MachinePrecision] / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-222], t$95$1, N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{a - z}{t}\\
t_2 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-260}:\\
\;\;\;\;\left(x + y\right) + \frac{1}{\frac{a - t}{y \cdot \left(t - z\right)}}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -5.0000000000000003e-260 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-222Initial program 26.9%
Taylor expanded in t around inf 75.5%
associate--l+75.5%
distribute-lft-out--75.5%
div-sub75.5%
mul-1-neg75.5%
unsub-neg75.5%
*-commutative75.5%
distribute-lft-out--75.6%
Simplified75.6%
Taylor expanded in a around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
div-sub75.5%
*-commutative75.5%
cancel-sign-sub-inv75.5%
distribute-rgt-in75.6%
sub-neg75.6%
associate-*r/90.5%
Simplified90.5%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000003e-260Initial program 98.6%
clear-num98.6%
inv-pow98.6%
*-commutative98.6%
Applied egg-rr98.6%
unpow-198.6%
Simplified98.6%
if 5.00000000000000008e-222 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 78.9%
sub-neg78.9%
+-commutative78.9%
distribute-frac-neg78.9%
distribute-rgt-neg-out78.9%
associate-/l*89.6%
fma-define89.7%
distribute-frac-neg89.7%
distribute-neg-frac289.7%
sub-neg89.7%
distribute-neg-in89.7%
remove-double-neg89.7%
+-commutative89.7%
sub-neg89.7%
Simplified89.7%
Final simplification92.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z a) t))))
(t_2 (+ (+ x y) (/ (* y (- z t)) (- t a)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-260)
t_2
(if (<= t_2 5e-222) t_1 (+ (+ x y) (* (- z t) (/ y (- t a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - a) / t));
double t_2 = (x + y) + ((y * (z - t)) / (t - a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-260) {
tmp = t_2;
} else if (t_2 <= 5e-222) {
tmp = t_1;
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - a) / t));
double t_2 = (x + y) + ((y * (z - t)) / (t - a));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -5e-260) {
tmp = t_2;
} else if (t_2 <= 5e-222) {
tmp = t_1;
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - a) / t)) t_2 = (x + y) + ((y * (z - t)) / (t - a)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -5e-260: tmp = t_2 elif t_2 <= 5e-222: tmp = t_1 else: tmp = (x + y) + ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - a) / t))) t_2 = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-260) tmp = t_2; elseif (t_2 <= 5e-222) tmp = t_1; else tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - a) / t)); t_2 = (x + y) + ((y * (z - t)) / (t - a)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -5e-260) tmp = t_2; elseif (t_2 <= 5e-222) tmp = t_1; else tmp = (x + y) + ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-260], t$95$2, If[LessEqual[t$95$2, 5e-222], t$95$1, N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - a}{t}\\
t_2 := \left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-260}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -5.0000000000000003e-260 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-222Initial program 26.9%
Taylor expanded in t around inf 75.5%
associate--l+75.5%
distribute-lft-out--75.5%
div-sub75.5%
mul-1-neg75.5%
unsub-neg75.5%
*-commutative75.5%
distribute-lft-out--75.6%
Simplified75.6%
Taylor expanded in a around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
div-sub75.5%
*-commutative75.5%
cancel-sign-sub-inv75.5%
distribute-rgt-in75.6%
sub-neg75.6%
associate-*r/90.5%
Simplified90.5%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000003e-260Initial program 98.6%
if 5.00000000000000008e-222 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 78.9%
associate-/l*89.6%
*-commutative89.6%
Applied egg-rr89.6%
Final simplification92.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- a z) t))))
(t_2 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -5e-260)
(+ (+ x y) (/ 1.0 (/ (- a t) (* y (- t z)))))
(if (<= t_2 5e-222) t_1 (- (+ x y) (* (- z t) (/ y (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((a - z) / t));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -5e-260) {
tmp = (x + y) + (1.0 / ((a - t) / (y * (t - z))));
} else if (t_2 <= 5e-222) {
tmp = t_1;
} else {
tmp = (x + y) - ((z - t) * (y / (a - t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((a - z) / t));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -5e-260) {
tmp = (x + y) + (1.0 / ((a - t) / (y * (t - z))));
} else if (t_2 <= 5e-222) {
tmp = t_1;
} else {
tmp = (x + y) - ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((a - z) / t)) t_2 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -5e-260: tmp = (x + y) + (1.0 / ((a - t) / (y * (t - z)))) elif t_2 <= 5e-222: tmp = t_1 else: tmp = (x + y) - ((z - t) * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(a - z) / t))) t_2 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -5e-260) tmp = Float64(Float64(x + y) + Float64(1.0 / Float64(Float64(a - t) / Float64(y * Float64(t - z))))); elseif (t_2 <= 5e-222) tmp = t_1; else tmp = Float64(Float64(x + y) - Float64(Float64(z - t) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((a - z) / t)); t_2 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -5e-260) tmp = (x + y) + (1.0 / ((a - t) / (y * (t - z)))); elseif (t_2 <= 5e-222) tmp = t_1; else tmp = (x + y) - ((z - t) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-260], N[(N[(x + y), $MachinePrecision] + N[(1.0 / N[(N[(a - t), $MachinePrecision] / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-222], t$95$1, N[(N[(x + y), $MachinePrecision] - N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{a - z}{t}\\
t_2 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-260}:\\
\;\;\;\;\left(x + y\right) + \frac{1}{\frac{a - t}{y \cdot \left(t - z\right)}}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-222}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or -5.0000000000000003e-260 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 5.00000000000000008e-222Initial program 26.9%
Taylor expanded in t around inf 75.5%
associate--l+75.5%
distribute-lft-out--75.5%
div-sub75.5%
mul-1-neg75.5%
unsub-neg75.5%
*-commutative75.5%
distribute-lft-out--75.6%
Simplified75.6%
Taylor expanded in a around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
div-sub75.5%
*-commutative75.5%
cancel-sign-sub-inv75.5%
distribute-rgt-in75.6%
sub-neg75.6%
associate-*r/90.5%
Simplified90.5%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -5.0000000000000003e-260Initial program 98.6%
clear-num98.6%
inv-pow98.6%
*-commutative98.6%
Applied egg-rr98.6%
unpow-198.6%
Simplified98.6%
if 5.00000000000000008e-222 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 78.9%
associate-/l*89.6%
*-commutative89.6%
Applied egg-rr89.6%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e+153) (not (<= t 9.5e+113))) (+ x (* y (/ (- z a) t))) (+ (+ x y) (* (- z t) (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+153) || !(t <= 9.5e+113)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.1d+153)) .or. (.not. (t <= 9.5d+113))) then
tmp = x + (y * ((z - a) / t))
else
tmp = (x + y) + ((z - t) * (y / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+153) || !(t <= 9.5e+113)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e+153) or not (t <= 9.5e+113): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) + ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e+153) || !(t <= 9.5e+113)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.1e+153) || ~((t <= 9.5e+113))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) + ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e+153], N[Not[LessEqual[t, 9.5e+113]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+153} \lor \neg \left(t \leq 9.5 \cdot 10^{+113}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -2.10000000000000017e153 or 9.5000000000000001e113 < t Initial program 49.0%
Taylor expanded in t around inf 81.6%
associate--l+81.6%
distribute-lft-out--81.6%
div-sub81.6%
mul-1-neg81.6%
unsub-neg81.6%
*-commutative81.6%
distribute-lft-out--81.7%
Simplified81.7%
Taylor expanded in a around 0 81.6%
+-commutative81.6%
mul-1-neg81.6%
unsub-neg81.6%
div-sub81.6%
*-commutative81.6%
cancel-sign-sub-inv81.6%
distribute-rgt-in81.7%
sub-neg81.7%
associate-*r/91.7%
Simplified91.7%
if -2.10000000000000017e153 < t < 9.5000000000000001e113Initial program 84.2%
associate-/l*90.4%
*-commutative90.4%
Applied egg-rr90.4%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.8e+152) (not (<= t 1.5e+38))) (+ x (* y (/ (- z a) t))) (+ (+ x y) (/ (* y z) (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.8e+152) || !(t <= 1.5e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) + ((y * z) / (t - a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-9.8d+152)) .or. (.not. (t <= 1.5d+38))) then
tmp = x + (y * ((z - a) / t))
else
tmp = (x + y) + ((y * z) / (t - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.8e+152) || !(t <= 1.5e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) + ((y * z) / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.8e+152) or not (t <= 1.5e+38): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) + ((y * z) / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.8e+152) || !(t <= 1.5e+38)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(y * z) / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.8e+152) || ~((t <= 1.5e+38))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) + ((y * z) / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.8e+152], N[Not[LessEqual[t, 1.5e+38]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+152} \lor \neg \left(t \leq 1.5 \cdot 10^{+38}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y \cdot z}{t - a}\\
\end{array}
\end{array}
if t < -9.8000000000000008e152 or 1.5000000000000001e38 < t Initial program 48.2%
Taylor expanded in t around inf 75.3%
associate--l+75.3%
distribute-lft-out--75.3%
div-sub75.3%
mul-1-neg75.3%
unsub-neg75.3%
*-commutative75.3%
distribute-lft-out--75.5%
Simplified75.5%
Taylor expanded in a around 0 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
div-sub75.3%
*-commutative75.3%
cancel-sign-sub-inv75.3%
distribute-rgt-in75.5%
sub-neg75.5%
associate-*r/86.5%
Simplified86.5%
if -9.8000000000000008e152 < t < 1.5000000000000001e38Initial program 88.6%
Taylor expanded in z around inf 91.2%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.1e+153) (not (<= t 2.05e-45))) (+ x (* y (/ z t))) (+ x (- y (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+153) || !(t <= 2.05e-45)) {
tmp = x + (y * (z / t));
} else {
tmp = x + (y - (y * (z / a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.1d+153)) .or. (.not. (t <= 2.05d-45))) then
tmp = x + (y * (z / t))
else
tmp = x + (y - (y * (z / a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+153) || !(t <= 2.05e-45)) {
tmp = x + (y * (z / t));
} else {
tmp = x + (y - (y * (z / a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.1e+153) or not (t <= 2.05e-45): tmp = x + (y * (z / t)) else: tmp = x + (y - (y * (z / a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.1e+153) || !(t <= 2.05e-45)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x + Float64(y - Float64(y * Float64(z / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.1e+153) || ~((t <= 2.05e-45))) tmp = x + (y * (z / t)); else tmp = x + (y - (y * (z / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.1e+153], N[Not[LessEqual[t, 2.05e-45]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+153} \lor \neg \left(t \leq 2.05 \cdot 10^{-45}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{a}\right)\\
\end{array}
\end{array}
if t < -1.1e153 or 2.05e-45 < t Initial program 54.6%
Taylor expanded in t around inf 75.8%
associate--l+75.8%
distribute-lft-out--75.8%
div-sub75.8%
mul-1-neg75.8%
unsub-neg75.8%
*-commutative75.8%
distribute-lft-out--75.9%
Simplified75.9%
Taylor expanded in a around 0 70.3%
sub-neg70.3%
mul-1-neg70.3%
remove-double-neg70.3%
+-commutative70.3%
associate-/l*79.4%
Simplified79.4%
if -1.1e153 < t < 2.05e-45Initial program 89.0%
Taylor expanded in t around 0 84.0%
associate--l+84.0%
associate-/l*83.3%
Simplified83.3%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+52) (not (<= t 3.1e-28))) (+ x (* y (/ (- z a) t))) (+ x (- y (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+52) || !(t <= 3.1e-28)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = x + (y - (y * (z / a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-9d+52)) .or. (.not. (t <= 3.1d-28))) then
tmp = x + (y * ((z - a) / t))
else
tmp = x + (y - (y * (z / a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+52) || !(t <= 3.1e-28)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = x + (y - (y * (z / a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+52) or not (t <= 3.1e-28): tmp = x + (y * ((z - a) / t)) else: tmp = x + (y - (y * (z / a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+52) || !(t <= 3.1e-28)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(x + Float64(y - Float64(y * Float64(z / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e+52) || ~((t <= 3.1e-28))) tmp = x + (y * ((z - a) / t)); else tmp = x + (y - (y * (z / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+52], N[Not[LessEqual[t, 3.1e-28]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+52} \lor \neg \left(t \leq 3.1 \cdot 10^{-28}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{a}\right)\\
\end{array}
\end{array}
if t < -8.9999999999999999e52 or 3.09999999999999992e-28 < t Initial program 53.2%
Taylor expanded in t around inf 73.6%
associate--l+73.6%
distribute-lft-out--73.6%
div-sub73.7%
mul-1-neg73.7%
unsub-neg73.7%
*-commutative73.7%
distribute-lft-out--73.8%
Simplified73.8%
Taylor expanded in a around 0 73.6%
+-commutative73.6%
mul-1-neg73.6%
unsub-neg73.6%
div-sub73.7%
*-commutative73.7%
cancel-sign-sub-inv73.7%
distribute-rgt-in73.8%
sub-neg73.8%
associate-*r/82.5%
Simplified82.5%
if -8.9999999999999999e52 < t < 3.09999999999999992e-28Initial program 95.0%
Taylor expanded in t around 0 88.4%
associate--l+88.4%
associate-/l*87.7%
Simplified87.7%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.4e-106) (+ x y) (if (<= a -4.8e-166) (* y (/ z (- t a))) (if (<= a 7.5e+87) x (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e-106) {
tmp = x + y;
} else if (a <= -4.8e-166) {
tmp = y * (z / (t - a));
} else if (a <= 7.5e+87) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-8.4d-106)) then
tmp = x + y
else if (a <= (-4.8d-166)) then
tmp = y * (z / (t - a))
else if (a <= 7.5d+87) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e-106) {
tmp = x + y;
} else if (a <= -4.8e-166) {
tmp = y * (z / (t - a));
} else if (a <= 7.5e+87) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.4e-106: tmp = x + y elif a <= -4.8e-166: tmp = y * (z / (t - a)) elif a <= 7.5e+87: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.4e-106) tmp = Float64(x + y); elseif (a <= -4.8e-166) tmp = Float64(y * Float64(z / Float64(t - a))); elseif (a <= 7.5e+87) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.4e-106) tmp = x + y; elseif (a <= -4.8e-166) tmp = y * (z / (t - a)); elseif (a <= 7.5e+87) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.4e-106], N[(x + y), $MachinePrecision], If[LessEqual[a, -4.8e-166], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e+87], x, N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.4 \cdot 10^{-106}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{-166}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -8.40000000000000013e-106 or 7.50000000000000014e87 < a Initial program 77.3%
Taylor expanded in a around inf 74.1%
+-commutative74.1%
Simplified74.1%
if -8.40000000000000013e-106 < a < -4.7999999999999997e-166Initial program 85.8%
sub-neg85.8%
+-commutative85.8%
distribute-frac-neg85.8%
distribute-rgt-neg-out85.8%
associate-/l*86.0%
fma-define85.7%
distribute-frac-neg85.7%
distribute-neg-frac285.7%
sub-neg85.7%
distribute-neg-in85.7%
remove-double-neg85.7%
+-commutative85.7%
sub-neg85.7%
Simplified85.7%
Taylor expanded in z around inf 87.1%
associate-/l*87.1%
Simplified87.1%
if -4.7999999999999997e-166 < a < 7.50000000000000014e87Initial program 66.8%
Taylor expanded in x around inf 55.1%
Final simplification65.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e-74) (not (<= a 8e+87))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-74) || !(a <= 8e+87)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2d-74)) .or. (.not. (a <= 8d+87))) then
tmp = x + y
else
tmp = x + ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-74) || !(a <= 8e+87)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e-74) or not (a <= 8e+87): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e-74) || !(a <= 8e+87)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e-74) || ~((a <= 8e+87))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e-74], N[Not[LessEqual[a, 8e+87]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-74} \lor \neg \left(a \leq 8 \cdot 10^{+87}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -1.99999999999999992e-74 or 7.9999999999999997e87 < a Initial program 77.1%
Taylor expanded in a around inf 73.8%
+-commutative73.8%
Simplified73.8%
if -1.99999999999999992e-74 < a < 7.9999999999999997e87Initial program 68.3%
Taylor expanded in t around inf 75.0%
associate--l+75.0%
distribute-lft-out--75.0%
div-sub75.7%
mul-1-neg75.7%
unsub-neg75.7%
*-commutative75.7%
distribute-lft-out--75.7%
Simplified75.7%
Taylor expanded in a around 0 70.3%
mul-1-neg70.3%
distribute-rgt-neg-out70.3%
Simplified70.3%
Taylor expanded in y around 0 70.3%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.65e+95) (not (<= a 9.2e+87))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.65e+95) || !(a <= 9.2e+87)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.65d+95)) .or. (.not. (a <= 9.2d+87))) then
tmp = x + y
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.65e+95) || !(a <= 9.2e+87)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.65e+95) or not (a <= 9.2e+87): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.65e+95) || !(a <= 9.2e+87)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.65e+95) || ~((a <= 9.2e+87))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.65e+95], N[Not[LessEqual[a, 9.2e+87]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+95} \lor \neg \left(a \leq 9.2 \cdot 10^{+87}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -1.6499999999999999e95 or 9.2000000000000007e87 < a Initial program 80.4%
Taylor expanded in a around inf 85.4%
+-commutative85.4%
Simplified85.4%
if -1.6499999999999999e95 < a < 9.2000000000000007e87Initial program 68.5%
Taylor expanded in t around inf 69.0%
associate--l+69.0%
distribute-lft-out--69.0%
div-sub70.1%
mul-1-neg70.1%
unsub-neg70.1%
*-commutative70.1%
distribute-lft-out--70.1%
Simplified70.1%
Taylor expanded in a around 0 65.2%
sub-neg65.2%
mul-1-neg65.2%
remove-double-neg65.2%
+-commutative65.2%
associate-/l*70.5%
Simplified70.5%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9e-150) (not (<= a 7.5e+87))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9e-150) || !(a <= 7.5e+87)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-9d-150)) .or. (.not. (a <= 7.5d+87))) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9e-150) || !(a <= 7.5e+87)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9e-150) or not (a <= 7.5e+87): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9e-150) || !(a <= 7.5e+87)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9e-150) || ~((a <= 7.5e+87))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9e-150], N[Not[LessEqual[a, 7.5e+87]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{-150} \lor \neg \left(a \leq 7.5 \cdot 10^{+87}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.0000000000000005e-150 or 7.50000000000000014e87 < a Initial program 78.2%
Taylor expanded in a around inf 72.0%
+-commutative72.0%
Simplified72.0%
if -9.0000000000000005e-150 < a < 7.50000000000000014e87Initial program 66.6%
Taylor expanded in x around inf 54.3%
Final simplification63.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 72.3%
Taylor expanded in x around inf 46.6%
Final simplification46.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024071
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))