
(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.9%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+50) (not (<= t 9e+110))) (+ x (* a (/ (- z y) t))) (+ x (* a (/ (- z y) (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+50) || !(t <= 9e+110)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.8d+50)) .or. (.not. (t <= 9d+110))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x + (a * ((z - y) / (1.0d0 - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+50) || !(t <= 9e+110)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+50) or not (t <= 9e+110): tmp = x + (a * ((z - y) / t)) else: tmp = x + (a * ((z - y) / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+50) || !(t <= 9e+110)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+50) || ~((t <= 9e+110))) tmp = x + (a * ((z - y) / t)); else tmp = x + (a * ((z - y) / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+50], N[Not[LessEqual[t, 9e+110]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+50} \lor \neg \left(t \leq 9 \cdot 10^{+110}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\end{array}
\end{array}
if t < -4.8000000000000004e50 or 9.0000000000000005e110 < t Initial program 95.7%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in t around inf 89.8%
if -4.8000000000000004e50 < t < 9.0000000000000005e110Initial program 95.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 95.7%
Final simplification93.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.85e+49)
(- x a)
(if (<= z -8.5e-55)
(+ x (* (/ a t) (- z y)))
(if (<= z 1.1e-9) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+49) {
tmp = x - a;
} else if (z <= -8.5e-55) {
tmp = x + ((a / t) * (z - y));
} else if (z <= 1.1e-9) {
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.85d+49)) then
tmp = x - a
else if (z <= (-8.5d-55)) then
tmp = x + ((a / t) * (z - y))
else if (z <= 1.1d-9) 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.85e+49) {
tmp = x - a;
} else if (z <= -8.5e-55) {
tmp = x + ((a / t) * (z - y));
} else if (z <= 1.1e-9) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+49: tmp = x - a elif z <= -8.5e-55: tmp = x + ((a / t) * (z - y)) elif z <= 1.1e-9: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+49) tmp = Float64(x - a); elseif (z <= -8.5e-55) tmp = Float64(x + Float64(Float64(a / t) * Float64(z - y))); elseif (z <= 1.1e-9) 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.85e+49) tmp = x - a; elseif (z <= -8.5e-55) tmp = x + ((a / t) * (z - y)); elseif (z <= 1.1e-9) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+49], N[(x - a), $MachinePrecision], If[LessEqual[z, -8.5e-55], N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-9], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+49}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-55}:\\
\;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-9}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.85000000000000009e49 or 1.0999999999999999e-9 < z Initial program 92.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.7%
if -1.85000000000000009e49 < z < -8.49999999999999968e-55Initial program 99.9%
clear-num99.7%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 76.1%
if -8.49999999999999968e-55 < z < 1.0999999999999999e-9Initial program 99.0%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 94.0%
Taylor expanded in t around 0 76.2%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e+49) (not (<= z 1.1e-9))) (+ 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 <= -1.25e+49) || !(z <= 1.1e-9)) {
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 <= (-1.25d+49)) .or. (.not. (z <= 1.1d-9))) 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 <= -1.25e+49) || !(z <= 1.1e-9)) {
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 <= -1.25e+49) or not (z <= 1.1e-9): 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 <= -1.25e+49) || !(z <= 1.1e-9)) 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 <= -1.25e+49) || ~((z <= 1.1e-9))) 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, -1.25e+49], N[Not[LessEqual[z, 1.1e-9]], $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 -1.25 \cdot 10^{+49} \lor \neg \left(z \leq 1.1 \cdot 10^{-9}\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 < -1.2500000000000001e49 or 1.0999999999999999e-9 < z Initial program 92.1%
clear-num92.0%
associate-/r/92.1%
clear-num92.2%
Applied egg-rr92.2%
Taylor expanded in z around inf 83.2%
associate-*r/83.2%
neg-mul-183.2%
Simplified83.2%
if -1.2500000000000001e49 < z < 1.0999999999999999e-9Initial program 99.1%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 91.8%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e+49) (not (<= z 1.1e-9))) (- (+ x (/ (* y a) z)) a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e+49) || !(z <= 1.1e-9)) {
tmp = (x + ((y * a) / 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 <= (-1.25d+49)) .or. (.not. (z <= 1.1d-9))) then
tmp = (x + ((y * a) / 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 <= -1.25e+49) || !(z <= 1.1e-9)) {
tmp = (x + ((y * a) / z)) - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e+49) or not (z <= 1.1e-9): tmp = (x + ((y * a) / z)) - a else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.25e+49) || !(z <= 1.1e-9)) tmp = Float64(Float64(x + Float64(Float64(y * a) / 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 <= -1.25e+49) || ~((z <= 1.1e-9))) tmp = (x + ((y * a) / 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, -1.25e+49], N[Not[LessEqual[z, 1.1e-9]], $MachinePrecision]], N[(N[(x + N[(N[(y * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - 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 -1.25 \cdot 10^{+49} \lor \neg \left(z \leq 1.1 \cdot 10^{-9}\right):\\
\;\;\;\;\left(x + \frac{y \cdot a}{z}\right) - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.2500000000000001e49 or 1.0999999999999999e-9 < z Initial program 92.1%
clear-num92.0%
associate-/r/92.1%
clear-num92.2%
Applied egg-rr92.2%
Taylor expanded in z around inf 83.2%
associate-*r/83.2%
neg-mul-183.2%
Simplified83.2%
Taylor expanded in z around inf 82.3%
if -1.2500000000000001e49 < z < 1.0999999999999999e-9Initial program 99.1%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 91.8%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e+49) (not (<= z 1.1e-9))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+49) || !(z <= 1.1e-9)) {
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 <= (-1.3d+49)) .or. (.not. (z <= 1.1d-9))) 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 <= -1.3e+49) || !(z <= 1.1e-9)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e+49) or not (z <= 1.1e-9): 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 <= -1.3e+49) || !(z <= 1.1e-9)) 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 <= -1.3e+49) || ~((z <= 1.1e-9))) 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, -1.3e+49], N[Not[LessEqual[z, 1.1e-9]], $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 -1.3 \cdot 10^{+49} \lor \neg \left(z \leq 1.1 \cdot 10^{-9}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.29999999999999994e49 or 1.0999999999999999e-9 < z Initial program 92.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.0%
if -1.29999999999999994e49 < z < 1.0999999999999999e-9Initial program 99.1%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 91.8%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (<= z 4.9e+119) (+ x (* (- y z) (/ a (+ -1.0 (- z t))))) (+ x (* a (/ (- z y) (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.9e+119) {
tmp = x + ((y - z) * (a / (-1.0 + (z - t))));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 4.9d+119) then
tmp = x + ((y - z) * (a / ((-1.0d0) + (z - t))))
else
tmp = x + (a * ((z - y) / (1.0d0 - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.9e+119) {
tmp = x + ((y - z) * (a / (-1.0 + (z - t))));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 4.9e+119: tmp = x + ((y - z) * (a / (-1.0 + (z - t)))) else: tmp = x + (a * ((z - y) / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 4.9e+119) tmp = Float64(x + Float64(Float64(y - z) * Float64(a / Float64(-1.0 + Float64(z - t))))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 4.9e+119) tmp = x + ((y - z) * (a / (-1.0 + (z - t)))); else tmp = x + (a * ((z - y) / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 4.9e+119], N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.9 \cdot 10^{+119}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{a}{-1 + \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\end{array}
\end{array}
if z < 4.89999999999999996e119Initial program 97.7%
clear-num97.6%
associate-/r/97.7%
clear-num97.8%
Applied egg-rr97.8%
if 4.89999999999999996e119 < z Initial program 86.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 99.7%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+26) (not (<= z 1.1e-9))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+26) || !(z <= 1.1e-9)) {
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 <= (-3.2d+26)) .or. (.not. (z <= 1.1d-9))) 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 <= -3.2e+26) || !(z <= 1.1e-9)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+26) or not (z <= 1.1e-9): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+26) || !(z <= 1.1e-9)) 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 <= -3.2e+26) || ~((z <= 1.1e-9))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+26], N[Not[LessEqual[z, 1.1e-9]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+26} \lor \neg \left(z \leq 1.1 \cdot 10^{-9}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -3.20000000000000029e26 or 1.0999999999999999e-9 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -3.20000000000000029e26 < z < 1.0999999999999999e-9Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 93.5%
Taylor expanded in t around 0 74.2%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e+22) (not (<= z 1.1e-9))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e+22) || !(z <= 1.1e-9)) {
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 <= (-3.4d+22)) .or. (.not. (z <= 1.1d-9))) 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 <= -3.4e+22) || !(z <= 1.1e-9)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e+22) or not (z <= 1.1e-9): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e+22) || !(z <= 1.1e-9)) 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 <= -3.4e+22) || ~((z <= 1.1e-9))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e+22], N[Not[LessEqual[z, 1.1e-9]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+22} \lor \neg \left(z \leq 1.1 \cdot 10^{-9}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.4e22 or 1.0999999999999999e-9 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.9%
if -3.4e22 < z < 1.0999999999999999e-9Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
associate-/r/99.2%
distribute-rgt-neg-in99.2%
associate-*l/99.2%
associate-/l*99.2%
fma-define99.2%
distribute-frac-neg99.2%
distribute-neg-frac299.2%
distribute-neg-in99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in a around 0 59.0%
Final simplification68.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.2e+249) (not (<= a 6.8e+123))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.2e+249) || !(a <= 6.8e+123)) {
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 <= (-5.2d+249)) .or. (.not. (a <= 6.8d+123))) 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 <= -5.2e+249) || !(a <= 6.8e+123)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.2e+249) or not (a <= 6.8e+123): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.2e+249) || !(a <= 6.8e+123)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.2e+249) || ~((a <= 6.8e+123))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.2e+249], N[Not[LessEqual[a, 6.8e+123]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{+249} \lor \neg \left(a \leq 6.8 \cdot 10^{+123}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.20000000000000038e249 or 6.80000000000000002e123 < a Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
associate-*l/67.2%
associate-/l*100.0%
fma-define100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around -inf 56.4%
Taylor expanded in z around inf 39.8%
neg-mul-139.8%
Simplified39.8%
if -5.20000000000000038e249 < a < 6.80000000000000002e123Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
associate-/r/99.5%
distribute-rgt-neg-in99.5%
associate-*l/95.4%
associate-/l*95.1%
fma-define95.1%
distribute-frac-neg95.1%
distribute-neg-frac295.1%
distribute-neg-in95.1%
sub-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
+-commutative95.1%
sub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in a around 0 64.7%
Final simplification60.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 95.9%
sub-neg95.9%
+-commutative95.9%
associate-/r/99.6%
distribute-rgt-neg-in99.6%
associate-*l/90.4%
associate-/l*95.9%
fma-define95.9%
distribute-frac-neg95.9%
distribute-neg-frac295.9%
distribute-neg-in95.9%
sub-neg95.9%
distribute-neg-in95.9%
remove-double-neg95.9%
+-commutative95.9%
sub-neg95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in a around 0 56.1%
(FPCore (x y z t a) :precision binary64 a)
double code(double x, double y, double z, double t, double a) {
return 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 = a
end function
public static double code(double x, double y, double z, double t, double a) {
return a;
}
def code(x, y, z, t, a): return a
function code(x, y, z, t, a) return a end
function tmp = code(x, y, z, t, a) tmp = a; end
code[x_, y_, z_, t_, a_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 95.9%
sub-neg95.9%
+-commutative95.9%
associate-/r/99.6%
distribute-rgt-neg-in99.6%
associate-*l/90.4%
associate-/l*95.9%
fma-define95.9%
distribute-frac-neg95.9%
distribute-neg-frac295.9%
distribute-neg-in95.9%
sub-neg95.9%
distribute-neg-in95.9%
remove-double-neg95.9%
+-commutative95.9%
sub-neg95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in a around -inf 36.9%
Taylor expanded in z around inf 15.4%
neg-mul-115.4%
Simplified15.4%
neg-sub015.4%
sub-neg15.4%
add-sqr-sqrt7.1%
sqrt-unprod7.1%
sqr-neg7.1%
sqrt-unprod1.6%
add-sqr-sqrt3.6%
Applied egg-rr3.6%
+-lft-identity3.6%
Simplified3.6%
(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 2024163
(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))))