
(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 10 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 (/ (- z y) (+ (- t z) 1.0)))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.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 = x + (a * ((z - y) / ((t - z) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
def code(x, y, z, t, a): return x + (a * ((z - y) / ((t - z) + 1.0)))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((z - y) / ((t - z) + 1.0))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{z - y}{\left(t - z\right) + 1}
\end{array}
Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y a))) (t_2 (- x (* a (/ y t)))))
(if (<= z -7.6e+84)
(- x a)
(if (<= z -6.3e-65)
t_2
(if (<= z 1.52e-260)
t_1
(if (<= z 2.45e-186) t_2 (if (<= z 0.88) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * a);
double t_2 = x - (a * (y / t));
double tmp;
if (z <= -7.6e+84) {
tmp = x - a;
} else if (z <= -6.3e-65) {
tmp = t_2;
} else if (z <= 1.52e-260) {
tmp = t_1;
} else if (z <= 2.45e-186) {
tmp = t_2;
} else if (z <= 0.88) {
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) :: t_2
real(8) :: tmp
t_1 = x - (y * a)
t_2 = x - (a * (y / t))
if (z <= (-7.6d+84)) then
tmp = x - a
else if (z <= (-6.3d-65)) then
tmp = t_2
else if (z <= 1.52d-260) then
tmp = t_1
else if (z <= 2.45d-186) then
tmp = t_2
else if (z <= 0.88d0) 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 - (y * a);
double t_2 = x - (a * (y / t));
double tmp;
if (z <= -7.6e+84) {
tmp = x - a;
} else if (z <= -6.3e-65) {
tmp = t_2;
} else if (z <= 1.52e-260) {
tmp = t_1;
} else if (z <= 2.45e-186) {
tmp = t_2;
} else if (z <= 0.88) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * a) t_2 = x - (a * (y / t)) tmp = 0 if z <= -7.6e+84: tmp = x - a elif z <= -6.3e-65: tmp = t_2 elif z <= 1.52e-260: tmp = t_1 elif z <= 2.45e-186: tmp = t_2 elif z <= 0.88: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * a)) t_2 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (z <= -7.6e+84) tmp = Float64(x - a); elseif (z <= -6.3e-65) tmp = t_2; elseif (z <= 1.52e-260) tmp = t_1; elseif (z <= 2.45e-186) tmp = t_2; elseif (z <= 0.88) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * a); t_2 = x - (a * (y / t)); tmp = 0.0; if (z <= -7.6e+84) tmp = x - a; elseif (z <= -6.3e-65) tmp = t_2; elseif (z <= 1.52e-260) tmp = t_1; elseif (z <= 2.45e-186) tmp = t_2; elseif (z <= 0.88) 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[(y * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e+84], N[(x - a), $MachinePrecision], If[LessEqual[z, -6.3e-65], t$95$2, If[LessEqual[z, 1.52e-260], t$95$1, If[LessEqual[z, 2.45e-186], t$95$2, If[LessEqual[z, 0.88], t$95$1, N[(x - a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot a\\
t_2 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+84}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-186}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 0.88:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.6000000000000002e84 or 0.880000000000000004 < z Initial program 96.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 79.2%
if -7.6000000000000002e84 < z < -6.2999999999999997e-65 or 1.52e-260 < z < 2.4499999999999998e-186Initial program 99.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 73.7%
Taylor expanded in y around inf 76.3%
if -6.2999999999999997e-65 < z < 1.52e-260 or 2.4499999999999998e-186 < z < 0.880000000000000004Initial program 98.9%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in t around 0 78.8%
Taylor expanded in z around 0 73.9%
Final simplification76.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y a))))
(if (<= z -2.5e+84)
(- x a)
(if (<= z -6.2e-66)
(- x (/ a (/ t y)))
(if (<= z 1.7e-262)
t_1
(if (<= z 4.2e-186)
(- x (* a (/ y t)))
(if (<= z 1000.0) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * a);
double tmp;
if (z <= -2.5e+84) {
tmp = x - a;
} else if (z <= -6.2e-66) {
tmp = x - (a / (t / y));
} else if (z <= 1.7e-262) {
tmp = t_1;
} else if (z <= 4.2e-186) {
tmp = x - (a * (y / t));
} else if (z <= 1000.0) {
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 - (y * a)
if (z <= (-2.5d+84)) then
tmp = x - a
else if (z <= (-6.2d-66)) then
tmp = x - (a / (t / y))
else if (z <= 1.7d-262) then
tmp = t_1
else if (z <= 4.2d-186) then
tmp = x - (a * (y / t))
else if (z <= 1000.0d0) 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 - (y * a);
double tmp;
if (z <= -2.5e+84) {
tmp = x - a;
} else if (z <= -6.2e-66) {
tmp = x - (a / (t / y));
} else if (z <= 1.7e-262) {
tmp = t_1;
} else if (z <= 4.2e-186) {
tmp = x - (a * (y / t));
} else if (z <= 1000.0) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * a) tmp = 0 if z <= -2.5e+84: tmp = x - a elif z <= -6.2e-66: tmp = x - (a / (t / y)) elif z <= 1.7e-262: tmp = t_1 elif z <= 4.2e-186: tmp = x - (a * (y / t)) elif z <= 1000.0: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * a)) tmp = 0.0 if (z <= -2.5e+84) tmp = Float64(x - a); elseif (z <= -6.2e-66) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 1.7e-262) tmp = t_1; elseif (z <= 4.2e-186) tmp = Float64(x - Float64(a * Float64(y / t))); elseif (z <= 1000.0) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * a); tmp = 0.0; if (z <= -2.5e+84) tmp = x - a; elseif (z <= -6.2e-66) tmp = x - (a / (t / y)); elseif (z <= 1.7e-262) tmp = t_1; elseif (z <= 4.2e-186) tmp = x - (a * (y / t)); elseif (z <= 1000.0) 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[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+84], N[(x - a), $MachinePrecision], If[LessEqual[z, -6.2e-66], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-262], t$95$1, If[LessEqual[z, 4.2e-186], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1000.0], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot a\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+84}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-66}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-262}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-186}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.5e84 or 1e3 < z Initial program 96.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 79.2%
if -2.5e84 < z < -6.1999999999999995e-66Initial program 100.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 72.2%
clear-num72.2%
inv-pow72.2%
Applied egg-rr72.2%
unpow-172.2%
Simplified72.2%
Taylor expanded in y around inf 70.3%
associate-/l*76.2%
Simplified76.2%
if -6.1999999999999995e-66 < z < 1.69999999999999995e-262 or 4.2000000000000004e-186 < z < 1e3Initial program 98.9%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in t around 0 78.8%
Taylor expanded in z around 0 73.9%
if 1.69999999999999995e-262 < z < 4.2000000000000004e-186Initial program 99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 76.7%
Taylor expanded in y around inf 76.9%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4200.0) (not (<= t 1e+103))) (+ x (* a (/ (- z y) t))) (+ x (* a (/ (- z y) (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4200.0) || !(t <= 1e+103)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
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 <= (-4200.0d0)) .or. (.not. (t <= 1d+103))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x + (a * ((z - y) / (1.0d0 - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4200.0) || !(t <= 1e+103)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4200.0) or not (t <= 1e+103): tmp = x + (a * ((z - y) / t)) else: tmp = x + (a * ((z - y) / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4200.0) || !(t <= 1e+103)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4200.0) || ~((t <= 1e+103))) tmp = x + (a * ((z - y) / t)); else tmp = x + (a * ((z - y) / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4200.0], N[Not[LessEqual[t, 1e+103]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4200 \lor \neg \left(t \leq 10^{+103}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\end{array}
\end{array}
if t < -4200 or 1e103 < t Initial program 96.4%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in t around inf 87.8%
if -4200 < t < 1e103Initial program 99.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 98.1%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e+84) (not (<= z 7500000000.0))) (+ x (/ (- z y) (/ (- z) a))) (- x (* y (/ a (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+84) || !(z <= 7500000000.0)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (y * (a / (t + 1.0)));
}
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 <= (-2.3d+84)) .or. (.not. (z <= 7500000000.0d0))) then
tmp = x + ((z - y) / (-z / a))
else
tmp = x - (y * (a / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+84) || !(z <= 7500000000.0)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (y * (a / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e+84) or not (z <= 7500000000.0): tmp = x + ((z - y) / (-z / a)) else: tmp = x - (y * (a / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e+84) || !(z <= 7500000000.0)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); else tmp = Float64(x - Float64(y * Float64(a / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.3e+84) || ~((z <= 7500000000.0))) tmp = x + ((z - y) / (-z / a)); else tmp = x - (y * (a / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e+84], N[Not[LessEqual[z, 7500000000.0]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+84} \lor \neg \left(z \leq 7500000000\right):\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{t + 1}\\
\end{array}
\end{array}
if z < -2.2999999999999999e84 or 7.5e9 < z Initial program 96.6%
Taylor expanded in z around inf 86.6%
associate-*r/86.6%
neg-mul-186.6%
Simplified86.6%
if -2.2999999999999999e84 < z < 7.5e9Initial program 99.3%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 86.3%
associate-/l*89.6%
associate-/r/89.7%
Simplified89.7%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+86) (not (<= z 60000000000.0))) (- x a) (- x (* y (/ a (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+86) || !(z <= 60000000000.0)) {
tmp = x - a;
} else {
tmp = x - (y * (a / (t + 1.0)));
}
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 <= (-2d+86)) .or. (.not. (z <= 60000000000.0d0))) then
tmp = x - a
else
tmp = x - (y * (a / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+86) || !(z <= 60000000000.0)) {
tmp = x - a;
} else {
tmp = x - (y * (a / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+86) or not (z <= 60000000000.0): tmp = x - a else: tmp = x - (y * (a / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e+86) || !(z <= 60000000000.0)) tmp = Float64(x - a); else tmp = Float64(x - Float64(y * Float64(a / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2e+86) || ~((z <= 60000000000.0))) tmp = x - a; else tmp = x - (y * (a / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e+86], N[Not[LessEqual[z, 60000000000.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+86} \lor \neg \left(z \leq 60000000000\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{a}{t + 1}\\
\end{array}
\end{array}
if z < -2e86 or 6e10 < z Initial program 96.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 79.2%
if -2e86 < z < 6e10Initial program 99.3%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 86.3%
associate-/l*89.6%
associate-/r/89.7%
Simplified89.7%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e+86) (- x a) (if (<= z 3.4) (- x (* y (/ a (+ t 1.0)))) (+ x (/ a (/ (- 1.0 z) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+86) {
tmp = x - a;
} else if (z <= 3.4) {
tmp = x - (y * (a / (t + 1.0)));
} else {
tmp = x + (a / ((1.0 - z) / z));
}
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 <= (-7d+86)) then
tmp = x - a
else if (z <= 3.4d0) then
tmp = x - (y * (a / (t + 1.0d0)))
else
tmp = x + (a / ((1.0d0 - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+86) {
tmp = x - a;
} else if (z <= 3.4) {
tmp = x - (y * (a / (t + 1.0)));
} else {
tmp = x + (a / ((1.0 - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e+86: tmp = x - a elif z <= 3.4: tmp = x - (y * (a / (t + 1.0))) else: tmp = x + (a / ((1.0 - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+86) tmp = Float64(x - a); elseif (z <= 3.4) tmp = Float64(x - Float64(y * Float64(a / Float64(t + 1.0)))); else tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7e+86) tmp = x - a; elseif (z <= 3.4) tmp = x - (y * (a / (t + 1.0))); else tmp = x + (a / ((1.0 - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+86], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.4], N[(x - N[(y * N[(a / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+86}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3.4:\\
\;\;\;\;x - y \cdot \frac{a}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\end{array}
\end{array}
if z < -7.00000000000000038e86Initial program 93.7%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 78.3%
if -7.00000000000000038e86 < z < 3.39999999999999991Initial program 99.3%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 86.3%
associate-/l*89.6%
associate-/r/89.7%
Simplified89.7%
if 3.39999999999999991 < z Initial program 98.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 91.1%
Taylor expanded in y around 0 61.7%
mul-1-neg61.7%
associate-/l*79.9%
distribute-neg-frac79.9%
Simplified79.9%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.00096) (not (<= z 1500.0))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.00096) || !(z <= 1500.0)) {
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 <= (-0.00096d0)) .or. (.not. (z <= 1500.0d0))) 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 <= -0.00096) || !(z <= 1500.0)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.00096) or not (z <= 1500.0): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.00096) || !(z <= 1500.0)) 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 <= -0.00096) || ~((z <= 1500.0))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.00096], N[Not[LessEqual[z, 1500.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00096 \lor \neg \left(z \leq 1500\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -9.60000000000000024e-4 or 1500 < z Initial program 97.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 76.1%
if -9.60000000000000024e-4 < z < 1500Initial program 99.2%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around 0 74.3%
Taylor expanded in z around 0 69.7%
Final simplification73.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.00083) (not (<= z 2.65e-20))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.00083) || !(z <= 2.65e-20)) {
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 <= (-0.00083d0)) .or. (.not. (z <= 2.65d-20))) 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 <= -0.00083) || !(z <= 2.65e-20)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.00083) or not (z <= 2.65e-20): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.00083) || !(z <= 2.65e-20)) 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 <= -0.00083) || ~((z <= 2.65e-20))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.00083], N[Not[LessEqual[z, 2.65e-20]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00083 \lor \neg \left(z \leq 2.65 \cdot 10^{-20}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.3000000000000001e-4 or 2.6500000000000001e-20 < z Initial program 97.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 75.8%
if -8.3000000000000001e-4 < z < 2.6500000000000001e-20Initial program 99.1%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in t around inf 67.8%
Taylor expanded in x around inf 55.7%
Final simplification66.5%
(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 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in t around inf 51.9%
Taylor expanded in x around inf 54.4%
Final simplification54.4%
(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 2023320
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))