
(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 14 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 (fma (/ (- z y) (+ (- t z) 1.0)) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - y) / ((t - z) + 1.0)), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right)
\end{array}
Initial program 97.2%
sub-neg97.2%
+-commutative97.2%
associate-/r/99.6%
distribute-lft-neg-in99.6%
fma-def99.6%
distribute-neg-frac99.6%
sub-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
+-commutative99.6%
sub-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ a (/ (- 1.0 z) z)))) (t_2 (- x (/ a (/ t y)))))
(if (<= t -1.9e+38)
t_2
(if (<= t -1.55e-106)
t_1
(if (<= t 2.8e-235) (- x (* y a)) (if (<= t 1.9e+97) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a / ((1.0 - z) / z));
double t_2 = x - (a / (t / y));
double tmp;
if (t <= -1.9e+38) {
tmp = t_2;
} else if (t <= -1.55e-106) {
tmp = t_1;
} else if (t <= 2.8e-235) {
tmp = x - (y * a);
} else if (t <= 1.9e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
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 + (a / ((1.0d0 - z) / z))
t_2 = x - (a / (t / y))
if (t <= (-1.9d+38)) then
tmp = t_2
else if (t <= (-1.55d-106)) then
tmp = t_1
else if (t <= 2.8d-235) then
tmp = x - (y * a)
else if (t <= 1.9d+97) then
tmp = t_1
else
tmp = t_2
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 / ((1.0 - z) / z));
double t_2 = x - (a / (t / y));
double tmp;
if (t <= -1.9e+38) {
tmp = t_2;
} else if (t <= -1.55e-106) {
tmp = t_1;
} else if (t <= 2.8e-235) {
tmp = x - (y * a);
} else if (t <= 1.9e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a / ((1.0 - z) / z)) t_2 = x - (a / (t / y)) tmp = 0 if t <= -1.9e+38: tmp = t_2 elif t <= -1.55e-106: tmp = t_1 elif t <= 2.8e-235: tmp = x - (y * a) elif t <= 1.9e+97: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a / Float64(Float64(1.0 - z) / z))) t_2 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (t <= -1.9e+38) tmp = t_2; elseif (t <= -1.55e-106) tmp = t_1; elseif (t <= 2.8e-235) tmp = Float64(x - Float64(y * a)); elseif (t <= 1.9e+97) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a / ((1.0 - z) / z)); t_2 = x - (a / (t / y)); tmp = 0.0; if (t <= -1.9e+38) tmp = t_2; elseif (t <= -1.55e-106) tmp = t_1; elseif (t <= 2.8e-235) tmp = x - (y * a); elseif (t <= 1.9e+97) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e+38], t$95$2, If[LessEqual[t, -1.55e-106], t$95$1, If[LessEqual[t, 2.8e-235], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+97], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{\frac{1 - z}{z}}\\
t_2 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-235}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.8999999999999999e38 or 1.90000000000000018e97 < t Initial program 95.1%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in z around 0 78.6%
associate-/l*82.5%
Simplified82.5%
Taylor expanded in t around inf 78.6%
associate-/l*82.5%
Simplified82.5%
if -1.8999999999999999e38 < t < -1.54999999999999993e-106 or 2.79999999999999995e-235 < t < 1.90000000000000018e97Initial program 98.8%
Taylor expanded in t around 0 96.5%
Taylor expanded in y around 0 71.6%
sub-neg71.6%
mul-1-neg71.6%
remove-double-neg71.6%
associate-/l*88.1%
Simplified88.1%
if -1.54999999999999993e-106 < t < 2.79999999999999995e-235Initial program 98.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 73.5%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in t around 0 73.5%
Final simplification82.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= t -8.2e+37)
t_1
(if (<= t -4.4e-105)
(- x a)
(if (<= t 1.56e-202) (- x (* y a)) (if (<= t 5.5e+17) (- x a) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (t <= -8.2e+37) {
tmp = t_1;
} else if (t <= -4.4e-105) {
tmp = x - a;
} else if (t <= 1.56e-202) {
tmp = x - (y * a);
} else if (t <= 5.5e+17) {
tmp = x - a;
} 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) :: tmp
t_1 = x - (a / (t / y))
if (t <= (-8.2d+37)) then
tmp = t_1
else if (t <= (-4.4d-105)) then
tmp = x - a
else if (t <= 1.56d-202) then
tmp = x - (y * a)
else if (t <= 5.5d+17) then
tmp = x - a
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 - (a / (t / y));
double tmp;
if (t <= -8.2e+37) {
tmp = t_1;
} else if (t <= -4.4e-105) {
tmp = x - a;
} else if (t <= 1.56e-202) {
tmp = x - (y * a);
} else if (t <= 5.5e+17) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if t <= -8.2e+37: tmp = t_1 elif t <= -4.4e-105: tmp = x - a elif t <= 1.56e-202: tmp = x - (y * a) elif t <= 5.5e+17: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (t <= -8.2e+37) tmp = t_1; elseif (t <= -4.4e-105) tmp = Float64(x - a); elseif (t <= 1.56e-202) tmp = Float64(x - Float64(y * a)); elseif (t <= 5.5e+17) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a / (t / y)); tmp = 0.0; if (t <= -8.2e+37) tmp = t_1; elseif (t <= -4.4e-105) tmp = x - a; elseif (t <= 1.56e-202) tmp = x - (y * a); elseif (t <= 5.5e+17) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e+37], t$95$1, If[LessEqual[t, -4.4e-105], N[(x - a), $MachinePrecision], If[LessEqual[t, 1.56e-202], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+17], N[(x - a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-105}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{-202}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+17}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.1999999999999996e37 or 5.5e17 < t Initial program 95.6%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 80.2%
associate-/l*83.6%
Simplified83.6%
Taylor expanded in t around inf 80.2%
associate-/l*83.6%
Simplified83.6%
if -8.1999999999999996e37 < t < -4.40000000000000008e-105 or 1.56e-202 < t < 5.5e17Initial program 98.4%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 81.8%
if -4.40000000000000008e-105 < t < 1.56e-202Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 73.1%
associate-/l*73.0%
Simplified73.0%
Taylor expanded in t around 0 73.1%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e+44) (not (<= z 0.014))) (+ x (/ a (/ (- (+ t 1.0) z) z))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+44) || !(z <= 0.014)) {
tmp = x + (a / (((t + 1.0) - z) / z));
} else {
tmp = x - (a * (y / (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 <= (-7.2d+44)) .or. (.not. (z <= 0.014d0))) then
tmp = x + (a / (((t + 1.0d0) - z) / z))
else
tmp = x - (a * (y / (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 <= -7.2e+44) || !(z <= 0.014)) {
tmp = x + (a / (((t + 1.0) - z) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+44) or not (z <= 0.014): tmp = x + (a / (((t + 1.0) - z) / z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+44) || !(z <= 0.014)) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t + 1.0) - z) / z))); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e+44) || ~((z <= 0.014))) tmp = x + (a / (((t + 1.0) - z) / z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+44], N[Not[LessEqual[z, 0.014]], $MachinePrecision]], N[(x + N[(a / N[(N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+44} \lor \neg \left(z \leq 0.014\right):\\
\;\;\;\;x + \frac{a}{\frac{\left(t + 1\right) - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -7.2e44 or 0.0140000000000000003 < z Initial program 95.3%
associate-/r/99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 62.3%
sub-neg62.3%
mul-1-neg62.3%
remove-double-neg62.3%
associate-/l*89.7%
Simplified89.7%
if -7.2e44 < z < 0.0140000000000000003Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 91.7%
Final simplification90.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ t 1.0) z)))
(if (or (<= z -1.8e+45) (not (<= z 900000000000.0)))
(+ x (/ a (/ t_1 z)))
(- x (/ (* y a) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t + 1.0) - z;
double tmp;
if ((z <= -1.8e+45) || !(z <= 900000000000.0)) {
tmp = x + (a / (t_1 / z));
} else {
tmp = x - ((y * a) / 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) :: tmp
t_1 = (t + 1.0d0) - z
if ((z <= (-1.8d+45)) .or. (.not. (z <= 900000000000.0d0))) then
tmp = x + (a / (t_1 / z))
else
tmp = x - ((y * a) / 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 = (t + 1.0) - z;
double tmp;
if ((z <= -1.8e+45) || !(z <= 900000000000.0)) {
tmp = x + (a / (t_1 / z));
} else {
tmp = x - ((y * a) / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t + 1.0) - z tmp = 0 if (z <= -1.8e+45) or not (z <= 900000000000.0): tmp = x + (a / (t_1 / z)) else: tmp = x - ((y * a) / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t + 1.0) - z) tmp = 0.0 if ((z <= -1.8e+45) || !(z <= 900000000000.0)) tmp = Float64(x + Float64(a / Float64(t_1 / z))); else tmp = Float64(x - Float64(Float64(y * a) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t + 1.0) - z; tmp = 0.0; if ((z <= -1.8e+45) || ~((z <= 900000000000.0))) tmp = x + (a / (t_1 / z)); else tmp = x - ((y * a) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]}, If[Or[LessEqual[z, -1.8e+45], N[Not[LessEqual[z, 900000000000.0]], $MachinePrecision]], N[(x + N[(a / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + 1\right) - z\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+45} \lor \neg \left(z \leq 900000000000\right):\\
\;\;\;\;x + \frac{a}{\frac{t_1}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot a}{t_1}\\
\end{array}
\end{array}
if z < -1.8e45 or 9e11 < z Initial program 95.1%
associate-/r/100.0%
Simplified100.0%
clear-num99.9%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 61.6%
sub-neg61.6%
mul-1-neg61.6%
remove-double-neg61.6%
associate-/l*90.0%
Simplified90.0%
if -1.8e45 < z < 9e11Initial program 99.2%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in y around inf 92.0%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.9e+90) (not (<= t 1.5e+95))) (+ x (* a (/ (- z y) t))) (- x (/ (- y z) (/ (- 1.0 z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.9e+90) || !(t <= 1.5e+95)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x - ((y - z) / ((1.0 - z) / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-7.9d+90)) .or. (.not. (t <= 1.5d+95))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x - ((y - z) / ((1.0d0 - z) / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.9e+90) || !(t <= 1.5e+95)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x - ((y - z) / ((1.0 - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.9e+90) or not (t <= 1.5e+95): tmp = x + (a * ((z - y) / t)) else: tmp = x - ((y - z) / ((1.0 - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.9e+90) || !(t <= 1.5e+95)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x - Float64(Float64(y - z) / Float64(Float64(1.0 - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.9e+90) || ~((t <= 1.5e+95))) tmp = x + (a * ((z - y) / t)); else tmp = x - ((y - z) / ((1.0 - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.9e+90], N[Not[LessEqual[t, 1.5e+95]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(1.0 - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.9 \cdot 10^{+90} \lor \neg \left(t \leq 1.5 \cdot 10^{+95}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{1 - z}{a}}\\
\end{array}
\end{array}
if t < -7.8999999999999996e90 or 1.49999999999999996e95 < t Initial program 94.4%
associate-/r/98.8%
Simplified98.8%
Taylor expanded in t around inf 86.6%
if -7.8999999999999996e90 < t < 1.49999999999999996e95Initial program 98.7%
Taylor expanded in t around 0 95.7%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.5e+16)
(- x (- a (* y (/ a z))))
(if (<= z 1.1e+128)
(- x (* a (/ y (+ t 1.0))))
(+ x (/ (- z y) (/ (- z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+16) {
tmp = x - (a - (y * (a / z)));
} else if (z <= 1.1e+128) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x + ((z - y) / (-z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d+16)) then
tmp = x - (a - (y * (a / z)))
else if (z <= 1.1d+128) then
tmp = x - (a * (y / (t + 1.0d0)))
else
tmp = x + ((z - y) / (-z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+16) {
tmp = x - (a - (y * (a / z)));
} else if (z <= 1.1e+128) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x + ((z - y) / (-z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+16: tmp = x - (a - (y * (a / z))) elif z <= 1.1e+128: tmp = x - (a * (y / (t + 1.0))) else: tmp = x + ((z - y) / (-z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+16) tmp = Float64(x - Float64(a - Float64(y * Float64(a / z)))); elseif (z <= 1.1e+128) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+16) tmp = x - (a - (y * (a / z))); elseif (z <= 1.1e+128) tmp = x - (a * (y / (t + 1.0))); else tmp = x + ((z - y) / (-z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+16], N[(x - N[(a - N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+128], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+16}:\\
\;\;\;\;x - \left(a - y \cdot \frac{a}{z}\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+128}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\end{array}
\end{array}
if z < -3.5e16Initial program 93.9%
Taylor expanded in z around inf 82.5%
mul-1-neg82.5%
distribute-neg-frac82.5%
Simplified82.5%
Taylor expanded in y around 0 77.5%
mul-1-neg77.5%
unsub-neg77.5%
*-commutative77.5%
associate-*l/85.1%
associate-/r/84.2%
*-rgt-identity84.2%
associate-*r/84.3%
associate-/r/84.3%
associate-*l/84.3%
*-lft-identity84.3%
Simplified84.3%
if -3.5e16 < z < 1.10000000000000008e128Initial program 99.2%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 90.0%
if 1.10000000000000008e128 < z Initial program 95.4%
Taylor expanded in z around inf 91.2%
mul-1-neg91.2%
distribute-neg-frac91.2%
Simplified91.2%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e+45) (not (<= z 2.5e+158))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e+45) || !(z <= 2.5e+158)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (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 <= (-1.6d+45)) .or. (.not. (z <= 2.5d+158))) then
tmp = x - a
else
tmp = x - (a * (y / (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 <= -1.6e+45) || !(z <= 2.5e+158)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e+45) or not (z <= 2.5e+158): tmp = x - a else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e+45) || !(z <= 2.5e+158)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.6e+45) || ~((z <= 2.5e+158))) tmp = x - a; else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e+45], N[Not[LessEqual[z, 2.5e+158]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+45} \lor \neg \left(z \leq 2.5 \cdot 10^{+158}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.6000000000000001e45 or 2.4999999999999998e158 < z Initial program 94.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.7%
if -1.6000000000000001e45 < z < 2.4999999999999998e158Initial program 98.7%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 87.6%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1150000000000.0) (not (<= z 1.1e+128))) (+ x (- (* y (/ a z)) a)) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1150000000000.0) || !(z <= 1.1e+128)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x - (a * (y / (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 <= (-1150000000000.0d0)) .or. (.not. (z <= 1.1d+128))) then
tmp = x + ((y * (a / z)) - a)
else
tmp = x - (a * (y / (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 <= -1150000000000.0) || !(z <= 1.1e+128)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1150000000000.0) or not (z <= 1.1e+128): tmp = x + ((y * (a / z)) - a) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1150000000000.0) || !(z <= 1.1e+128)) tmp = Float64(x + Float64(Float64(y * Float64(a / z)) - a)); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1150000000000.0) || ~((z <= 1.1e+128))) tmp = x + ((y * (a / z)) - a); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1150000000000.0], N[Not[LessEqual[z, 1.1e+128]], $MachinePrecision]], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1150000000000 \lor \neg \left(z \leq 1.1 \cdot 10^{+128}\right):\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.15e12 or 1.10000000000000008e128 < z Initial program 94.5%
Taylor expanded in z around inf 85.9%
mul-1-neg85.9%
distribute-neg-frac85.9%
Simplified85.9%
Taylor expanded in y around 0 80.5%
mul-1-neg80.5%
unsub-neg80.5%
*-commutative80.5%
associate-*l/87.6%
associate-/r/86.2%
*-rgt-identity86.2%
associate-*r/86.2%
associate-/r/86.7%
associate-*l/86.7%
*-lft-identity86.7%
Simplified86.7%
if -1.15e12 < z < 1.10000000000000008e128Initial program 99.2%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 90.0%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e-37) (not (<= z 12500000000000.0))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e-37) || !(z <= 12500000000000.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 <= (-2.6d-37)) .or. (.not. (z <= 12500000000000.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 <= -2.6e-37) || !(z <= 12500000000000.0)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e-37) or not (z <= 12500000000000.0): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e-37) || !(z <= 12500000000000.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 <= -2.6e-37) || ~((z <= 12500000000000.0))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e-37], N[Not[LessEqual[z, 12500000000000.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-37} \lor \neg \left(z \leq 12500000000000\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -2.5999999999999998e-37 or 1.25e13 < z Initial program 95.4%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 80.6%
if -2.5999999999999998e-37 < z < 1.25e13Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 90.6%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in t around 0 72.7%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.05e+21) (not (<= z 9.5e+14))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e+21) || !(z <= 9.5e+14)) {
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.05d+21)) .or. (.not. (z <= 9.5d+14))) 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.05e+21) || !(z <= 9.5e+14)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.05e+21) or not (z <= 9.5e+14): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.05e+21) || !(z <= 9.5e+14)) 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.05e+21) || ~((z <= 9.5e+14))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.05e+21], N[Not[LessEqual[z, 9.5e+14]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+21} \lor \neg \left(z \leq 9.5 \cdot 10^{+14}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.05e21 or 9.5e14 < z Initial program 95.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 81.4%
if -1.05e21 < z < 9.5e14Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in x around inf 63.2%
Final simplification72.1%
(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 97.2%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e+257) (not (<= a 2.9e+239))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e+257) || !(a <= 2.9e+239)) {
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 ((a <= (-2.2d+257)) .or. (.not. (a <= 2.9d+239))) 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 ((a <= -2.2e+257) || !(a <= 2.9e+239)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e+257) or not (a <= 2.9e+239): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e+257) || !(a <= 2.9e+239)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.2e+257) || ~((a <= 2.9e+239))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e+257], N[Not[LessEqual[a, 2.9e+239]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+257} \lor \neg \left(a \leq 2.9 \cdot 10^{+239}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.1999999999999999e257 or 2.9000000000000002e239 < a Initial program 99.9%
Taylor expanded in z around inf 66.7%
mul-1-neg66.7%
distribute-neg-frac66.7%
Simplified66.7%
Taylor expanded in x around 0 11.4%
Taylor expanded in y around 0 58.8%
mul-1-neg58.8%
Simplified58.8%
if -2.1999999999999999e257 < a < 2.9000000000000002e239Initial program 97.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 64.6%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.2%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in x around inf 59.0%
Final simplification59.0%
(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 2024020
(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))))