
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (a * ((y - z) / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Initial program 97.3%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.02e+41)
(- x a)
(if (<= z -3.5e-132)
(- x (/ (* y a) t))
(if (<= z 400000000000.0)
(- x (* y a))
(if (<= z 8e+104) (+ x (* y (/ a z))) (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.02e+41) {
tmp = x - a;
} else if (z <= -3.5e-132) {
tmp = x - ((y * a) / t);
} else if (z <= 400000000000.0) {
tmp = x - (y * a);
} else if (z <= 8e+104) {
tmp = x + (y * (a / 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 (z <= (-1.02d+41)) then
tmp = x - a
else if (z <= (-3.5d-132)) then
tmp = x - ((y * a) / t)
else if (z <= 400000000000.0d0) then
tmp = x - (y * a)
else if (z <= 8d+104) then
tmp = x + (y * (a / 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 (z <= -1.02e+41) {
tmp = x - a;
} else if (z <= -3.5e-132) {
tmp = x - ((y * a) / t);
} else if (z <= 400000000000.0) {
tmp = x - (y * a);
} else if (z <= 8e+104) {
tmp = x + (y * (a / z));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.02e+41: tmp = x - a elif z <= -3.5e-132: tmp = x - ((y * a) / t) elif z <= 400000000000.0: tmp = x - (y * a) elif z <= 8e+104: tmp = x + (y * (a / z)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.02e+41) tmp = Float64(x - a); elseif (z <= -3.5e-132) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (z <= 400000000000.0) tmp = Float64(x - Float64(y * a)); elseif (z <= 8e+104) tmp = Float64(x + Float64(y * Float64(a / z))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.02e+41) tmp = x - a; elseif (z <= -3.5e-132) tmp = x - ((y * a) / t); elseif (z <= 400000000000.0) tmp = x - (y * a); elseif (z <= 8e+104) tmp = x + (y * (a / z)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.02e+41], N[(x - a), $MachinePrecision], If[LessEqual[z, -3.5e-132], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 400000000000.0], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+104], N[(x + N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+41}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-132}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;z \leq 400000000000:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+104}:\\
\;\;\;\;x + y \cdot \frac{a}{z}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.01999999999999992e41 or 8e104 < z Initial program 95.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 91.3%
if -1.01999999999999992e41 < z < -3.5e-132Initial program 95.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 90.1%
Taylor expanded in t around inf 75.3%
if -3.5e-132 < z < 4e11Initial program 99.9%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 97.3%
Taylor expanded in t around 0 86.3%
if 4e11 < z < 8e104Initial program 95.7%
Taylor expanded in z around inf 74.1%
mul-1-neg74.1%
distribute-neg-frac274.1%
Simplified74.1%
Taylor expanded in y around inf 68.4%
mul-1-neg68.4%
*-commutative68.4%
associate-*r/72.5%
*-commutative72.5%
distribute-rgt-neg-in72.5%
Simplified72.5%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e+55) (not (<= t 1.85e+82))) (+ x (* a (/ (- z y) t))) (+ x (/ (- y z) (/ (+ z -1.0) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e+55) || !(t <= 1.85e+82)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + ((y - z) / ((z + -1.0) / 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 <= (-1.5d+55)) .or. (.not. (t <= 1.85d+82))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x + ((y - z) / ((z + (-1.0d0)) / 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 <= -1.5e+55) || !(t <= 1.85e+82)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + ((y - z) / ((z + -1.0) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e+55) or not (t <= 1.85e+82): tmp = x + (a * ((z - y) / t)) else: tmp = x + ((y - z) / ((z + -1.0) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e+55) || !(t <= 1.85e+82)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(z + -1.0) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.5e+55) || ~((t <= 1.85e+82))) tmp = x + (a * ((z - y) / t)); else tmp = x + ((y - z) / ((z + -1.0) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.5e+55], N[Not[LessEqual[t, 1.85e+82]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(z + -1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+55} \lor \neg \left(t \leq 1.85 \cdot 10^{+82}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{z + -1}{a}}\\
\end{array}
\end{array}
if t < -1.50000000000000008e55 or 1.8500000000000001e82 < t Initial program 96.9%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in t around inf 88.8%
if -1.50000000000000008e55 < t < 1.8500000000000001e82Initial program 97.5%
Taylor expanded in t around 0 96.8%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.28e+56)
(- x a)
(if (<= z -1.75e-132)
(- x (/ (* y a) t))
(if (<= z 8e+29) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.28e+56) {
tmp = x - a;
} else if (z <= -1.75e-132) {
tmp = x - ((y * a) / t);
} else if (z <= 8e+29) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.28d+56)) then
tmp = x - a
else if (z <= (-1.75d-132)) then
tmp = x - ((y * a) / t)
else if (z <= 8d+29) then
tmp = x - (y * a)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.28e+56) {
tmp = x - a;
} else if (z <= -1.75e-132) {
tmp = x - ((y * a) / t);
} else if (z <= 8e+29) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.28e+56: tmp = x - a elif z <= -1.75e-132: tmp = x - ((y * a) / t) elif z <= 8e+29: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.28e+56) tmp = Float64(x - a); elseif (z <= -1.75e-132) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (z <= 8e+29) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.28e+56) tmp = x - a; elseif (z <= -1.75e-132) tmp = x - ((y * a) / t); elseif (z <= 8e+29) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.28e+56], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.75e-132], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+29], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{+56}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-132}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+29}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.2800000000000001e56 or 7.99999999999999931e29 < z Initial program 95.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.8%
if -1.2800000000000001e56 < z < -1.75e-132Initial program 95.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 90.1%
Taylor expanded in t around inf 75.3%
if -1.75e-132 < z < 7.99999999999999931e29Initial program 99.9%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 94.5%
Taylor expanded in t around 0 83.2%
Final simplification83.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+69) (not (<= z 2.7e+21))) (+ x (/ (- y z) (/ z a))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+69) || !(z <= 2.7e+21)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.8d+69)) .or. (.not. (z <= 2.7d+21))) then
tmp = x + ((y - z) / (z / a))
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+69) || !(z <= 2.7e+21)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+69) or not (z <= 2.7e+21): tmp = x + ((y - z) / (z / a)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+69) || !(z <= 2.7e+21)) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.8e+69) || ~((z <= 2.7e+21))) tmp = x + ((y - z) / (z / a)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+69], N[Not[LessEqual[z, 2.7e+21]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+69} \lor \neg \left(z \leq 2.7 \cdot 10^{+21}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.79999999999999982e69 or 2.7e21 < z Initial program 95.4%
Taylor expanded in z around inf 88.1%
mul-1-neg88.1%
distribute-neg-frac288.1%
Simplified88.1%
if -2.79999999999999982e69 < z < 2.7e21Initial program 98.6%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 94.6%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+62) (not (<= z 7e+39))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+62) || !(z <= 7e+39)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.6d+62)) .or. (.not. (z <= 7d+39))) then
tmp = x - a
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+62) || !(z <= 7e+39)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+62) or not (z <= 7e+39): tmp = x - a else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+62) || !(z <= 7e+39)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.6e+62) || ~((z <= 7e+39))) tmp = x - a; else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+62], N[Not[LessEqual[z, 7e+39]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+62} \lor \neg \left(z \leq 7 \cdot 10^{+39}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.59999999999999984e62 or 7.0000000000000003e39 < z Initial program 96.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 89.0%
if -2.59999999999999984e62 < z < 7.0000000000000003e39Initial program 98.1%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 92.4%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.18e+51) (not (<= z 8e+29))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.18e+51) || !(z <= 8e+29)) {
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 <= (-1.18d+51)) .or. (.not. (z <= 8d+29))) 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 <= -1.18e+51) || !(z <= 8e+29)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.18e+51) or not (z <= 8e+29): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.18e+51) || !(z <= 8e+29)) 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 <= -1.18e+51) || ~((z <= 8e+29))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.18e+51], N[Not[LessEqual[z, 8e+29]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{+51} \lor \neg \left(z \leq 8 \cdot 10^{+29}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.18e51 or 7.99999999999999931e29 < z Initial program 95.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.8%
if -1.18e51 < z < 7.99999999999999931e29Initial program 98.7%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 93.4%
Taylor expanded in t around 0 78.0%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.8e+78) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.8e+78) {
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 <= 4.8d+78) 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 <= 4.8e+78) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.8e+78: tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.8e+78) 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 <= 4.8e+78) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.8e+78], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+78}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < 4.7999999999999997e78Initial program 97.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 66.4%
if 4.7999999999999997e78 < t Initial program 96.0%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in x around inf 70.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.3%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in x around inf 58.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 2024103
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))