
(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 11 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 95.5%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.7e+101)
(- x a)
(if (<= z -1.18e-76)
(+ x (* a (/ z (+ t 1.0))))
(if (<= z 1.32e+88) (+ x (* a (/ y (- -1.0 t)))) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.7e+101) {
tmp = x - a;
} else if (z <= -1.18e-76) {
tmp = x + (a * (z / (t + 1.0)));
} else if (z <= 1.32e+88) {
tmp = x + (a * (y / (-1.0 - t)));
} 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 <= (-4.7d+101)) then
tmp = x - a
else if (z <= (-1.18d-76)) then
tmp = x + (a * (z / (t + 1.0d0)))
else if (z <= 1.32d+88) then
tmp = x + (a * (y / ((-1.0d0) - t)))
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 <= -4.7e+101) {
tmp = x - a;
} else if (z <= -1.18e-76) {
tmp = x + (a * (z / (t + 1.0)));
} else if (z <= 1.32e+88) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.7e+101: tmp = x - a elif z <= -1.18e-76: tmp = x + (a * (z / (t + 1.0))) elif z <= 1.32e+88: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.7e+101) tmp = Float64(x - a); elseif (z <= -1.18e-76) tmp = Float64(x + Float64(a * Float64(z / Float64(t + 1.0)))); elseif (z <= 1.32e+88) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.7e+101) tmp = x - a; elseif (z <= -1.18e-76) tmp = x + (a * (z / (t + 1.0))); elseif (z <= 1.32e+88) tmp = x + (a * (y / (-1.0 - t))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.7e+101], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.18e-76], N[(x + N[(a * N[(z / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.32e+88], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+101}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.18 \cdot 10^{-76}:\\
\;\;\;\;x + a \cdot \frac{z}{t + 1}\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+88}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.69999999999999971e101 or 1.3200000000000001e88 < z Initial program 92.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.8%
if -4.69999999999999971e101 < z < -1.17999999999999993e-76Initial program 94.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 86.2%
associate--l+86.2%
+-commutative86.2%
neg-mul-186.2%
distribute-neg-frac286.2%
+-commutative86.2%
distribute-neg-in86.2%
metadata-eval86.2%
unsub-neg86.2%
Simplified86.2%
Taylor expanded in z around 0 76.4%
distribute-lft-in76.4%
metadata-eval76.4%
neg-mul-176.4%
sub-neg76.4%
Simplified76.4%
if -1.17999999999999993e-76 < z < 1.3200000000000001e88Initial program 97.6%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 86.3%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.2e+16) (not (<= t 1.2))) (+ x (* a (/ z (+ (- t z) 1.0)))) (+ x (* a (/ (- y z) (+ z -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.2e+16) || !(t <= 1.2)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x + (a * ((y - z) / (z + -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 ((t <= (-6.2d+16)) .or. (.not. (t <= 1.2d0))) then
tmp = x + (a * (z / ((t - z) + 1.0d0)))
else
tmp = x + (a * ((y - z) / (z + (-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 ((t <= -6.2e+16) || !(t <= 1.2)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x + (a * ((y - z) / (z + -1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.2e+16) or not (t <= 1.2): tmp = x + (a * (z / ((t - z) + 1.0))) else: tmp = x + (a * ((y - z) / (z + -1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.2e+16) || !(t <= 1.2)) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t - z) + 1.0)))); else tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.2e+16) || ~((t <= 1.2))) tmp = x + (a * (z / ((t - z) + 1.0))); else tmp = x + (a * ((y - z) / (z + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.2e+16], N[Not[LessEqual[t, 1.2]], $MachinePrecision]], N[(x + N[(a * N[(z / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+16} \lor \neg \left(t \leq 1.2\right):\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\end{array}
\end{array}
if t < -6.2e16 or 1.19999999999999996 < t Initial program 94.7%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in y around 0 84.1%
associate--l+84.1%
+-commutative84.1%
neg-mul-184.1%
distribute-neg-frac284.1%
+-commutative84.1%
distribute-neg-in84.1%
metadata-eval84.1%
unsub-neg84.1%
Simplified84.1%
if -6.2e16 < t < 1.19999999999999996Initial program 96.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 99.4%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e-76) (not (<= z 8.5e-27))) (+ x (* a (/ z (+ (- t z) 1.0)))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e-76) || !(z <= 8.5e-27)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} 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 <= (-1.25d-76)) .or. (.not. (z <= 8.5d-27))) then
tmp = x + (a * (z / ((t - z) + 1.0d0)))
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 <= -1.25e-76) || !(z <= 8.5e-27)) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e-76) or not (z <= 8.5e-27): tmp = x + (a * (z / ((t - z) + 1.0))) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.25e-76) || !(z <= 8.5e-27)) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t - z) + 1.0)))); 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 <= -1.25e-76) || ~((z <= 8.5e-27))) tmp = x + (a * (z / ((t - z) + 1.0))); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.25e-76], N[Not[LessEqual[z, 8.5e-27]], $MachinePrecision]], N[(x + N[(a * N[(z / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $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 -1.25 \cdot 10^{-76} \lor \neg \left(z \leq 8.5 \cdot 10^{-27}\right):\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.2499999999999999e-76 or 8.50000000000000033e-27 < z Initial program 93.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 88.1%
associate--l+88.1%
+-commutative88.1%
neg-mul-188.1%
distribute-neg-frac288.1%
+-commutative88.1%
distribute-neg-in88.1%
metadata-eval88.1%
unsub-neg88.1%
Simplified88.1%
if -1.2499999999999999e-76 < z < 8.50000000000000033e-27Initial program 98.9%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in z around 0 95.1%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.15e-15) (not (<= z 2.6e+21))) (+ x (* (- y z) (/ a z))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.15e-15) || !(z <= 2.6e+21)) {
tmp = x + ((y - z) * (a / z));
} 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.15d-15)) .or. (.not. (z <= 2.6d+21))) then
tmp = x + ((y - z) * (a / z))
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.15e-15) || !(z <= 2.6e+21)) {
tmp = x + ((y - z) * (a / z));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.15e-15) or not (z <= 2.6e+21): tmp = x + ((y - z) * (a / z)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.15e-15) || !(z <= 2.6e+21)) tmp = Float64(x + Float64(Float64(y - z) * Float64(a / z))); 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.15e-15) || ~((z <= 2.6e+21))) tmp = x + ((y - z) * (a / z)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.15e-15], N[Not[LessEqual[z, 2.6e+21]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / z), $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.15 \cdot 10^{-15} \lor \neg \left(z \leq 2.6 \cdot 10^{+21}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{a}{z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.1499999999999998e-15 or 2.6e21 < z Initial program 92.9%
clear-num92.8%
associate-/r/92.8%
clear-num94.4%
Applied egg-rr94.4%
Taylor expanded in z around inf 82.8%
associate-*r/82.8%
neg-mul-182.8%
Simplified82.8%
if -2.1499999999999998e-15 < z < 2.6e21Initial program 98.3%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 89.9%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.15e-15) (not (<= z 1.18e+88))) (- 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.15e-15) || !(z <= 1.18e+88)) {
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.15d-15)) .or. (.not. (z <= 1.18d+88))) 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.15e-15) || !(z <= 1.18e+88)) {
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.15e-15) or not (z <= 1.18e+88): 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.15e-15) || !(z <= 1.18e+88)) 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.15e-15) || ~((z <= 1.18e+88))) 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.15e-15], N[Not[LessEqual[z, 1.18e+88]], $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.15 \cdot 10^{-15} \lor \neg \left(z \leq 1.18 \cdot 10^{+88}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.1499999999999998e-15 or 1.1799999999999999e88 < z Initial program 93.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.0%
if -2.1499999999999998e-15 < z < 1.1799999999999999e88Initial program 97.2%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 84.5%
Final simplification83.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-100) (not (<= z 0.22))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-100) || !(z <= 0.22)) {
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.75d-100)) .or. (.not. (z <= 0.22d0))) 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.75e-100) || !(z <= 0.22)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-100) or not (z <= 0.22): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-100) || !(z <= 0.22)) 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.75e-100) || ~((z <= 0.22))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-100], N[Not[LessEqual[z, 0.22]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-100} \lor \neg \left(z \leq 0.22\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.75e-100 or 0.220000000000000001 < z Initial program 93.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 75.0%
if -1.75e-100 < z < 0.220000000000000001Initial program 98.9%
associate-/r/99.0%
Simplified99.0%
*-commutative99.0%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in t around 0 78.5%
Taylor expanded in z around 0 73.8%
Final simplification74.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e-15) (not (<= z 2.6e+21))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e-15) || !(z <= 2.6e+21)) {
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.6d-15)) .or. (.not. (z <= 2.6d+21))) 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.6e-15) || !(z <= 2.6e+21)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e-15) or not (z <= 2.6e+21): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e-15) || !(z <= 2.6e+21)) 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.6e-15) || ~((z <= 2.6e+21))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e-15], N[Not[LessEqual[z, 2.6e+21]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-15} \lor \neg \left(z \leq 2.6 \cdot 10^{+21}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.6e-15 or 2.6e21 < z Initial program 92.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.2%
if -1.6e-15 < z < 2.6e21Initial program 98.3%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around inf 45.4%
Taylor expanded in x around inf 57.4%
Final simplification67.7%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ a (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-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 + ((y - z) * (a / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + ((y - z) * (a / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(a / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (a / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{a}{-1 + \left(z - t\right)}
\end{array}
Initial program 95.5%
clear-num95.4%
associate-/r/95.5%
clear-num96.3%
Applied egg-rr96.3%
Final simplification96.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.1e+125) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.1e+125) {
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.1d+125)) 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.1e+125) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.1e+125: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.1e+125) 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.1e+125) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.1e+125], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+125}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.1000000000000001e125Initial program 99.5%
associate-/r/97.0%
Simplified97.0%
Taylor expanded in z around inf 34.8%
Taylor expanded in x around 0 30.9%
neg-mul-130.9%
Simplified30.9%
if -2.1000000000000001e125 < a Initial program 94.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 66.1%
Taylor expanded in x around inf 59.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.5%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around inf 61.9%
Taylor expanded in x around inf 53.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 2024145
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))