
(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 15 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 96.9%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.4e+156)
(- x a)
(if (<= z -1.15)
(+ x (/ a (/ (+ z -1.0) y)))
(if (<= z 1.05e-17)
(+ x (* a (/ y (- -1.0 t))))
(+ x (/ a (/ (- 1.0 z) z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+156) {
tmp = x - a;
} else if (z <= -1.15) {
tmp = x + (a / ((z + -1.0) / y));
} else if (z <= 1.05e-17) {
tmp = x + (a * (y / (-1.0 - t)));
} 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 (z <= (-2.4d+156)) then
tmp = x - a
else if (z <= (-1.15d0)) then
tmp = x + (a / ((z + (-1.0d0)) / y))
else if (z <= 1.05d-17) then
tmp = x + (a * (y / ((-1.0d0) - t)))
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 (z <= -2.4e+156) {
tmp = x - a;
} else if (z <= -1.15) {
tmp = x + (a / ((z + -1.0) / y));
} else if (z <= 1.05e-17) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a / ((1.0 - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e+156: tmp = x - a elif z <= -1.15: tmp = x + (a / ((z + -1.0) / y)) elif z <= 1.05e-17: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (a / ((1.0 - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e+156) tmp = Float64(x - a); elseif (z <= -1.15) tmp = Float64(x + Float64(a / Float64(Float64(z + -1.0) / y))); elseif (z <= 1.05e-17) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); 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 (z <= -2.4e+156) tmp = x - a; elseif (z <= -1.15) tmp = x + (a / ((z + -1.0) / y)); elseif (z <= 1.05e-17) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (a / ((1.0 - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+156], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.15], N[(x + N[(a / N[(N[(z + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-17], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $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}\;z \leq -2.4 \cdot 10^{+156}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.15:\\
\;\;\;\;x + \frac{a}{\frac{z + -1}{y}}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-17}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\end{array}
\end{array}
if z < -2.4000000000000001e156Initial program 92.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 88.1%
if -2.4000000000000001e156 < z < -1.1499999999999999Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 96.4%
Taylor expanded in y around inf 80.7%
if -1.1499999999999999 < z < 1.04999999999999996e-17Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 92.9%
if 1.04999999999999996e-17 < z Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 91.8%
Taylor expanded in y around 0 80.6%
associate-*r/80.6%
neg-mul-180.6%
sub-neg80.6%
+-commutative80.6%
distribute-neg-in80.6%
remove-double-neg80.6%
metadata-eval80.6%
Simplified80.6%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e+152)
(- x a)
(if (<= z -78.0)
(+ x (/ y (/ z a)))
(if (<= z 2.4e-51) (- x (* a (/ y t))) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+152) {
tmp = x - a;
} else if (z <= -78.0) {
tmp = x + (y / (z / a));
} else if (z <= 2.4e-51) {
tmp = x - (a * (y / 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.8d+152)) then
tmp = x - a
else if (z <= (-78.0d0)) then
tmp = x + (y / (z / a))
else if (z <= 2.4d-51) then
tmp = x - (a * (y / 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.8e+152) {
tmp = x - a;
} else if (z <= -78.0) {
tmp = x + (y / (z / a));
} else if (z <= 2.4e-51) {
tmp = x - (a * (y / t));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+152: tmp = x - a elif z <= -78.0: tmp = x + (y / (z / a)) elif z <= 2.4e-51: tmp = x - (a * (y / t)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+152) tmp = Float64(x - a); elseif (z <= -78.0) tmp = Float64(x + Float64(y / Float64(z / a))); elseif (z <= 2.4e-51) tmp = Float64(x - Float64(a * Float64(y / 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.8e+152) tmp = x - a; elseif (z <= -78.0) tmp = x + (y / (z / a)); elseif (z <= 2.4e-51) tmp = x - (a * (y / t)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+152], N[(x - a), $MachinePrecision], If[LessEqual[z, -78.0], N[(x + N[(y / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-51], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+152}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -78:\\
\;\;\;\;x + \frac{y}{\frac{z}{a}}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-51}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.7999999999999998e152 or 2.4e-51 < z Initial program 95.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.0%
if -4.7999999999999998e152 < z < -78Initial program 99.9%
Taylor expanded in z around inf 94.6%
associate-*r/94.6%
neg-mul-194.6%
Simplified94.6%
Taylor expanded in y around inf 79.0%
if -78 < z < 2.4e-51Initial program 96.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 72.4%
Taylor expanded in y around inf 69.8%
associate-/l*72.2%
Simplified72.2%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.27) (not (<= z 8.5e-18))) (+ x (/ a (/ (- 1.0 z) (- z y)))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.27) || !(z <= 8.5e-18)) {
tmp = x + (a / ((1.0 - z) / (z - y)));
} 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 <= (-0.27d0)) .or. (.not. (z <= 8.5d-18))) then
tmp = x + (a / ((1.0d0 - z) / (z - y)))
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 <= -0.27) || !(z <= 8.5e-18)) {
tmp = x + (a / ((1.0 - z) / (z - y)));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.27) or not (z <= 8.5e-18): tmp = x + (a / ((1.0 - z) / (z - y))) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.27) || !(z <= 8.5e-18)) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / Float64(z - y)))); 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 <= -0.27) || ~((z <= 8.5e-18))) tmp = x + (a / ((1.0 - z) / (z - y))); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.27], N[Not[LessEqual[z, 8.5e-18]], $MachinePrecision]], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(z - y), $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 -0.27 \lor \neg \left(z \leq 8.5 \cdot 10^{-18}\right):\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z - y}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -0.27000000000000002 or 8.4999999999999995e-18 < z Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 94.2%
if -0.27000000000000002 < z < 8.4999999999999995e-18Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 92.9%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -78.0) (not (<= z 2.4e-16))) (+ x (/ (- y z) (/ z a))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -78.0) || !(z <= 2.4e-16)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-78.0d0)) .or. (.not. (z <= 2.4d-16))) then
tmp = x + ((y - z) / (z / a))
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -78.0) || !(z <= 2.4e-16)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -78.0) or not (z <= 2.4e-16): tmp = x + ((y - z) / (z / a)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -78.0) || !(z <= 2.4e-16)) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -78.0) || ~((z <= 2.4e-16))) tmp = x + ((y - z) / (z / a)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -78.0], N[Not[LessEqual[z, 2.4e-16]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -78 \lor \neg \left(z \leq 2.4 \cdot 10^{-16}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -78 or 2.40000000000000005e-16 < z Initial program 96.8%
Taylor expanded in z around inf 91.2%
associate-*r/91.2%
neg-mul-191.2%
Simplified91.2%
if -78 < z < 2.40000000000000005e-16Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 92.3%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+66) (not (<= z 2.4e-16))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+66) || !(z <= 2.4e-16)) {
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 <= (-2d+66)) .or. (.not. (z <= 2.4d-16))) 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 <= -2e+66) || !(z <= 2.4e-16)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+66) or not (z <= 2.4e-16): 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 <= -2e+66) || !(z <= 2.4e-16)) 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 <= -2e+66) || ~((z <= 2.4e-16))) 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, -2e+66], N[Not[LessEqual[z, 2.4e-16]], $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 \cdot 10^{+66} \lor \neg \left(z \leq 2.4 \cdot 10^{-16}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.99999999999999989e66 or 2.40000000000000005e-16 < z Initial program 96.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.0%
if -1.99999999999999989e66 < z < 2.40000000000000005e-16Initial program 97.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 90.7%
Final simplification85.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e+66)
(- x a)
(if (<= z 5.4e-18)
(+ x (* a (/ y (- -1.0 t))))
(+ x (/ a (/ (- 1.0 z) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+66) {
tmp = x - a;
} else if (z <= 5.4e-18) {
tmp = x + (a * (y / (-1.0 - t)));
} 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 (z <= (-3.1d+66)) then
tmp = x - a
else if (z <= 5.4d-18) then
tmp = x + (a * (y / ((-1.0d0) - t)))
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 (z <= -3.1e+66) {
tmp = x - a;
} else if (z <= 5.4e-18) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a / ((1.0 - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e+66: tmp = x - a elif z <= 5.4e-18: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (a / ((1.0 - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+66) tmp = Float64(x - a); elseif (z <= 5.4e-18) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); 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 (z <= -3.1e+66) tmp = x - a; elseif (z <= 5.4e-18) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (a / ((1.0 - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+66], N[(x - a), $MachinePrecision], If[LessEqual[z, 5.4e-18], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $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}\;z \leq -3.1 \cdot 10^{+66}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-18}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z}}\\
\end{array}
\end{array}
if z < -3.10000000000000019e66Initial program 96.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 75.3%
if -3.10000000000000019e66 < z < 5.39999999999999977e-18Initial program 97.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 91.3%
if 5.39999999999999977e-18 < z Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 91.8%
Taylor expanded in y around 0 80.6%
associate-*r/80.6%
neg-mul-180.6%
sub-neg80.6%
+-commutative80.6%
distribute-neg-in80.6%
remove-double-neg80.6%
metadata-eval80.6%
Simplified80.6%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+65) (not (<= z 5.5e-52))) (- x a) (- x (* a (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+65) || !(z <= 5.5e-52)) {
tmp = x - a;
} else {
tmp = x - (a * (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 ((z <= (-7d+65)) .or. (.not. (z <= 5.5d-52))) then
tmp = x - a
else
tmp = x - (a * (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 ((z <= -7e+65) || !(z <= 5.5e-52)) {
tmp = x - a;
} else {
tmp = x - (a * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+65) or not (z <= 5.5e-52): tmp = x - a else: tmp = x - (a * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+65) || !(z <= 5.5e-52)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e+65) || ~((z <= 5.5e-52))) tmp = x - a; else tmp = x - (a * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+65], N[Not[LessEqual[z, 5.5e-52]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+65} \lor \neg \left(z \leq 5.5 \cdot 10^{-52}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -7.0000000000000002e65 or 5.5e-52 < z Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.2%
if -7.0000000000000002e65 < z < 5.5e-52Initial program 97.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 71.8%
Taylor expanded in y around inf 70.3%
associate-/l*72.4%
Simplified72.4%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+34) (not (<= z 2.55e-51))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+34) || !(z <= 2.55e-51)) {
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 <= (-7d+34)) .or. (.not. (z <= 2.55d-51))) 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 <= -7e+34) || !(z <= 2.55e-51)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+34) or not (z <= 2.55e-51): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+34) || !(z <= 2.55e-51)) 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 <= -7e+34) || ~((z <= 2.55e-51))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+34], N[Not[LessEqual[z, 2.55e-51]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+34} \lor \neg \left(z \leq 2.55 \cdot 10^{-51}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -6.99999999999999996e34 or 2.5499999999999999e-51 < z Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.0%
if -6.99999999999999996e34 < z < 2.5499999999999999e-51Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 71.4%
Taylor expanded in z around 0 67.8%
Final simplification71.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e-176) (not (<= z 3.15e-29))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e-176) || !(z <= 3.15e-29)) {
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.5d-176)) .or. (.not. (z <= 3.15d-29))) 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.5e-176) || !(z <= 3.15e-29)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e-176) or not (z <= 3.15e-29): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e-176) || !(z <= 3.15e-29)) 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.5e-176) || ~((z <= 3.15e-29))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e-176], N[Not[LessEqual[z, 3.15e-29]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-176} \lor \neg \left(z \leq 3.15 \cdot 10^{-29}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5e-176 or 3.14999999999999998e-29 < z Initial program 97.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 69.4%
if -1.5e-176 < z < 3.14999999999999998e-29Initial program 96.6%
sub-neg96.6%
+-commutative96.6%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/94.6%
associate-/l*96.6%
fma-define96.6%
distribute-frac-neg96.6%
distribute-neg-frac296.6%
distribute-neg-in96.6%
sub-neg96.6%
distribute-neg-in96.6%
remove-double-neg96.6%
+-commutative96.6%
sub-neg96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in a around 0 52.2%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (<= x -7e-145) x (if (<= x 7e-74) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7e-145) {
tmp = x;
} else if (x <= 7e-74) {
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 (x <= (-7d-145)) then
tmp = x
else if (x <= 7d-74) 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 (x <= -7e-145) {
tmp = x;
} else if (x <= 7e-74) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7e-145: tmp = x elif x <= 7e-74: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7e-145) tmp = x; elseif (x <= 7e-74) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7e-145) tmp = x; elseif (x <= 7e-74) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7e-145], x, If[LessEqual[x, 7e-74], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-145}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-74}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.99999999999999994e-145 or 7.00000000000000029e-74 < x Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/89.1%
associate-/l*99.9%
fma-define99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
distribute-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around 0 67.5%
if -6.99999999999999994e-145 < x < 7.00000000000000029e-74Initial program 91.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 39.5%
Taylor expanded in x around 0 30.3%
neg-mul-130.3%
Simplified30.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.5e+204) (* a (/ y z)) (- x a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.5e+204) {
tmp = a * (y / z);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5.5d+204)) then
tmp = a * (y / z)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.5e+204) {
tmp = a * (y / z);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.5e+204: tmp = a * (y / z) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.5e+204) tmp = Float64(a * Float64(y / z)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.5e+204) tmp = a * (y / z); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.5e+204], N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+204}:\\
\;\;\;\;a \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if y < -5.4999999999999996e204Initial program 89.2%
sub-neg89.2%
+-commutative89.2%
associate-/r/99.7%
distribute-rgt-neg-in99.7%
associate-*l/79.2%
associate-/l*89.0%
fma-define89.0%
distribute-frac-neg89.0%
distribute-neg-frac289.0%
distribute-neg-in89.0%
sub-neg89.0%
distribute-neg-in89.0%
remove-double-neg89.0%
+-commutative89.0%
sub-neg89.0%
metadata-eval89.0%
Simplified89.0%
Taylor expanded in y around inf 68.5%
associate-/l*85.4%
associate--r+85.4%
sub-neg85.4%
metadata-eval85.4%
+-commutative85.4%
associate--l+85.4%
Simplified85.4%
Taylor expanded in z around inf 40.4%
associate-/l*50.4%
Simplified50.4%
if -5.4999999999999996e204 < y Initial program 97.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 65.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.5e+258) (* y (- a)) (- x a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.5e+258) {
tmp = 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 (a <= (-6.5d+258)) then
tmp = 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 (a <= -6.5e+258) {
tmp = y * -a;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.5e+258: tmp = y * -a else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.5e+258) tmp = Float64(y * Float64(-a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.5e+258) tmp = y * -a; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.5e+258], N[(y * (-a)), $MachinePrecision], N[(x - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+258}:\\
\;\;\;\;y \cdot \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if a < -6.50000000000000005e258Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
associate-*l/90.6%
associate-/l*99.8%
fma-define99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
distribute-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 70.8%
associate-/l*70.8%
associate--r+70.8%
sub-neg70.8%
metadata-eval70.8%
+-commutative70.8%
associate--l+70.8%
Simplified70.8%
Taylor expanded in t around 0 61.2%
Taylor expanded in z around 0 60.2%
neg-mul-160.2%
distribute-rgt-neg-in60.2%
Simplified60.2%
if -6.50000000000000005e258 < a Initial program 96.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 62.4%
Final simplification62.3%
(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.9%
sub-neg96.9%
+-commutative96.9%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/88.2%
associate-/l*97.0%
fma-define97.0%
distribute-frac-neg97.0%
distribute-neg-frac297.0%
distribute-neg-in97.0%
sub-neg97.0%
distribute-neg-in97.0%
remove-double-neg97.0%
+-commutative97.0%
sub-neg97.0%
metadata-eval97.0%
Simplified97.0%
Taylor expanded in a around 0 49.7%
(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 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 60.1%
Taylor expanded in x around 0 16.5%
neg-mul-116.5%
Simplified16.5%
neg-sub016.5%
sub-neg16.5%
add-sqr-sqrt8.2%
sqrt-unprod10.4%
sqr-neg10.4%
sqrt-unprod1.9%
add-sqr-sqrt3.3%
Applied egg-rr3.3%
+-lft-identity3.3%
Simplified3.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 2024177
(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))))