
(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 10 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 97.0%
associate-/r/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e+42) (not (<= z 8e-40))) (+ x (/ a (/ (+ (- t z) 1.0) z))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+42) || !(z <= 8e-40)) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-7.2d+42)) .or. (.not. (z <= 8d-40))) then
tmp = x + (a / (((t - z) + 1.0d0) / z))
else
tmp = x - (a * (y / (t + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+42) || !(z <= 8e-40)) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+42) or not (z <= 8e-40): tmp = x + (a / (((t - z) + 1.0) / z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+42) || !(z <= 8e-40)) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / z))); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e+42) || ~((z <= 8e-40))) tmp = x + (a / (((t - z) + 1.0) / z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+42], N[Not[LessEqual[z, 8e-40]], $MachinePrecision]], N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+42} \lor \neg \left(z \leq 8 \cdot 10^{-40}\right):\\
\;\;\;\;x + \frac{a}{\frac{\left(t - z\right) + 1}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -7.2000000000000002e42 or 7.9999999999999994e-40 < z Initial program 95.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 73.3%
sub-neg73.3%
mul-1-neg73.3%
*-commutative73.3%
associate--l+73.3%
+-commutative73.3%
associate-*r/87.9%
remove-double-neg87.9%
associate-*r/73.3%
*-commutative73.3%
+-commutative73.3%
associate--l+73.3%
associate-/l*91.7%
associate--l+91.7%
Simplified91.7%
if -7.2000000000000002e42 < z < 7.9999999999999994e-40Initial program 98.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 95.0%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.8e+41)
(+ x (/ a (/ (+ (- t z) 1.0) z)))
(if (<= z 7.2e-40)
(- x (* a (/ y (+ t 1.0))))
(- x (* a (/ z (- (+ z -1.0) t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+41) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else if (z <= 7.2e-40) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x - (a * (z / ((z + -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 <= (-5.8d+41)) then
tmp = x + (a / (((t - z) + 1.0d0) / z))
else if (z <= 7.2d-40) then
tmp = x - (a * (y / (t + 1.0d0)))
else
tmp = x - (a * (z / ((z + (-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 <= -5.8e+41) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else if (z <= 7.2e-40) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x - (a * (z / ((z + -1.0) - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+41: tmp = x + (a / (((t - z) + 1.0) / z)) elif z <= 7.2e-40: tmp = x - (a * (y / (t + 1.0))) else: tmp = x - (a * (z / ((z + -1.0) - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+41) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / z))); elseif (z <= 7.2e-40) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); else tmp = Float64(x - Float64(a * Float64(z / Float64(Float64(z + -1.0) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.8e+41) tmp = x + (a / (((t - z) + 1.0) / z)); elseif (z <= 7.2e-40) tmp = x - (a * (y / (t + 1.0))); else tmp = x - (a * (z / ((z + -1.0) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+41], N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-40], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(z / N[(N[(z + -1.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{a}{\frac{\left(t - z\right) + 1}{z}}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-40}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{z}{\left(z + -1\right) - t}\\
\end{array}
\end{array}
if z < -5.79999999999999977e41Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 77.0%
sub-neg77.0%
mul-1-neg77.0%
*-commutative77.0%
associate--l+77.0%
+-commutative77.0%
associate-*r/88.2%
remove-double-neg88.2%
associate-*r/77.0%
*-commutative77.0%
+-commutative77.0%
associate--l+77.0%
associate-/l*93.3%
associate--l+93.3%
Simplified93.3%
if -5.79999999999999977e41 < z < 7.2e-40Initial program 98.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 95.0%
if 7.2e-40 < z Initial program 96.8%
associate-/r/100.0%
Simplified100.0%
frac-2neg100.0%
div-inv99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 90.2%
associate--r+90.2%
sub-neg90.2%
metadata-eval90.2%
Simplified90.2%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.2e+50)
(+ x (* a (/ (- z y) t)))
(if (<= t 2.8e-20)
(- x (/ a (/ (- 1.0 z) (- y z))))
(- x (* a (/ z (- (+ z -1.0) t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e+50) {
tmp = x + (a * ((z - y) / t));
} else if (t <= 2.8e-20) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x - (a * (z / ((z + -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 (t <= (-2.2d+50)) then
tmp = x + (a * ((z - y) / t))
else if (t <= 2.8d-20) then
tmp = x - (a / ((1.0d0 - z) / (y - z)))
else
tmp = x - (a * (z / ((z + (-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 (t <= -2.2e+50) {
tmp = x + (a * ((z - y) / t));
} else if (t <= 2.8e-20) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x - (a * (z / ((z + -1.0) - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.2e+50: tmp = x + (a * ((z - y) / t)) elif t <= 2.8e-20: tmp = x - (a / ((1.0 - z) / (y - z))) else: tmp = x - (a * (z / ((z + -1.0) - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.2e+50) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); elseif (t <= 2.8e-20) tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / Float64(y - z)))); else tmp = Float64(x - Float64(a * Float64(z / Float64(Float64(z + -1.0) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.2e+50) tmp = x + (a * ((z - y) / t)); elseif (t <= 2.8e-20) tmp = x - (a / ((1.0 - z) / (y - z))); else tmp = x - (a * (z / ((z + -1.0) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.2e+50], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-20], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(z / N[(N[(z + -1.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+50}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-20}:\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{z}{\left(z + -1\right) - t}\\
\end{array}
\end{array}
if t < -2.20000000000000017e50Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 92.9%
if -2.20000000000000017e50 < t < 2.8000000000000003e-20Initial program 98.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 87.7%
associate-/l*96.5%
Simplified96.5%
if 2.8000000000000003e-20 < t Initial program 96.7%
associate-/r/99.9%
Simplified99.9%
frac-2neg99.9%
div-inv99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 90.7%
associate--r+90.7%
sub-neg90.7%
metadata-eval90.7%
Simplified90.7%
Final simplification94.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+55)
(- x a)
(if (<= z 4.5e+33)
(- x (* a (/ y (+ t 1.0))))
(+ x (/ (- z y) (- (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+55) {
tmp = x - a;
} else if (z <= 4.5e+33) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x + ((z - y) / -(z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.2d+55)) then
tmp = x - a
else if (z <= 4.5d+33) then
tmp = x - (a * (y / (t + 1.0d0)))
else
tmp = x + ((z - y) / -(z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+55) {
tmp = x - a;
} else if (z <= 4.5e+33) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x + ((z - y) / -(z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+55: tmp = x - a elif z <= 4.5e+33: tmp = x - (a * (y / (t + 1.0))) else: tmp = x + ((z - y) / -(z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+55) tmp = Float64(x - a); elseif (z <= 4.5e+33) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(-Float64(z / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+55) tmp = x - a; elseif (z <= 4.5e+33) tmp = x - (a * (y / (t + 1.0))); else tmp = x + ((z - y) / -(z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+55], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.5e+33], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / (-N[(z / a), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+55}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+33}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{-\frac{z}{a}}\\
\end{array}
\end{array}
if z < -5.2e55Initial program 93.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.4%
if -5.2e55 < z < 4.5e33Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.0%
if 4.5e33 < z Initial program 96.0%
Taylor expanded in z around inf 90.2%
mul-1-neg90.2%
distribute-neg-frac90.2%
Simplified90.2%
Final simplification90.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y a))))
(if (<= z -1.65e+55)
(- x a)
(if (<= z -5.6e-248)
t_1
(if (<= z 1.66e-150)
(- x (/ a (/ t y)))
(if (<= z 2.05e+33) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * a);
double tmp;
if (z <= -1.65e+55) {
tmp = x - a;
} else if (z <= -5.6e-248) {
tmp = t_1;
} else if (z <= 1.66e-150) {
tmp = x - (a / (t / y));
} else if (z <= 2.05e+33) {
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 - (y * a)
if (z <= (-1.65d+55)) then
tmp = x - a
else if (z <= (-5.6d-248)) then
tmp = t_1
else if (z <= 1.66d-150) then
tmp = x - (a / (t / y))
else if (z <= 2.05d+33) 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 - (y * a);
double tmp;
if (z <= -1.65e+55) {
tmp = x - a;
} else if (z <= -5.6e-248) {
tmp = t_1;
} else if (z <= 1.66e-150) {
tmp = x - (a / (t / y));
} else if (z <= 2.05e+33) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * a) tmp = 0 if z <= -1.65e+55: tmp = x - a elif z <= -5.6e-248: tmp = t_1 elif z <= 1.66e-150: tmp = x - (a / (t / y)) elif z <= 2.05e+33: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * a)) tmp = 0.0 if (z <= -1.65e+55) tmp = Float64(x - a); elseif (z <= -5.6e-248) tmp = t_1; elseif (z <= 1.66e-150) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 2.05e+33) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * a); tmp = 0.0; if (z <= -1.65e+55) tmp = x - a; elseif (z <= -5.6e-248) tmp = t_1; elseif (z <= 1.66e-150) tmp = x - (a / (t / y)); elseif (z <= 2.05e+33) 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[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+55], N[(x - a), $MachinePrecision], If[LessEqual[z, -5.6e-248], t$95$1, If[LessEqual[z, 1.66e-150], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+33], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot a\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+55}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-248}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{-150}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.65e55 or 2.04999999999999997e33 < z Initial program 94.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.0%
if -1.65e55 < z < -5.6000000000000002e-248 or 1.6600000000000001e-150 < z < 2.04999999999999997e33Initial program 98.9%
associate-/r/99.9%
Simplified99.9%
frac-2neg99.9%
div-inv99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 88.1%
Taylor expanded in t around 0 75.7%
if -5.6000000000000002e-248 < z < 1.6600000000000001e-150Initial program 97.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around inf 84.5%
Taylor expanded in y around inf 76.1%
associate-/l*80.3%
Simplified80.3%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e+56) (not (<= z 4e+33))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e+56) || !(z <= 4e+33)) {
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 <= (-6.5d+56)) .or. (.not. (z <= 4d+33))) 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 <= -6.5e+56) || !(z <= 4e+33)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e+56) or not (z <= 4e+33): 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 <= -6.5e+56) || !(z <= 4e+33)) 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 <= -6.5e+56) || ~((z <= 4e+33))) 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, -6.5e+56], N[Not[LessEqual[z, 4e+33]], $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 -6.5 \cdot 10^{+56} \lor \neg \left(z \leq 4 \cdot 10^{+33}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -6.5000000000000001e56 or 3.9999999999999998e33 < z Initial program 94.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.0%
if -6.5000000000000001e56 < z < 3.9999999999999998e33Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.0%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e+55) (not (<= z 2.9e+33))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e+55) || !(z <= 2.9e+33)) {
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.65d+55)) .or. (.not. (z <= 2.9d+33))) 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.65e+55) || !(z <= 2.9e+33)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e+55) or not (z <= 2.9e+33): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e+55) || !(z <= 2.9e+33)) 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.65e+55) || ~((z <= 2.9e+33))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e+55], N[Not[LessEqual[z, 2.9e+33]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+55} \lor \neg \left(z \leq 2.9 \cdot 10^{+33}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.65e55 or 2.90000000000000025e33 < z Initial program 94.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.0%
if -1.65e55 < z < 2.90000000000000025e33Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
frac-2neg99.9%
div-inv99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in t around 0 73.4%
Final simplification78.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.6e-11) (not (<= z 2.05e+33))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.6e-11) || !(z <= 2.05e+33)) {
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 <= (-8.6d-11)) .or. (.not. (z <= 2.05d+33))) 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 <= -8.6e-11) || !(z <= 2.05e+33)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.6e-11) or not (z <= 2.05e+33): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.6e-11) || !(z <= 2.05e+33)) 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 <= -8.6e-11) || ~((z <= 2.05e+33))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.6e-11], N[Not[LessEqual[z, 2.05e+33]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{-11} \lor \neg \left(z \leq 2.05 \cdot 10^{+33}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.60000000000000003e-11 or 2.04999999999999997e33 < z Initial program 95.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.3%
if -8.60000000000000003e-11 < z < 2.04999999999999997e33Initial program 98.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 59.3%
Final simplification69.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 97.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around inf 55.8%
Final simplification55.8%
(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 2023308
(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))))