
(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 13 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) (/ (* y (- z t)) (- a t)))))
(if (<= t_1 -2e-224)
(+ (+ x y) (/ (- z t) (/ (- t a) y)))
(if (<= t_1 0.0)
(- x (/ (* y (- a z)) t))
(- (+ x y) (* y (* (- z t) (/ -1.0 (- t a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_1 <= -2e-224) {
tmp = (x + y) + ((z - t) / ((t - a) / y));
} else if (t_1 <= 0.0) {
tmp = x - ((y * (a - z)) / t);
} else {
tmp = (x + y) - (y * ((z - t) * (-1.0 / (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) :: t_1
real(8) :: tmp
t_1 = (x + y) - ((y * (z - t)) / (a - t))
if (t_1 <= (-2d-224)) then
tmp = (x + y) + ((z - t) / ((t - a) / y))
else if (t_1 <= 0.0d0) then
tmp = x - ((y * (a - z)) / t)
else
tmp = (x + y) - (y * ((z - t) * ((-1.0d0) / (t - a))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_1 <= -2e-224) {
tmp = (x + y) + ((z - t) / ((t - a) / y));
} else if (t_1 <= 0.0) {
tmp = x - ((y * (a - z)) / t);
} else {
tmp = (x + y) - (y * ((z - t) * (-1.0 / (t - a))));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if t_1 <= -2e-224: tmp = (x + y) + ((z - t) / ((t - a) / y)) elif t_1 <= 0.0: tmp = x - ((y * (a - z)) / t) else: tmp = (x + y) - (y * ((z - t) * (-1.0 / (t - a)))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e-224) tmp = Float64(Float64(x + y) + Float64(Float64(z - t) / Float64(Float64(t - a) / y))); elseif (t_1 <= 0.0) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); else tmp = Float64(Float64(x + y) - Float64(y * Float64(Float64(z - t) * Float64(-1.0 / Float64(t - a))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if (t_1 <= -2e-224) tmp = (x + y) + ((z - t) / ((t - a) / y)); elseif (t_1 <= 0.0) tmp = x - ((y * (a - z)) / t); else tmp = (x + y) - (y * ((z - t) * (-1.0 / (t - a)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-224], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(N[(z - t), $MachinePrecision] * N[(-1.0 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-224}:\\
\;\;\;\;\left(x + y\right) + \frac{z - t}{\frac{t - a}{y}}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \left(\left(z - t\right) \cdot \frac{-1}{t - a}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-224Initial program 82.9%
clear-num82.9%
inv-pow82.9%
*-commutative82.9%
associate-/r*90.1%
Applied egg-rr90.1%
unpow-190.1%
clear-num90.1%
div-sub90.0%
Applied egg-rr90.0%
div-sub90.1%
Simplified90.1%
if -2e-224 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 8.2%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
distribute-lft-out--99.9%
div-sub99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
distribute-lft-out--99.9%
Simplified99.9%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 81.3%
div-inv81.2%
*-commutative81.2%
associate-*l*92.8%
Applied egg-rr92.8%
Final simplification92.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (* (- z t) (/ y (- t a)))))
(t_2 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_2 -2e-224)
t_1
(if (<= t_2 0.0)
(- x (/ (* y (- a z)) t))
(if (<= t_2 2e+303) t_2 t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((z - t) * (y / (t - a)));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-224) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = x - ((y * (a - z)) / t);
} else if (t_2 <= 2e+303) {
tmp = t_2;
} 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 = (x + y) + ((z - t) * (y / (t - a)))
t_2 = (x + y) - ((y * (z - t)) / (a - t))
if (t_2 <= (-2d-224)) then
tmp = t_1
else if (t_2 <= 0.0d0) then
tmp = x - ((y * (a - z)) / t)
else if (t_2 <= 2d+303) then
tmp = t_2
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 = (x + y) + ((z - t) * (y / (t - a)));
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -2e-224) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = x - ((y * (a - z)) / t);
} else if (t_2 <= 2e+303) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((z - t) * (y / (t - a))) t_2 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if t_2 <= -2e-224: tmp = t_1 elif t_2 <= 0.0: tmp = x - ((y * (a - z)) / t) elif t_2 <= 2e+303: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))) t_2 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-224) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); elseif (t_2 <= 2e+303) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((z - t) * (y / (t - a))); t_2 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if (t_2 <= -2e-224) tmp = t_1; elseif (t_2 <= 0.0) tmp = x - ((y * (a - z)) / t); elseif (t_2 <= 2e+303) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $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, -2e-224], t$95$1, If[LessEqual[t$95$2, 0.0], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+303], t$95$2, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
t_2 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-224 or 2e303 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 72.1%
Taylor expanded in y around 0 72.1%
associate-*l/87.7%
Simplified87.7%
if -2e-224 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 8.2%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
distribute-lft-out--99.9%
div-sub99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
distribute-lft-out--99.9%
Simplified99.9%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 2e303Initial program 96.9%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (or (<= t_1 -2e-224) (not (<= t_1 0.0)))
(+ (+ x y) (/ (- z t) (/ (- t a) y)))
(- x (/ (* y (- a z)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -2e-224) || !(t_1 <= 0.0)) {
tmp = (x + y) + ((z - t) / ((t - a) / y));
} else {
tmp = x - ((y * (a - 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) :: t_1
real(8) :: tmp
t_1 = (x + y) - ((y * (z - t)) / (a - t))
if ((t_1 <= (-2d-224)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = (x + y) + ((z - t) / ((t - a) / y))
else
tmp = x - ((y * (a - z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -2e-224) || !(t_1 <= 0.0)) {
tmp = (x + y) + ((z - t) / ((t - a) / y));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if (t_1 <= -2e-224) or not (t_1 <= 0.0): tmp = (x + y) + ((z - t) / ((t - a) / y)) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -2e-224) || !(t_1 <= 0.0)) tmp = Float64(Float64(x + y) + Float64(Float64(z - t) / Float64(Float64(t - a) / y))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if ((t_1 <= -2e-224) || ~((t_1 <= 0.0))) tmp = (x + y) + ((z - t) / ((t - a) / y)); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-224], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-224} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\left(x + y\right) + \frac{z - t}{\frac{t - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -2e-224 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.1%
clear-num82.0%
inv-pow82.0%
*-commutative82.0%
associate-/r*90.2%
Applied egg-rr90.2%
unpow-190.2%
clear-num90.3%
div-sub90.2%
Applied egg-rr90.2%
div-sub90.3%
Simplified90.3%
if -2e-224 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 8.2%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
distribute-lft-out--99.9%
div-sub99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
distribute-lft-out--99.9%
Simplified99.9%
Final simplification91.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- t a)))))
(if (<= a -6.3e-195)
(+ x y)
(if (<= a 9.5e-271)
t_1
(if (<= a 3.1e-213) x (if (<= a 5e-113) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (t - a));
double tmp;
if (a <= -6.3e-195) {
tmp = x + y;
} else if (a <= 9.5e-271) {
tmp = t_1;
} else if (a <= 3.1e-213) {
tmp = x;
} else if (a <= 5e-113) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (z / (t - a))
if (a <= (-6.3d-195)) then
tmp = x + y
else if (a <= 9.5d-271) then
tmp = t_1
else if (a <= 3.1d-213) then
tmp = x
else if (a <= 5d-113) then
tmp = t_1
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 t_1 = y * (z / (t - a));
double tmp;
if (a <= -6.3e-195) {
tmp = x + y;
} else if (a <= 9.5e-271) {
tmp = t_1;
} else if (a <= 3.1e-213) {
tmp = x;
} else if (a <= 5e-113) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (t - a)) tmp = 0 if a <= -6.3e-195: tmp = x + y elif a <= 9.5e-271: tmp = t_1 elif a <= 3.1e-213: tmp = x elif a <= 5e-113: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(t - a))) tmp = 0.0 if (a <= -6.3e-195) tmp = Float64(x + y); elseif (a <= 9.5e-271) tmp = t_1; elseif (a <= 3.1e-213) tmp = x; elseif (a <= 5e-113) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (t - a)); tmp = 0.0; if (a <= -6.3e-195) tmp = x + y; elseif (a <= 9.5e-271) tmp = t_1; elseif (a <= 3.1e-213) tmp = x; elseif (a <= 5e-113) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.3e-195], N[(x + y), $MachinePrecision], If[LessEqual[a, 9.5e-271], t$95$1, If[LessEqual[a, 3.1e-213], x, If[LessEqual[a, 5e-113], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t - a}\\
\mathbf{if}\;a \leq -6.3 \cdot 10^{-195}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -6.3e-195 or 4.9999999999999997e-113 < a Initial program 79.2%
Taylor expanded in a around inf 71.3%
+-commutative71.3%
Simplified71.3%
if -6.3e-195 < a < 9.50000000000000103e-271 or 3.0999999999999998e-213 < a < 4.9999999999999997e-113Initial program 66.6%
sub-neg66.6%
+-commutative66.6%
distribute-frac-neg66.6%
distribute-rgt-neg-out66.6%
associate-/l*75.4%
fma-define75.4%
distribute-frac-neg75.4%
distribute-neg-frac275.4%
sub-neg75.4%
distribute-neg-in75.4%
remove-double-neg75.4%
+-commutative75.4%
sub-neg75.4%
Simplified75.4%
Taylor expanded in z around inf 58.9%
associate-/l*67.2%
Simplified67.2%
if 9.50000000000000103e-271 < a < 3.0999999999999998e-213Initial program 66.0%
Taylor expanded in x around inf 70.3%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.8e-177)
(+ x y)
(if (<= a 8.6e-271)
(* y (/ z (- t a)))
(if (<= a 8.5e-213) x (if (<= a 5.5e-113) (* y (/ (- z a) t)) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-177) {
tmp = x + y;
} else if (a <= 8.6e-271) {
tmp = y * (z / (t - a));
} else if (a <= 8.5e-213) {
tmp = x;
} else if (a <= 5.5e-113) {
tmp = y * ((z - a) / t);
} 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 <= (-1.8d-177)) then
tmp = x + y
else if (a <= 8.6d-271) then
tmp = y * (z / (t - a))
else if (a <= 8.5d-213) then
tmp = x
else if (a <= 5.5d-113) then
tmp = y * ((z - a) / t)
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 <= -1.8e-177) {
tmp = x + y;
} else if (a <= 8.6e-271) {
tmp = y * (z / (t - a));
} else if (a <= 8.5e-213) {
tmp = x;
} else if (a <= 5.5e-113) {
tmp = y * ((z - a) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e-177: tmp = x + y elif a <= 8.6e-271: tmp = y * (z / (t - a)) elif a <= 8.5e-213: tmp = x elif a <= 5.5e-113: tmp = y * ((z - a) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e-177) tmp = Float64(x + y); elseif (a <= 8.6e-271) tmp = Float64(y * Float64(z / Float64(t - a))); elseif (a <= 8.5e-213) tmp = x; elseif (a <= 5.5e-113) tmp = Float64(y * Float64(Float64(z - a) / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e-177) tmp = x + y; elseif (a <= 8.6e-271) tmp = y * (z / (t - a)); elseif (a <= 8.5e-213) tmp = x; elseif (a <= 5.5e-113) tmp = y * ((z - a) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e-177], N[(x + y), $MachinePrecision], If[LessEqual[a, 8.6e-271], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e-213], x, If[LessEqual[a, 5.5e-113], N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-177}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 8.6 \cdot 10^{-271}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-113}:\\
\;\;\;\;y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.79999999999999991e-177 or 5.50000000000000053e-113 < a Initial program 79.2%
Taylor expanded in a around inf 71.3%
+-commutative71.3%
Simplified71.3%
if -1.79999999999999991e-177 < a < 8.6e-271Initial program 65.9%
sub-neg65.9%
+-commutative65.9%
distribute-frac-neg65.9%
distribute-rgt-neg-out65.9%
associate-/l*75.1%
fma-define75.3%
distribute-frac-neg75.3%
distribute-neg-frac275.3%
sub-neg75.3%
distribute-neg-in75.3%
remove-double-neg75.3%
+-commutative75.3%
sub-neg75.3%
Simplified75.3%
Taylor expanded in z around inf 67.2%
associate-/l*73.2%
Simplified73.2%
if 8.6e-271 < a < 8.49999999999999994e-213Initial program 66.0%
Taylor expanded in x around inf 70.3%
if 8.49999999999999994e-213 < a < 5.50000000000000053e-113Initial program 67.5%
sub-neg67.5%
+-commutative67.5%
distribute-frac-neg67.5%
distribute-rgt-neg-out67.5%
associate-/l*75.8%
fma-define75.6%
distribute-frac-neg75.6%
distribute-neg-frac275.6%
sub-neg75.6%
distribute-neg-in75.6%
remove-double-neg75.6%
+-commutative75.6%
sub-neg75.6%
Simplified75.6%
Taylor expanded in t around inf 75.8%
associate-+r+83.8%
distribute-rgt1-in83.8%
metadata-eval83.8%
mul0-lft83.8%
associate-+r+83.8%
associate-/l*95.3%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in y around inf 64.7%
div-sub64.7%
Simplified64.7%
Final simplification70.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z t))))
(if (<= a -5e-187)
(+ x y)
(if (<= a 7e-271)
t_1
(if (<= a 6e-212) x (if (<= a 4.9e-113) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (a <= -5e-187) {
tmp = x + y;
} else if (a <= 7e-271) {
tmp = t_1;
} else if (a <= 6e-212) {
tmp = x;
} else if (a <= 4.9e-113) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (z / t)
if (a <= (-5d-187)) then
tmp = x + y
else if (a <= 7d-271) then
tmp = t_1
else if (a <= 6d-212) then
tmp = x
else if (a <= 4.9d-113) then
tmp = t_1
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 t_1 = y * (z / t);
double tmp;
if (a <= -5e-187) {
tmp = x + y;
} else if (a <= 7e-271) {
tmp = t_1;
} else if (a <= 6e-212) {
tmp = x;
} else if (a <= 4.9e-113) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / t) tmp = 0 if a <= -5e-187: tmp = x + y elif a <= 7e-271: tmp = t_1 elif a <= 6e-212: tmp = x elif a <= 4.9e-113: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / t)) tmp = 0.0 if (a <= -5e-187) tmp = Float64(x + y); elseif (a <= 7e-271) tmp = t_1; elseif (a <= 6e-212) tmp = x; elseif (a <= 4.9e-113) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / t); tmp = 0.0; if (a <= -5e-187) tmp = x + y; elseif (a <= 7e-271) tmp = t_1; elseif (a <= 6e-212) tmp = x; elseif (a <= 4.9e-113) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5e-187], N[(x + y), $MachinePrecision], If[LessEqual[a, 7e-271], t$95$1, If[LessEqual[a, 6e-212], x, If[LessEqual[a, 4.9e-113], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;a \leq -5 \cdot 10^{-187}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 7 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-212}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{-113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.9999999999999996e-187 or 4.9000000000000003e-113 < a Initial program 79.2%
Taylor expanded in a around inf 71.3%
+-commutative71.3%
Simplified71.3%
if -4.9999999999999996e-187 < a < 6.9999999999999999e-271 or 6.0000000000000005e-212 < a < 4.9000000000000003e-113Initial program 66.6%
sub-neg66.6%
+-commutative66.6%
distribute-frac-neg66.6%
distribute-rgt-neg-out66.6%
associate-/l*75.4%
fma-define75.4%
distribute-frac-neg75.4%
distribute-neg-frac275.4%
sub-neg75.4%
distribute-neg-in75.4%
remove-double-neg75.4%
+-commutative75.4%
sub-neg75.4%
Simplified75.4%
Taylor expanded in z around inf 58.9%
Taylor expanded in t around inf 55.3%
associate-*r/63.6%
Simplified63.6%
if 6.9999999999999999e-271 < a < 6.0000000000000005e-212Initial program 66.0%
Taylor expanded in x around inf 70.3%
Final simplification69.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e-69) (not (<= a 7.2e-124))) (+ (+ x y) (* (- z t) (/ y (- t a)))) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e-69) || !(a <= 7.2e-124)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x - ((y * (a - 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 <= (-2.3d-69)) .or. (.not. (a <= 7.2d-124))) then
tmp = (x + y) + ((z - t) * (y / (t - a)))
else
tmp = x - ((y * (a - 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 <= -2.3e-69) || !(a <= 7.2e-124)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.3e-69) or not (a <= 7.2e-124): tmp = (x + y) + ((z - t) * (y / (t - a))) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e-69) || !(a <= 7.2e-124)) tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.3e-69) || ~((a <= 7.2e-124))) tmp = (x + y) + ((z - t) * (y / (t - a))); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e-69], N[Not[LessEqual[a, 7.2e-124]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-69} \lor \neg \left(a \leq 7.2 \cdot 10^{-124}\right):\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -2.3000000000000001e-69 or 7.20000000000000019e-124 < a Initial program 80.4%
Taylor expanded in y around 0 80.4%
associate-*l/88.9%
Simplified88.9%
if -2.3000000000000001e-69 < a < 7.20000000000000019e-124Initial program 67.5%
Taylor expanded in t around inf 82.1%
associate--l+82.1%
distribute-lft-out--82.1%
div-sub83.2%
mul-1-neg83.2%
unsub-neg83.2%
*-commutative83.2%
distribute-lft-out--83.2%
Simplified83.2%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.8e-56) (not (<= a 1.75e+48))) (+ x y) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.8e-56) || !(a <= 1.75e+48)) {
tmp = x + y;
} else {
tmp = x - ((y * (a - 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.8d-56)) .or. (.not. (a <= 1.75d+48))) then
tmp = x + y
else
tmp = x - ((y * (a - 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.8e-56) || !(a <= 1.75e+48)) {
tmp = x + y;
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.8e-56) or not (a <= 1.75e+48): tmp = x + y else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.8e-56) || !(a <= 1.75e+48)) tmp = Float64(x + y); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.8e-56) || ~((a <= 1.75e+48))) tmp = x + y; else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.8e-56], N[Not[LessEqual[a, 1.75e+48]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-56} \lor \neg \left(a \leq 1.75 \cdot 10^{+48}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -1.79999999999999989e-56 or 1.7499999999999999e48 < a Initial program 79.8%
Taylor expanded in a around inf 81.4%
+-commutative81.4%
Simplified81.4%
if -1.79999999999999989e-56 < a < 1.7499999999999999e48Initial program 72.3%
Taylor expanded in t around inf 76.1%
associate--l+76.1%
distribute-lft-out--76.1%
div-sub77.6%
mul-1-neg77.6%
unsub-neg77.6%
*-commutative77.6%
distribute-lft-out--77.6%
Simplified77.6%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.56e-65) (not (<= a 1.35e-65))) (- (+ x y) (* y (/ z a))) (- x (/ (* y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.56e-65) || !(a <= 1.35e-65)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - ((y * (a - 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.56d-65)) .or. (.not. (a <= 1.35d-65))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x - ((y * (a - 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.56e-65) || !(a <= 1.35e-65)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.56e-65) or not (a <= 1.35e-65): tmp = (x + y) - (y * (z / a)) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.56e-65) || !(a <= 1.35e-65)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.56e-65) || ~((a <= 1.35e-65))) tmp = (x + y) - (y * (z / a)); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.56e-65], N[Not[LessEqual[a, 1.35e-65]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.56 \cdot 10^{-65} \lor \neg \left(a \leq 1.35 \cdot 10^{-65}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if a < -1.55999999999999993e-65 or 1.3499999999999999e-65 < a Initial program 79.2%
Taylor expanded in t around 0 78.4%
+-commutative78.4%
associate-/l*84.4%
Simplified84.4%
if -1.55999999999999993e-65 < a < 1.3499999999999999e-65Initial program 71.3%
Taylor expanded in t around inf 80.3%
associate--l+80.3%
distribute-lft-out--80.3%
div-sub82.0%
mul-1-neg82.0%
unsub-neg82.0%
*-commutative82.0%
distribute-lft-out--82.0%
Simplified82.0%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e-55) (not (<= a 3.65e-65))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-55) || !(a <= 3.65e-65)) {
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 <= (-2.2d-55)) .or. (.not. (a <= 3.65d-65))) 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 <= -2.2e-55) || !(a <= 3.65e-65)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e-55) or not (a <= 3.65e-65): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e-55) || !(a <= 3.65e-65)) 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 <= -2.2e-55) || ~((a <= 3.65e-65))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e-55], N[Not[LessEqual[a, 3.65e-65]], $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.2 \cdot 10^{-55} \lor \neg \left(a \leq 3.65 \cdot 10^{-65}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -2.2e-55 or 3.6499999999999999e-65 < a Initial program 79.0%
Taylor expanded in a around inf 77.7%
+-commutative77.7%
Simplified77.7%
if -2.2e-55 < a < 3.6499999999999999e-65Initial program 71.6%
sub-neg71.6%
+-commutative71.6%
distribute-frac-neg71.6%
distribute-rgt-neg-out71.6%
associate-/l*75.9%
fma-define76.1%
distribute-frac-neg76.1%
distribute-neg-frac276.1%
sub-neg76.1%
distribute-neg-in76.1%
remove-double-neg76.1%
+-commutative76.1%
sub-neg76.1%
Simplified76.1%
Taylor expanded in t around inf 73.5%
associate-+r+79.6%
distribute-rgt1-in79.6%
metadata-eval79.6%
mul0-lft79.6%
associate-+r+79.6%
associate-/l*85.9%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in a around 0 76.9%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.4e-5) (not (<= a 1.8e-199))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.4e-5) || !(a <= 1.8e-199)) {
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 <= (-3.4d-5)) .or. (.not. (a <= 1.8d-199))) 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 <= -3.4e-5) || !(a <= 1.8e-199)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.4e-5) or not (a <= 1.8e-199): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.4e-5) || !(a <= 1.8e-199)) 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 <= -3.4e-5) || ~((a <= 1.8e-199))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.4e-5], N[Not[LessEqual[a, 1.8e-199]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{-5} \lor \neg \left(a \leq 1.8 \cdot 10^{-199}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.4e-5 or 1.8000000000000001e-199 < a Initial program 79.0%
Taylor expanded in a around inf 71.5%
+-commutative71.5%
Simplified71.5%
if -3.4e-5 < a < 1.8000000000000001e-199Initial program 69.3%
Taylor expanded in x around inf 43.9%
Final simplification62.2%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 75.7%
Taylor expanded in x around 0 36.8%
associate-*r/42.9%
Simplified42.9%
Taylor expanded in z around 0 17.6%
sub-neg17.6%
mul-1-neg17.6%
remove-double-neg17.6%
associate-/l*20.3%
Simplified20.3%
Taylor expanded in t around inf 2.7%
distribute-rgt1-in2.7%
metadata-eval2.7%
mul0-lft2.7%
Simplified2.7%
Final simplification2.7%
(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 75.7%
Taylor expanded in x around inf 47.9%
Final simplification47.9%
(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 2024066
(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))))