
(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 12 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 95.3%
associate-/r/99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (/ y (- -1.0 t)))))
(if (<= y -9e+154)
t_1
(if (<= y -1.05e-212)
(- x a)
(if (<= y 1.4e-256) x (if (<= y 2.75e+225) (- x a) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * (y / (-1.0 - t));
double tmp;
if (y <= -9e+154) {
tmp = t_1;
} else if (y <= -1.05e-212) {
tmp = x - a;
} else if (y <= 1.4e-256) {
tmp = x;
} else if (y <= 2.75e+225) {
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 = a * (y / ((-1.0d0) - t))
if (y <= (-9d+154)) then
tmp = t_1
else if (y <= (-1.05d-212)) then
tmp = x - a
else if (y <= 1.4d-256) then
tmp = x
else if (y <= 2.75d+225) 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 = a * (y / (-1.0 - t));
double tmp;
if (y <= -9e+154) {
tmp = t_1;
} else if (y <= -1.05e-212) {
tmp = x - a;
} else if (y <= 1.4e-256) {
tmp = x;
} else if (y <= 2.75e+225) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * (y / (-1.0 - t)) tmp = 0 if y <= -9e+154: tmp = t_1 elif y <= -1.05e-212: tmp = x - a elif y <= 1.4e-256: tmp = x elif y <= 2.75e+225: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * Float64(y / Float64(-1.0 - t))) tmp = 0.0 if (y <= -9e+154) tmp = t_1; elseif (y <= -1.05e-212) tmp = Float64(x - a); elseif (y <= 1.4e-256) tmp = x; elseif (y <= 2.75e+225) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * (y / (-1.0 - t)); tmp = 0.0; if (y <= -9e+154) tmp = t_1; elseif (y <= -1.05e-212) tmp = x - a; elseif (y <= 1.4e-256) tmp = x; elseif (y <= 2.75e+225) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+154], t$95$1, If[LessEqual[y, -1.05e-212], N[(x - a), $MachinePrecision], If[LessEqual[y, 1.4e-256], x, If[LessEqual[y, 2.75e+225], N[(x - a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y}{-1 - t}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-212}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-256}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+225}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -9.00000000000000018e154 or 2.74999999999999993e225 < y Initial program 86.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in a around inf 81.3%
associate--l+81.3%
+-commutative81.3%
associate--l+81.3%
+-commutative81.3%
div-sub81.3%
+-commutative81.3%
Simplified81.3%
Taylor expanded in z around 0 56.3%
mul-1-neg56.3%
distribute-neg-frac56.3%
Simplified56.3%
frac-2neg56.3%
div-inv56.1%
remove-double-neg56.1%
+-commutative56.1%
distribute-neg-in56.1%
metadata-eval56.1%
Applied egg-rr56.1%
associate-*r/56.3%
*-rgt-identity56.3%
+-commutative56.3%
unsub-neg56.3%
Simplified56.3%
if -9.00000000000000018e154 < y < -1.05e-212 or 1.40000000000000012e-256 < y < 2.74999999999999993e225Initial program 97.1%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around inf 71.5%
if -1.05e-212 < y < 1.40000000000000012e-256Initial program 99.8%
associate-/r/97.1%
Simplified97.1%
Taylor expanded in x around inf 67.9%
Final simplification67.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= z -1.9e+21)
(- x a)
(if (<= z 3.5e-19)
t_1
(if (<= z 1.46e+65)
(+ x (* a (/ y z)))
(if (<= z 2.15e+117) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (z <= -1.9e+21) {
tmp = x - a;
} else if (z <= 3.5e-19) {
tmp = t_1;
} else if (z <= 1.46e+65) {
tmp = x + (a * (y / z));
} else if (z <= 2.15e+117) {
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 / (t / y))
if (z <= (-1.9d+21)) then
tmp = x - a
else if (z <= 3.5d-19) then
tmp = t_1
else if (z <= 1.46d+65) then
tmp = x + (a * (y / z))
else if (z <= 2.15d+117) 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 / (t / y));
double tmp;
if (z <= -1.9e+21) {
tmp = x - a;
} else if (z <= 3.5e-19) {
tmp = t_1;
} else if (z <= 1.46e+65) {
tmp = x + (a * (y / z));
} else if (z <= 2.15e+117) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if z <= -1.9e+21: tmp = x - a elif z <= 3.5e-19: tmp = t_1 elif z <= 1.46e+65: tmp = x + (a * (y / z)) elif z <= 2.15e+117: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (z <= -1.9e+21) tmp = Float64(x - a); elseif (z <= 3.5e-19) tmp = t_1; elseif (z <= 1.46e+65) tmp = Float64(x + Float64(a * Float64(y / z))); elseif (z <= 2.15e+117) 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 / (t / y)); tmp = 0.0; if (z <= -1.9e+21) tmp = x - a; elseif (z <= 3.5e-19) tmp = t_1; elseif (z <= 1.46e+65) tmp = x + (a * (y / z)); elseif (z <= 2.15e+117) 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[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+21], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.5e-19], t$95$1, If[LessEqual[z, 1.46e+65], N[(x + N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e+117], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+21}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{+65}:\\
\;\;\;\;x + a \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.9e21 or 2.14999999999999999e117 < z Initial program 93.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
if -1.9e21 < z < 3.50000000000000015e-19 or 1.45999999999999999e65 < z < 2.14999999999999999e117Initial program 96.9%
associate-/r/98.5%
Simplified98.5%
Taylor expanded in t around inf 68.9%
associate-/l*70.9%
Simplified70.9%
Taylor expanded in y around inf 66.6%
associate-/l*68.4%
Simplified68.4%
if 3.50000000000000015e-19 < z < 1.45999999999999999e65Initial program 94.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 79.1%
mul-1-neg79.1%
Simplified79.1%
Taylor expanded in y around inf 77.0%
mul-1-neg77.0%
distribute-neg-frac77.0%
Simplified77.0%
Final simplification73.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.4e+74)
(+ x (/ (- z y) (/ t a)))
(if (<= t 2.1e+78)
(+ x (* a (/ (- z y) (- 1.0 z))))
(+ x (* a (/ (- z y) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.4e+74) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 2.1e+78) {
tmp = x + (a * ((z - y) / (1.0 - z)));
} else {
tmp = x + (a * ((z - y) / 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 (t <= (-8.4d+74)) then
tmp = x + ((z - y) / (t / a))
else if (t <= 2.1d+78) then
tmp = x + (a * ((z - y) / (1.0d0 - z)))
else
tmp = x + (a * ((z - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.4e+74) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 2.1e+78) {
tmp = x + (a * ((z - y) / (1.0 - z)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.4e+74: tmp = x + ((z - y) / (t / a)) elif t <= 2.1e+78: tmp = x + (a * ((z - y) / (1.0 - z))) else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.4e+74) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); elseif (t <= 2.1e+78) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.4e+74) tmp = x + ((z - y) / (t / a)); elseif (t <= 2.1e+78) tmp = x + (a * ((z - y) / (1.0 - z))); else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.4e+74], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e+78], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+78}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if t < -8.3999999999999995e74Initial program 97.9%
Taylor expanded in t around inf 89.8%
if -8.3999999999999995e74 < t < 2.1000000000000001e78Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 95.9%
if 2.1000000000000001e78 < t Initial program 87.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 84.9%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.9e+30) (not (<= z 2e+122))) (+ x (* a (/ (- z y) (- z)))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.9e+30) || !(z <= 2e+122)) {
tmp = x + (a * ((z - y) / -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 <= (-4.9d+30)) .or. (.not. (z <= 2d+122))) then
tmp = x + (a * ((z - y) / -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 <= -4.9e+30) || !(z <= 2e+122)) {
tmp = x + (a * ((z - y) / -z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.9e+30) or not (z <= 2e+122): tmp = x + (a * ((z - y) / -z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.9e+30) || !(z <= 2e+122)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(-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 <= -4.9e+30) || ~((z <= 2e+122))) tmp = x + (a * ((z - y) / -z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.9e+30], N[Not[LessEqual[z, 2e+122]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $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 -4.9 \cdot 10^{+30} \lor \neg \left(z \leq 2 \cdot 10^{+122}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{-z}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -4.89999999999999984e30 or 2.00000000000000003e122 < z Initial program 93.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.7%
mul-1-neg87.7%
Simplified87.7%
if -4.89999999999999984e30 < z < 2.00000000000000003e122Initial program 96.8%
associate-/r/98.7%
Simplified98.7%
Taylor expanded in z around 0 85.7%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.15e+67) (not (<= t 8.5e+113))) (- x (/ a (/ t y))) (+ x (* a (/ z (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+67) || !(t <= 8.5e+113)) {
tmp = x - (a / (t / y));
} else {
tmp = x + (a * (z / (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 <= (-2.15d+67)) .or. (.not. (t <= 8.5d+113))) then
tmp = x - (a / (t / y))
else
tmp = x + (a * (z / (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 <= -2.15e+67) || !(t <= 8.5e+113)) {
tmp = x - (a / (t / y));
} else {
tmp = x + (a * (z / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.15e+67) or not (t <= 8.5e+113): tmp = x - (a / (t / y)) else: tmp = x + (a * (z / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.15e+67) || !(t <= 8.5e+113)) tmp = Float64(x - Float64(a / Float64(t / y))); else tmp = Float64(x + Float64(a * Float64(z / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.15e+67) || ~((t <= 8.5e+113))) tmp = x - (a / (t / y)); else tmp = x + (a * (z / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.15e+67], N[Not[LessEqual[t, 8.5e+113]], $MachinePrecision]], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+67} \lor \neg \left(t \leq 8.5 \cdot 10^{+113}\right):\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{1 - z}\\
\end{array}
\end{array}
if t < -2.1500000000000001e67 or 8.5000000000000001e113 < t Initial program 92.6%
associate-/r/97.7%
Simplified97.7%
Taylor expanded in t around inf 82.1%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in y around inf 74.7%
associate-/l*78.5%
Simplified78.5%
if -2.1500000000000001e67 < t < 8.5000000000000001e113Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
associate-/r/96.9%
div-inv96.8%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 75.0%
Taylor expanded in y around 0 58.4%
cancel-sign-sub-inv58.4%
metadata-eval58.4%
associate-*r/74.8%
*-lft-identity74.8%
Simplified74.8%
Final simplification76.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+54) (not (<= z 1.85e+122))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+54) || !(z <= 1.85e+122)) {
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 <= (-2.8d+54)) .or. (.not. (z <= 1.85d+122))) 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 <= -2.8e+54) || !(z <= 1.85e+122)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+54) or not (z <= 1.85e+122): 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 <= -2.8e+54) || !(z <= 1.85e+122)) 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 <= -2.8e+54) || ~((z <= 1.85e+122))) 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, -2.8e+54], N[Not[LessEqual[z, 1.85e+122]], $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 -2.8 \cdot 10^{+54} \lor \neg \left(z \leq 1.85 \cdot 10^{+122}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -2.80000000000000015e54 or 1.8499999999999998e122 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 79.3%
if -2.80000000000000015e54 < z < 1.8499999999999998e122Initial program 96.9%
associate-/r/98.7%
Simplified98.7%
Taylor expanded in z around 0 85.0%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+141) (not (<= t 1.1e+175))) (+ x (/ a (/ t z))) (- x a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+141) || !(t <= 1.1e+175)) {
tmp = x + (a / (t / z));
} 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 ((t <= (-4.8d+141)) .or. (.not. (t <= 1.1d+175))) then
tmp = x + (a / (t / z))
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 ((t <= -4.8e+141) || !(t <= 1.1e+175)) {
tmp = x + (a / (t / z));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+141) or not (t <= 1.1e+175): tmp = x + (a / (t / z)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+141) || !(t <= 1.1e+175)) tmp = Float64(x + Float64(a / Float64(t / z))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+141) || ~((t <= 1.1e+175))) tmp = x + (a / (t / z)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+141], N[Not[LessEqual[t, 1.1e+175]], $MachinePrecision]], N[(x + N[(a / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+141} \lor \neg \left(t \leq 1.1 \cdot 10^{+175}\right):\\
\;\;\;\;x + \frac{a}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if t < -4.79999999999999995e141 or 1.1e175 < t Initial program 93.0%
associate-/r/97.1%
Simplified97.1%
Taylor expanded in t around inf 88.5%
associate-/l*91.5%
Simplified91.5%
Taylor expanded in y around 0 76.0%
sub-neg76.0%
mul-1-neg76.0%
remove-double-neg76.0%
associate-/l*76.1%
Simplified76.1%
if -4.79999999999999995e141 < t < 1.1e175Initial program 96.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 64.2%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.32e+19) (not (<= z 2.15e+117))) (- x a) (- x (/ a (/ t y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.32e+19) || !(z <= 2.15e+117)) {
tmp = x - a;
} else {
tmp = x - (a / (t / 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 <= (-1.32d+19)) .or. (.not. (z <= 2.15d+117))) then
tmp = x - a
else
tmp = x - (a / (t / 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 <= -1.32e+19) || !(z <= 2.15e+117)) {
tmp = x - a;
} else {
tmp = x - (a / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.32e+19) or not (z <= 2.15e+117): tmp = x - a else: tmp = x - (a / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.32e+19) || !(z <= 2.15e+117)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.32e+19) || ~((z <= 2.15e+117))) tmp = x - a; else tmp = x - (a / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.32e+19], N[Not[LessEqual[z, 2.15e+117]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+19} \lor \neg \left(z \leq 2.15 \cdot 10^{+117}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -1.32e19 or 2.14999999999999999e117 < z Initial program 93.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
if -1.32e19 < z < 2.14999999999999999e117Initial program 96.7%
associate-/r/98.6%
Simplified98.6%
Taylor expanded in t around inf 67.1%
associate-/l*68.9%
Simplified68.9%
Taylor expanded in y around inf 65.1%
associate-/l*66.7%
Simplified66.7%
Final simplification71.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.6e+177) x (if (<= t 1.12e+183) (- x a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e+177) {
tmp = x;
} else if (t <= 1.12e+183) {
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 (t <= (-1.6d+177)) then
tmp = x
else if (t <= 1.12d+183) 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 (t <= -1.6e+177) {
tmp = x;
} else if (t <= 1.12e+183) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.6e+177: tmp = x elif t <= 1.12e+183: tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e+177) tmp = x; elseif (t <= 1.12e+183) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.6e+177) tmp = x; elseif (t <= 1.12e+183) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e+177], x, If[LessEqual[t, 1.12e+183], N[(x - a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+177}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+183}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.6e177 or 1.12000000000000003e183 < t Initial program 93.1%
associate-/r/96.4%
Simplified96.4%
Taylor expanded in x around inf 66.8%
if -1.6e177 < t < 1.12000000000000003e183Initial program 96.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 62.8%
Final simplification63.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.9e+220) (not (<= a 1.8e+139))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.9e+220) || !(a <= 1.8e+139)) {
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.9d+220)) .or. (.not. (a <= 1.8d+139))) 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.9e+220) || !(a <= 1.8e+139)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.9e+220) or not (a <= 1.8e+139): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.9e+220) || !(a <= 1.8e+139)) 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.9e+220) || ~((a <= 1.8e+139))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.9e+220], N[Not[LessEqual[a, 1.8e+139]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+220} \lor \neg \left(a \leq 1.8 \cdot 10^{+139}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.89999999999999991e220 or 1.79999999999999993e139 < a Initial program 99.6%
associate-/r/96.6%
Simplified96.6%
Taylor expanded in a around inf 86.0%
associate--l+86.0%
+-commutative86.0%
associate--l+86.0%
+-commutative86.0%
div-sub85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in z around inf 47.2%
neg-mul-147.2%
Simplified47.2%
if -2.89999999999999991e220 < a < 1.79999999999999993e139Initial program 94.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 62.1%
Final simplification58.6%
(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 95.3%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in x around inf 50.3%
Final simplification50.3%
(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 2024010
(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))))