
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\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 z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - 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 + (a * ((y - z) / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Initial program 96.3%
associate-/r/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (- z y)))))
(if (<= z -8.2e+57)
(- x a)
(if (<= z 1.8e-269)
t_1
(if (<= z 6e-204)
(- x (* a (/ y t)))
(if (<= z 0.0185) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (z - y));
double tmp;
if (z <= -8.2e+57) {
tmp = x - a;
} else if (z <= 1.8e-269) {
tmp = t_1;
} else if (z <= 6e-204) {
tmp = x - (a * (y / t));
} else if (z <= 0.0185) {
tmp = t_1;
} else {
tmp = x - 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 + (a * (z - y))
if (z <= (-8.2d+57)) then
tmp = x - a
else if (z <= 1.8d-269) then
tmp = t_1
else if (z <= 6d-204) then
tmp = x - (a * (y / t))
else if (z <= 0.0185d0) then
tmp = t_1
else
tmp = x - 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 + (a * (z - y));
double tmp;
if (z <= -8.2e+57) {
tmp = x - a;
} else if (z <= 1.8e-269) {
tmp = t_1;
} else if (z <= 6e-204) {
tmp = x - (a * (y / t));
} else if (z <= 0.0185) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * (z - y)) tmp = 0 if z <= -8.2e+57: tmp = x - a elif z <= 1.8e-269: tmp = t_1 elif z <= 6e-204: tmp = x - (a * (y / t)) elif z <= 0.0185: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(z - y))) tmp = 0.0 if (z <= -8.2e+57) tmp = Float64(x - a); elseif (z <= 1.8e-269) tmp = t_1; elseif (z <= 6e-204) tmp = Float64(x - Float64(a * Float64(y / t))); elseif (z <= 0.0185) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * (z - y)); tmp = 0.0; if (z <= -8.2e+57) tmp = x - a; elseif (z <= 1.8e-269) tmp = t_1; elseif (z <= 6e-204) tmp = x - (a * (y / t)); elseif (z <= 0.0185) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+57], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.8e-269], t$95$1, If[LessEqual[z, 6e-204], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0185], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(z - y\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+57}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-204}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 0.0185:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.2e57 or 0.0184999999999999991 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -8.2e57 < z < 1.79999999999999999e-269 or 5.9999999999999997e-204 < z < 0.0184999999999999991Initial program 99.0%
Taylor expanded in z around 0 98.1%
Taylor expanded in t around 0 81.9%
if 1.79999999999999999e-269 < z < 5.9999999999999997e-204Initial program 100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 99.9%
Taylor expanded in t around inf 83.0%
associate-/l*83.0%
Simplified83.0%
Final simplification81.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (- z y)))))
(if (<= z -8.2e+57)
(- x a)
(if (<= z 1.8e-269)
t_1
(if (<= z 1.25e-203)
(- x (/ (* y a) t))
(if (<= z 0.019) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (z - y));
double tmp;
if (z <= -8.2e+57) {
tmp = x - a;
} else if (z <= 1.8e-269) {
tmp = t_1;
} else if (z <= 1.25e-203) {
tmp = x - ((y * a) / t);
} else if (z <= 0.019) {
tmp = t_1;
} else {
tmp = x - 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 + (a * (z - y))
if (z <= (-8.2d+57)) then
tmp = x - a
else if (z <= 1.8d-269) then
tmp = t_1
else if (z <= 1.25d-203) then
tmp = x - ((y * a) / t)
else if (z <= 0.019d0) then
tmp = t_1
else
tmp = x - 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 + (a * (z - y));
double tmp;
if (z <= -8.2e+57) {
tmp = x - a;
} else if (z <= 1.8e-269) {
tmp = t_1;
} else if (z <= 1.25e-203) {
tmp = x - ((y * a) / t);
} else if (z <= 0.019) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * (z - y)) tmp = 0 if z <= -8.2e+57: tmp = x - a elif z <= 1.8e-269: tmp = t_1 elif z <= 1.25e-203: tmp = x - ((y * a) / t) elif z <= 0.019: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(z - y))) tmp = 0.0 if (z <= -8.2e+57) tmp = Float64(x - a); elseif (z <= 1.8e-269) tmp = t_1; elseif (z <= 1.25e-203) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (z <= 0.019) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * (z - y)); tmp = 0.0; if (z <= -8.2e+57) tmp = x - a; elseif (z <= 1.8e-269) tmp = t_1; elseif (z <= 1.25e-203) tmp = x - ((y * a) / t); elseif (z <= 0.019) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+57], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.8e-269], t$95$1, If[LessEqual[z, 1.25e-203], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.019], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \left(z - y\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+57}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-203}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;z \leq 0.019:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.2e57 or 0.0189999999999999995 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -8.2e57 < z < 1.79999999999999999e-269 or 1.25e-203 < z < 0.0189999999999999995Initial program 99.0%
Taylor expanded in z around 0 98.1%
Taylor expanded in t around 0 81.9%
if 1.79999999999999999e-269 < z < 1.25e-203Initial program 100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 99.9%
Taylor expanded in t around inf 83.0%
Final simplification81.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z a))))
(if (<= z -1.6e-25)
(- x a)
(if (<= z 3e-207)
t_1
(if (<= z 1.6e-179) (* y (- a)) (if (<= z 0.019) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * a);
double tmp;
if (z <= -1.6e-25) {
tmp = x - a;
} else if (z <= 3e-207) {
tmp = t_1;
} else if (z <= 1.6e-179) {
tmp = y * -a;
} else if (z <= 0.019) {
tmp = t_1;
} else {
tmp = x - 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 + (z * a)
if (z <= (-1.6d-25)) then
tmp = x - a
else if (z <= 3d-207) then
tmp = t_1
else if (z <= 1.6d-179) then
tmp = y * -a
else if (z <= 0.019d0) then
tmp = t_1
else
tmp = x - 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 + (z * a);
double tmp;
if (z <= -1.6e-25) {
tmp = x - a;
} else if (z <= 3e-207) {
tmp = t_1;
} else if (z <= 1.6e-179) {
tmp = y * -a;
} else if (z <= 0.019) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * a) tmp = 0 if z <= -1.6e-25: tmp = x - a elif z <= 3e-207: tmp = t_1 elif z <= 1.6e-179: tmp = y * -a elif z <= 0.019: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * a)) tmp = 0.0 if (z <= -1.6e-25) tmp = Float64(x - a); elseif (z <= 3e-207) tmp = t_1; elseif (z <= 1.6e-179) tmp = Float64(y * Float64(-a)); elseif (z <= 0.019) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * a); tmp = 0.0; if (z <= -1.6e-25) tmp = x - a; elseif (z <= 3e-207) tmp = t_1; elseif (z <= 1.6e-179) tmp = y * -a; elseif (z <= 0.019) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e-25], N[(x - a), $MachinePrecision], If[LessEqual[z, 3e-207], t$95$1, If[LessEqual[z, 1.6e-179], N[(y * (-a)), $MachinePrecision], If[LessEqual[z, 0.019], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot a\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-25}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-179}:\\
\;\;\;\;y \cdot \left(-a\right)\\
\mathbf{elif}\;z \leq 0.019:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.6000000000000001e-25 or 0.0189999999999999995 < z Initial program 93.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.7%
if -1.6000000000000001e-25 < z < 2.9999999999999999e-207 or 1.6e-179 < z < 0.0189999999999999995Initial program 99.0%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in t around 0 78.6%
Taylor expanded in y around 0 58.3%
sub-neg58.3%
mul-1-neg58.3%
remove-double-neg58.3%
Simplified58.3%
Taylor expanded in z around 0 58.3%
if 2.9999999999999999e-207 < z < 1.6e-179Initial program 99.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 85.2%
Taylor expanded in x around 0 70.6%
associate-*r/70.6%
neg-mul-170.6%
distribute-rgt-neg-out70.6%
distribute-neg-frac270.6%
Simplified70.6%
Taylor expanded in z around 0 70.7%
associate-*r*70.7%
mul-1-neg70.7%
Simplified70.7%
Final simplification68.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e+100) (not (<= z 8.2e+18))) (- x (/ (- z y) (/ z a))) (+ x (* a (/ (- y z) (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e+100) || !(z <= 8.2e+18)) {
tmp = x - ((z - y) / (z / a));
} else {
tmp = x + (a * ((y - z) / (-1.0 - 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 ((z <= (-8d+100)) .or. (.not. (z <= 8.2d+18))) then
tmp = x - ((z - y) / (z / a))
else
tmp = x + (a * ((y - z) / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e+100) || !(z <= 8.2e+18)) {
tmp = x - ((z - y) / (z / a));
} else {
tmp = x + (a * ((y - z) / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e+100) or not (z <= 8.2e+18): tmp = x - ((z - y) / (z / a)) else: tmp = x + (a * ((y - z) / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e+100) || !(z <= 8.2e+18)) tmp = Float64(x - Float64(Float64(z - y) / Float64(z / a))); else tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e+100) || ~((z <= 8.2e+18))) tmp = x - ((z - y) / (z / a)); else tmp = x + (a * ((y - z) / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e+100], N[Not[LessEqual[z, 8.2e+18]], $MachinePrecision]], N[(x - N[(N[(z - y), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+100} \lor \neg \left(z \leq 8.2 \cdot 10^{+18}\right):\\
\;\;\;\;x - \frac{z - y}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y - z}{-1 - t}\\
\end{array}
\end{array}
if z < -8.00000000000000013e100 or 8.2e18 < z Initial program 92.7%
Taylor expanded in z around inf 89.7%
mul-1-neg89.7%
distribute-neg-frac289.7%
Simplified89.7%
if -8.00000000000000013e100 < z < 8.2e18Initial program 98.6%
Taylor expanded in z around 0 97.2%
associate-/r/98.4%
Applied egg-rr98.4%
Final simplification95.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.75e-38) (- x a) (if (<= z 2.6e-207) x (if (<= z 3.6e-178) (* y (- a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-38) {
tmp = x - a;
} else if (z <= 2.6e-207) {
tmp = x;
} else if (z <= 3.6e-178) {
tmp = y * -a;
} else {
tmp = x - 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 (z <= (-1.75d-38)) then
tmp = x - a
else if (z <= 2.6d-207) then
tmp = x
else if (z <= 3.6d-178) then
tmp = y * -a
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-38) {
tmp = x - a;
} else if (z <= 2.6e-207) {
tmp = x;
} else if (z <= 3.6e-178) {
tmp = y * -a;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e-38: tmp = x - a elif z <= 2.6e-207: tmp = x elif z <= 3.6e-178: tmp = y * -a else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-38) tmp = Float64(x - a); elseif (z <= 2.6e-207) tmp = x; elseif (z <= 3.6e-178) tmp = Float64(y * Float64(-a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.75e-38) tmp = x - a; elseif (z <= 2.6e-207) tmp = x; elseif (z <= 3.6e-178) tmp = y * -a; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e-38], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.6e-207], x, If[LessEqual[z, 3.6e-178], N[(y * (-a)), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-38}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-207}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-178}:\\
\;\;\;\;y \cdot \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.7500000000000001e-38 or 3.59999999999999994e-178 < z Initial program 95.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 68.6%
if -1.7500000000000001e-38 < z < 2.5999999999999999e-207Initial program 98.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in y around inf 95.8%
*-commutative95.8%
associate--l+95.8%
+-commutative95.8%
associate-*r/97.0%
+-commutative97.0%
associate--l+97.0%
associate--l+97.0%
Simplified97.0%
Taylor expanded in x around inf 60.0%
if 2.5999999999999999e-207 < z < 3.59999999999999994e-178Initial program 99.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 85.2%
Taylor expanded in x around 0 70.6%
associate-*r/70.6%
neg-mul-170.6%
distribute-rgt-neg-out70.6%
distribute-neg-frac270.6%
Simplified70.6%
Taylor expanded in z around 0 70.7%
associate-*r*70.7%
mul-1-neg70.7%
Simplified70.7%
Final simplification66.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.3e+97) (not (<= z 1.1e+19))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e+97) || !(z <= 1.1e+19)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - 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 ((z <= (-5.3d+97)) .or. (.not. (z <= 1.1d+19))) then
tmp = x - a
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e+97) || !(z <= 1.1e+19)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.3e+97) or not (z <= 1.1e+19): tmp = x - a else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.3e+97) || !(z <= 1.1e+19)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.3e+97) || ~((z <= 1.1e+19))) tmp = x - a; else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.3e+97], N[Not[LessEqual[z, 1.1e+19]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+97} \lor \neg \left(z \leq 1.1 \cdot 10^{+19}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -5.3000000000000003e97 or 1.1e19 < z Initial program 92.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.8%
if -5.3000000000000003e97 < z < 1.1e19Initial program 98.6%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 93.8%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e+95) (not (<= z 7.2e+18))) (- x (/ (- z y) (/ z a))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+95) || !(z <= 7.2e+18)) {
tmp = x - ((z - y) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - 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 ((z <= (-7.6d+95)) .or. (.not. (z <= 7.2d+18))) then
tmp = x - ((z - y) / (z / a))
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+95) || !(z <= 7.2e+18)) {
tmp = x - ((z - y) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e+95) or not (z <= 7.2e+18): tmp = x - ((z - y) / (z / a)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e+95) || !(z <= 7.2e+18)) tmp = Float64(x - Float64(Float64(z - y) / Float64(z / a))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.6e+95) || ~((z <= 7.2e+18))) tmp = x - ((z - y) / (z / a)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e+95], N[Not[LessEqual[z, 7.2e+18]], $MachinePrecision]], N[(x - N[(N[(z - y), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+95} \lor \neg \left(z \leq 7.2 \cdot 10^{+18}\right):\\
\;\;\;\;x - \frac{z - y}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -7.5999999999999999e95 or 7.2e18 < z Initial program 92.8%
Taylor expanded in z around inf 89.0%
mul-1-neg89.0%
distribute-neg-frac289.0%
Simplified89.0%
if -7.5999999999999999e95 < z < 7.2e18Initial program 98.6%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 93.8%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+57) (not (<= z 0.019))) (- x a) (+ x (* a (- z y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+57) || !(z <= 0.019)) {
tmp = x - a;
} else {
tmp = x + (a * (z - 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 ((z <= (-8.2d+57)) .or. (.not. (z <= 0.019d0))) then
tmp = x - a
else
tmp = x + (a * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+57) || !(z <= 0.019)) {
tmp = x - a;
} else {
tmp = x + (a * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+57) or not (z <= 0.019): tmp = x - a else: tmp = x + (a * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+57) || !(z <= 0.019)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.2e+57) || ~((z <= 0.019))) tmp = x - a; else tmp = x + (a * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+57], N[Not[LessEqual[z, 0.019]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+57} \lor \neg \left(z \leq 0.019\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(z - y\right)\\
\end{array}
\end{array}
if z < -8.2e57 or 0.0189999999999999995 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -8.2e57 < z < 0.0189999999999999995Initial program 99.1%
Taylor expanded in z around 0 98.3%
Taylor expanded in t around 0 78.5%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e+58) (not (<= z 0.019))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+58) || !(z <= 0.019)) {
tmp = x - a;
} else {
tmp = x - (y * 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 ((z <= (-1d+58)) .or. (.not. (z <= 0.019d0))) then
tmp = x - a
else
tmp = x - (y * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+58) || !(z <= 0.019)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e+58) or not (z <= 0.019): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e+58) || !(z <= 0.019)) tmp = Float64(x - a); else tmp = Float64(x - Float64(y * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e+58) || ~((z <= 0.019))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e+58], N[Not[LessEqual[z, 0.019]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+58} \lor \neg \left(z \leq 0.019\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -9.99999999999999944e57 or 0.0189999999999999995 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -9.99999999999999944e57 < z < 0.0189999999999999995Initial program 99.1%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 91.4%
Taylor expanded in t around 0 75.3%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e-38) (not (<= z 2.2e+45))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-38) || !(z <= 2.2e+45)) {
tmp = x - a;
} 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 ((z <= (-1.15d-38)) .or. (.not. (z <= 2.2d+45))) then
tmp = x - a
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 ((z <= -1.15e-38) || !(z <= 2.2e+45)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e-38) or not (z <= 2.2e+45): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e-38) || !(z <= 2.2e+45)) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e-38) || ~((z <= 2.2e+45))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e-38], N[Not[LessEqual[z, 2.2e+45]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-38} \lor \neg \left(z \leq 2.2 \cdot 10^{+45}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.15000000000000001e-38 or 2.2e45 < z Initial program 93.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.1%
if -1.15000000000000001e-38 < z < 2.2e45Initial program 99.1%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in y around inf 92.6%
*-commutative92.6%
associate--l+92.6%
+-commutative92.6%
associate-*r/94.6%
+-commutative94.6%
associate--l+94.6%
associate--l+94.6%
Simplified94.6%
Taylor expanded in x around inf 53.6%
Final simplification64.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -9e-160) x (if (<= x 4.3e-117) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -9e-160) {
tmp = x;
} else if (x <= 4.3e-117) {
tmp = -a;
} 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 (x <= (-9d-160)) then
tmp = x
else if (x <= 4.3d-117) then
tmp = -a
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 (x <= -9e-160) {
tmp = x;
} else if (x <= 4.3e-117) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -9e-160: tmp = x elif x <= 4.3e-117: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -9e-160) tmp = x; elseif (x <= 4.3e-117) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -9e-160) tmp = x; elseif (x <= 4.3e-117) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -9e-160], x, If[LessEqual[x, 4.3e-117], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-160}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-117}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.00000000000000053e-160 or 4.3e-117 < x Initial program 99.5%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around inf 87.6%
*-commutative87.6%
associate--l+87.6%
+-commutative87.6%
associate-*r/90.2%
+-commutative90.2%
associate--l+90.2%
associate--l+90.2%
Simplified90.2%
Taylor expanded in x around inf 67.3%
if -9.00000000000000053e-160 < x < 4.3e-117Initial program 87.7%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around 0 59.6%
Taylor expanded in x around 0 49.8%
associate-*r/64.5%
neg-mul-164.5%
distribute-rgt-neg-out64.5%
distribute-neg-frac264.5%
Simplified64.5%
Taylor expanded in z around inf 31.0%
mul-1-neg31.0%
Simplified31.0%
Final simplification57.4%
(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 96.3%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around inf 79.0%
*-commutative79.0%
associate--l+79.0%
+-commutative79.0%
associate-*r/81.7%
+-commutative81.7%
associate--l+81.7%
associate--l+81.7%
Simplified81.7%
Taylor expanded in x around inf 52.8%
Final simplification52.8%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
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 - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024076
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))