
(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 96.8%
associate-/r/99.6%
*-commutative99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.2e+143)
(- x a)
(if (<= z -14800000.0)
(+ x (/ a (/ z y)))
(if (or (<= z -5.8e-24) (not (<= z 640.0)))
(+ x (/ a (/ (- 1.0 z) z)))
(- x (* a (/ y (+ t 1.0))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.2e+143) {
tmp = x - a;
} else if (z <= -14800000.0) {
tmp = x + (a / (z / y));
} else if ((z <= -5.8e-24) || !(z <= 640.0)) {
tmp = x + (a / ((1.0 - z) / 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 <= (-9.2d+143)) then
tmp = x - a
else if (z <= (-14800000.0d0)) then
tmp = x + (a / (z / y))
else if ((z <= (-5.8d-24)) .or. (.not. (z <= 640.0d0))) then
tmp = x + (a / ((1.0d0 - z) / 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 <= -9.2e+143) {
tmp = x - a;
} else if (z <= -14800000.0) {
tmp = x + (a / (z / y));
} else if ((z <= -5.8e-24) || !(z <= 640.0)) {
tmp = x + (a / ((1.0 - z) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.2e+143: tmp = x - a elif z <= -14800000.0: tmp = x + (a / (z / y)) elif (z <= -5.8e-24) or not (z <= 640.0): tmp = x + (a / ((1.0 - z) / z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.2e+143) tmp = Float64(x - a); elseif (z <= -14800000.0) tmp = Float64(x + Float64(a / Float64(z / y))); elseif ((z <= -5.8e-24) || !(z <= 640.0)) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / 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 <= -9.2e+143) tmp = x - a; elseif (z <= -14800000.0) tmp = x + (a / (z / y)); elseif ((z <= -5.8e-24) || ~((z <= 640.0))) tmp = x + (a / ((1.0 - z) / z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.2e+143], N[(x - a), $MachinePrecision], If[LessEqual[z, -14800000.0], N[(x + N[(a / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -5.8e-24], N[Not[LessEqual[z, 640.0]], $MachinePrecision]], N[(x + N[(a / N[(N[(1.0 - z), $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 -9.2 \cdot 10^{+143}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -14800000:\\
\;\;\;\;x + \frac{a}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-24} \lor \neg \left(z \leq 640\right):\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -9.1999999999999999e143Initial program 87.7%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 79.8%
if -9.1999999999999999e143 < z < -1.48e7Initial program 98.9%
associate-/r/99.9%
*-commutative99.9%
associate-*r/91.8%
div-inv91.8%
Applied egg-rr91.8%
Taylor expanded in y around inf 86.1%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
associate-/l*79.8%
Simplified79.8%
if -1.48e7 < z < -5.7999999999999997e-24 or 640 < z Initial program 95.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 60.1%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around 0 54.7%
sub-neg54.7%
mul-1-neg54.7%
remove-double-neg54.7%
associate-/l*87.0%
Simplified87.0%
if -5.7999999999999997e-24 < z < 640Initial program 99.0%
associate-/r/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 95.3%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.06e+144)
(- x a)
(if (<= z -15000000000.0)
(- x (/ a (/ (- 1.0 z) y)))
(if (or (<= z -1.8e-23) (not (<= z 105.0)))
(+ x (/ a (/ (- 1.0 z) z)))
(- x (* a (/ y (+ t 1.0))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+144) {
tmp = x - a;
} else if (z <= -15000000000.0) {
tmp = x - (a / ((1.0 - z) / y));
} else if ((z <= -1.8e-23) || !(z <= 105.0)) {
tmp = x + (a / ((1.0 - z) / 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 <= (-1.06d+144)) then
tmp = x - a
else if (z <= (-15000000000.0d0)) then
tmp = x - (a / ((1.0d0 - z) / y))
else if ((z <= (-1.8d-23)) .or. (.not. (z <= 105.0d0))) then
tmp = x + (a / ((1.0d0 - z) / 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 <= -1.06e+144) {
tmp = x - a;
} else if (z <= -15000000000.0) {
tmp = x - (a / ((1.0 - z) / y));
} else if ((z <= -1.8e-23) || !(z <= 105.0)) {
tmp = x + (a / ((1.0 - z) / z));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.06e+144: tmp = x - a elif z <= -15000000000.0: tmp = x - (a / ((1.0 - z) / y)) elif (z <= -1.8e-23) or not (z <= 105.0): tmp = x + (a / ((1.0 - z) / z)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.06e+144) tmp = Float64(x - a); elseif (z <= -15000000000.0) tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / y))); elseif ((z <= -1.8e-23) || !(z <= 105.0)) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / 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 <= -1.06e+144) tmp = x - a; elseif (z <= -15000000000.0) tmp = x - (a / ((1.0 - z) / y)); elseif ((z <= -1.8e-23) || ~((z <= 105.0))) tmp = x + (a / ((1.0 - z) / z)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.06e+144], N[(x - a), $MachinePrecision], If[LessEqual[z, -15000000000.0], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.8e-23], N[Not[LessEqual[z, 105.0]], $MachinePrecision]], N[(x + N[(a / N[(N[(1.0 - z), $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 -1.06 \cdot 10^{+144}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -15000000000:\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y}}\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-23} \lor \neg \left(z \leq 105\right):\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.06e144Initial program 87.7%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 79.8%
if -1.06e144 < z < -1.5e10Initial program 98.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 78.5%
associate-/l*83.8%
Simplified83.8%
Taylor expanded in y around inf 77.9%
associate-/l*80.6%
Simplified80.6%
if -1.5e10 < z < -1.7999999999999999e-23 or 105 < z Initial program 95.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 60.1%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around 0 54.7%
sub-neg54.7%
mul-1-neg54.7%
remove-double-neg54.7%
associate-/l*87.0%
Simplified87.0%
if -1.7999999999999999e-23 < z < 105Initial program 99.0%
associate-/r/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 95.3%
Final simplification89.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a y))))
(if (<= z -8.5e+143)
(- x a)
(if (<= z -6e-17)
(+ x (/ a (/ z y)))
(if (<= z -5.8e-178)
t_1
(if (<= z -6.5e-239)
(- x (/ a (/ t y)))
(if (<= z 78.0) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * y);
double tmp;
if (z <= -8.5e+143) {
tmp = x - a;
} else if (z <= -6e-17) {
tmp = x + (a / (z / y));
} else if (z <= -5.8e-178) {
tmp = t_1;
} else if (z <= -6.5e-239) {
tmp = x - (a / (t / y));
} else if (z <= 78.0) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (a * y)
if (z <= (-8.5d+143)) then
tmp = x - a
else if (z <= (-6d-17)) then
tmp = x + (a / (z / y))
else if (z <= (-5.8d-178)) then
tmp = t_1
else if (z <= (-6.5d-239)) then
tmp = x - (a / (t / y))
else if (z <= 78.0d0) then
tmp = t_1
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * y);
double tmp;
if (z <= -8.5e+143) {
tmp = x - a;
} else if (z <= -6e-17) {
tmp = x + (a / (z / y));
} else if (z <= -5.8e-178) {
tmp = t_1;
} else if (z <= -6.5e-239) {
tmp = x - (a / (t / y));
} else if (z <= 78.0) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * y) tmp = 0 if z <= -8.5e+143: tmp = x - a elif z <= -6e-17: tmp = x + (a / (z / y)) elif z <= -5.8e-178: tmp = t_1 elif z <= -6.5e-239: tmp = x - (a / (t / y)) elif z <= 78.0: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * y)) tmp = 0.0 if (z <= -8.5e+143) tmp = Float64(x - a); elseif (z <= -6e-17) tmp = Float64(x + Float64(a / Float64(z / y))); elseif (z <= -5.8e-178) tmp = t_1; elseif (z <= -6.5e-239) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 78.0) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * y); tmp = 0.0; if (z <= -8.5e+143) tmp = x - a; elseif (z <= -6e-17) tmp = x + (a / (z / y)); elseif (z <= -5.8e-178) tmp = t_1; elseif (z <= -6.5e-239) tmp = x - (a / (t / y)); elseif (z <= 78.0) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+143], N[(x - a), $MachinePrecision], If[LessEqual[z, -6e-17], N[(x + N[(a / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-178], t$95$1, If[LessEqual[z, -6.5e-239], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 78.0], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot y\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+143}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{a}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-178}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-239}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 78:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.4999999999999998e143 or 78 < z Initial program 93.1%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 83.7%
if -8.4999999999999998e143 < z < -6.00000000000000012e-17Initial program 99.0%
associate-/r/99.9%
*-commutative99.9%
associate-*r/92.6%
div-inv92.6%
Applied egg-rr92.6%
Taylor expanded in y around inf 85.1%
Taylor expanded in z around inf 77.0%
+-commutative77.0%
associate-/l*79.4%
Simplified79.4%
if -6.00000000000000012e-17 < z < -5.7999999999999995e-178 or -6.5000000000000003e-239 < z < 78Initial program 98.9%
associate-/r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in t around 0 77.0%
associate-/l*77.0%
Simplified77.0%
Taylor expanded in z around 0 72.8%
if -5.7999999999999995e-178 < z < -6.5000000000000003e-239Initial program 99.7%
associate-/r/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 74.2%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in y around inf 73.7%
associate-/l*90.7%
Simplified90.7%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e+51) (not (<= z 200.0))) (- x (/ a (/ (- 1.0 z) (- y z)))) (+ x (/ (- z y) (/ (+ t 1.0) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e+51) || !(z <= 200.0)) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x + ((z - y) / ((t + 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 ((z <= (-8d+51)) .or. (.not. (z <= 200.0d0))) then
tmp = x - (a / ((1.0d0 - z) / (y - z)))
else
tmp = x + ((z - y) / ((t + 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 ((z <= -8e+51) || !(z <= 200.0)) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x + ((z - y) / ((t + 1.0) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e+51) or not (z <= 200.0): tmp = x - (a / ((1.0 - z) / (y - z))) else: tmp = x + ((z - y) / ((t + 1.0) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e+51) || !(z <= 200.0)) tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / Float64(y - z)))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(t + 1.0) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e+51) || ~((z <= 200.0))) tmp = x - (a / ((1.0 - z) / (y - z))); else tmp = x + ((z - y) / ((t + 1.0) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e+51], N[Not[LessEqual[z, 200.0]], $MachinePrecision]], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(t + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+51} \lor \neg \left(z \leq 200\right):\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{t + 1}{a}}\\
\end{array}
\end{array}
if z < -8e51 or 200 < z Initial program 94.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 59.4%
associate-/l*92.4%
Simplified92.4%
if -8e51 < z < 200Initial program 99.1%
Taylor expanded in z around 0 97.7%
Final simplification95.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.1e+150)
(- x (* a (/ y (+ t 1.0))))
(if (<= t 1.3e+60)
(- x (/ a (/ (- 1.0 z) (- y z))))
(+ x (* a (/ (- z y) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.1e+150) {
tmp = x - (a * (y / (t + 1.0)));
} else if (t <= 1.3e+60) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.1d+150)) then
tmp = x - (a * (y / (t + 1.0d0)))
else if (t <= 1.3d+60) then
tmp = x - (a / ((1.0d0 - z) / (y - z)))
else
tmp = x + (a * ((z - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.1e+150) {
tmp = x - (a * (y / (t + 1.0)));
} else if (t <= 1.3e+60) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.1e+150: tmp = x - (a * (y / (t + 1.0))) elif t <= 1.3e+60: tmp = x - (a / ((1.0 - z) / (y - z))) else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.1e+150) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); elseif (t <= 1.3e+60) tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / Float64(y - z)))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.1e+150) tmp = x - (a * (y / (t + 1.0))); elseif (t <= 1.3e+60) tmp = x - (a / ((1.0 - z) / (y - z))); else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.1e+150], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+60], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+150}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+60}:\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if t < -1.1e150Initial program 88.1%
associate-/r/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 94.9%
if -1.1e150 < t < 1.30000000000000004e60Initial program 98.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 77.9%
associate-/l*96.5%
Simplified96.5%
if 1.30000000000000004e60 < t Initial program 97.3%
associate-/r/98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in t around inf 84.6%
Final simplification94.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e+52) (not (<= z 900.0))) (+ x (/ (- z y) (/ (- z) a))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e+52) || !(z <= 900.0)) {
tmp = x + ((z - y) / (-z / 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 <= (-4.6d+52)) .or. (.not. (z <= 900.0d0))) then
tmp = x + ((z - y) / (-z / 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 <= -4.6e+52) || !(z <= 900.0)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e+52) or not (z <= 900.0): tmp = x + ((z - y) / (-z / a)) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e+52) || !(z <= 900.0)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / 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 <= -4.6e+52) || ~((z <= 900.0))) tmp = x + ((z - y) / (-z / a)); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e+52], N[Not[LessEqual[z, 900.0]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+52} \lor \neg \left(z \leq 900\right):\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -4.6e52 or 900 < z Initial program 94.2%
Taylor expanded in z around inf 90.4%
mul-1-neg90.4%
distribute-neg-frac90.4%
Simplified90.4%
if -4.6e52 < z < 900Initial program 99.1%
associate-/r/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around 0 92.2%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.7e+156) (not (<= t 1.65e+16))) (- x (/ a (/ t y))) (+ x (/ a (/ (- 1.0 z) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+156) || !(t <= 1.65e+16)) {
tmp = x - (a / (t / y));
} else {
tmp = x + (a / ((1.0 - z) / 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 <= (-1.7d+156)) .or. (.not. (t <= 1.65d+16))) then
tmp = x - (a / (t / y))
else
tmp = x + (a / ((1.0d0 - z) / 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 <= -1.7e+156) || !(t <= 1.65e+16)) {
tmp = x - (a / (t / y));
} else {
tmp = x + (a / ((1.0 - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.7e+156) or not (t <= 1.65e+16): tmp = x - (a / (t / y)) else: tmp = x + (a / ((1.0 - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.7e+156) || !(t <= 1.65e+16)) tmp = Float64(x - Float64(a / Float64(t / y))); else tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.7e+156) || ~((t <= 1.65e+16))) tmp = x - (a / (t / y)); else tmp = x + (a / ((1.0 - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.7e+156], N[Not[LessEqual[t, 1.65e+16]], $MachinePrecision]], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+156} \lor \neg \left(t \leq 1.65 \cdot 10^{+16}\right):\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\end{array}
\end{array}
if t < -1.7e156 or 1.65e16 < t Initial program 94.2%
associate-/r/99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 72.3%
associate-/l*85.2%
Simplified85.2%
Taylor expanded in y around inf 75.7%
associate-/l*85.3%
Simplified85.3%
if -1.7e156 < t < 1.65e16Initial program 98.1%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 78.2%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in y around 0 60.0%
sub-neg60.0%
mul-1-neg60.0%
remove-double-neg60.0%
associate-/l*75.8%
Simplified75.8%
Final simplification79.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+144)
(- x a)
(if (<= z -170000.0)
(+ x (/ a (/ z y)))
(if (<= z 78.0) (- x (* a y)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+144) {
tmp = x - a;
} else if (z <= -170000.0) {
tmp = x + (a / (z / y));
} else if (z <= 78.0) {
tmp = x - (a * y);
} 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.05d+144)) then
tmp = x - a
else if (z <= (-170000.0d0)) then
tmp = x + (a / (z / y))
else if (z <= 78.0d0) then
tmp = x - (a * y)
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.05e+144) {
tmp = x - a;
} else if (z <= -170000.0) {
tmp = x + (a / (z / y));
} else if (z <= 78.0) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+144: tmp = x - a elif z <= -170000.0: tmp = x + (a / (z / y)) elif z <= 78.0: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+144) tmp = Float64(x - a); elseif (z <= -170000.0) tmp = Float64(x + Float64(a / Float64(z / y))); elseif (z <= 78.0) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+144) tmp = x - a; elseif (z <= -170000.0) tmp = x + (a / (z / y)); elseif (z <= 78.0) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+144], N[(x - a), $MachinePrecision], If[LessEqual[z, -170000.0], N[(x + N[(a / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 78.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+144}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -170000:\\
\;\;\;\;x + \frac{a}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 78:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.04999999999999998e144 or 78 < z Initial program 93.1%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 83.7%
if -1.04999999999999998e144 < z < -1.7e5Initial program 98.9%
associate-/r/99.9%
*-commutative99.9%
associate-*r/91.8%
div-inv91.8%
Applied egg-rr91.8%
Taylor expanded in y around inf 86.1%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
associate-/l*79.8%
Simplified79.8%
if -1.7e5 < z < 78Initial program 99.0%
associate-/r/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in t around 0 76.0%
associate-/l*75.9%
Simplified75.9%
Taylor expanded in z around 0 70.7%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e+50) (not (<= z 55.0))) (- x a) (- x (* a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+50) || !(z <= 55.0)) {
tmp = x - a;
} else {
tmp = x - (a * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.8d+50)) .or. (.not. (z <= 55.0d0))) then
tmp = x - a
else
tmp = x - (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+50) || !(z <= 55.0)) {
tmp = x - a;
} else {
tmp = x - (a * y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e+50) or not (z <= 55.0): tmp = x - a else: tmp = x - (a * y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e+50) || !(z <= 55.0)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.8e+50) || ~((z <= 55.0))) tmp = x - a; else tmp = x - (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e+50], N[Not[LessEqual[z, 55.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+50} \lor \neg \left(z \leq 55\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot y\\
\end{array}
\end{array}
if z < -3.79999999999999987e50 or 55 < z Initial program 94.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -3.79999999999999987e50 < z < 55Initial program 99.1%
associate-/r/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in t around 0 75.6%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in z around 0 70.8%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4e+50) (- x a) (if (<= z 1.95e-73) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+50) {
tmp = x - a;
} else if (z <= 1.95e-73) {
tmp = x;
} 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 <= (-4d+50)) then
tmp = x - a
else if (z <= 1.95d-73) then
tmp = x
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 <= -4e+50) {
tmp = x - a;
} else if (z <= 1.95e-73) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e+50: tmp = x - a elif z <= 1.95e-73: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+50) tmp = Float64(x - a); elseif (z <= 1.95e-73) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e+50) tmp = x - a; elseif (z <= 1.95e-73) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+50], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.95e-73], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+50}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-73}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.0000000000000003e50 or 1.94999999999999991e-73 < z Initial program 94.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 77.5%
if -4.0000000000000003e50 < z < 1.94999999999999991e-73Initial program 99.0%
associate-/r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 60.9%
Final simplification69.8%
(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 96.8%
associate-/r/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 53.8%
Final simplification53.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 2023275
(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))))