
(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 9 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 98.1%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.04e-78) (not (<= z 1.4e+54))) (+ 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 <= -1.04e-78) || !(z <= 1.4e+54)) {
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 <= (-1.04d-78)) .or. (.not. (z <= 1.4d+54))) 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 <= -1.04e-78) || !(z <= 1.4e+54)) {
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 <= -1.04e-78) or not (z <= 1.4e+54): 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 <= -1.04e-78) || !(z <= 1.4e+54)) 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 <= -1.04e-78) || ~((z <= 1.4e+54))) 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, -1.04e-78], N[Not[LessEqual[z, 1.4e+54]], $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 -1.04 \cdot 10^{-78} \lor \neg \left(z \leq 1.4 \cdot 10^{+54}\right):\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z - y}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.03999999999999997e-78 or 1.40000000000000008e54 < z Initial program 96.7%
associate-/r/100.0%
Simplified100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 91.4%
if -1.03999999999999997e-78 < z < 1.40000000000000008e54Initial program 99.9%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in z around 0 92.3%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.6e+68) (not (<= z 4.9e+54))) (+ 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 <= -5.6e+68) || !(z <= 4.9e+54)) {
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 <= (-5.6d+68)) .or. (.not. (z <= 4.9d+54))) 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 <= -5.6e+68) || !(z <= 4.9e+54)) {
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 <= -5.6e+68) or not (z <= 4.9e+54): 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 <= -5.6e+68) || !(z <= 4.9e+54)) 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 <= -5.6e+68) || ~((z <= 4.9e+54))) 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, -5.6e+68], N[Not[LessEqual[z, 4.9e+54]], $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 -5.6 \cdot 10^{+68} \lor \neg \left(z \leq 4.9 \cdot 10^{+54}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -5.6e68 or 4.90000000000000001e54 < z Initial program 95.7%
Taylor expanded in z around inf 91.8%
associate-*r/91.8%
neg-mul-191.8%
Simplified91.8%
if -5.6e68 < z < 4.90000000000000001e54Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 89.2%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e+70) (not (<= z 1.6e+34))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e+70) || !(z <= 1.6e+34)) {
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 <= (-6.5d+70)) .or. (.not. (z <= 1.6d+34))) 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 <= -6.5e+70) || !(z <= 1.6e+34)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e+70) or not (z <= 1.6e+34): 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 <= -6.5e+70) || !(z <= 1.6e+34)) 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 <= -6.5e+70) || ~((z <= 1.6e+34))) 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, -6.5e+70], N[Not[LessEqual[z, 1.6e+34]], $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 -6.5 \cdot 10^{+70} \lor \neg \left(z \leq 1.6 \cdot 10^{+34}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -6.49999999999999978e70 or 1.5999999999999999e34 < z Initial program 95.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.3%
if -6.49999999999999978e70 < z < 1.5999999999999999e34Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 88.9%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.6e+139) (not (<= y 1.66e+159))) (* a (/ y (+ -1.0 (- z t)))) (+ x (* a (/ z (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.6e+139) || !(y <= 1.66e+159)) {
tmp = a * (y / (-1.0 + (z - t)));
} else {
tmp = x + (a * (z / (1.0 - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-2.6d+139)) .or. (.not. (y <= 1.66d+159))) then
tmp = a * (y / ((-1.0d0) + (z - t)))
else
tmp = x + (a * (z / (1.0d0 - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.6e+139) || !(y <= 1.66e+159)) {
tmp = a * (y / (-1.0 + (z - t)));
} else {
tmp = x + (a * (z / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.6e+139) or not (y <= 1.66e+159): tmp = a * (y / (-1.0 + (z - t))) else: tmp = x + (a * (z / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.6e+139) || !(y <= 1.66e+159)) tmp = Float64(a * Float64(y / Float64(-1.0 + Float64(z - t)))); else tmp = Float64(x + Float64(a * Float64(z / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.6e+139) || ~((y <= 1.66e+159))) tmp = a * (y / (-1.0 + (z - t))); else tmp = x + (a * (z / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.6e+139], N[Not[LessEqual[y, 1.66e+159]], $MachinePrecision]], N[(a * N[(y / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+139} \lor \neg \left(y \leq 1.66 \cdot 10^{+159}\right):\\
\;\;\;\;a \cdot \frac{y}{-1 + \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{1 - z}\\
\end{array}
\end{array}
if y < -2.60000000000000022e139 or 1.6600000000000001e159 < y Initial program 98.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around inf 62.3%
mul-1-neg62.3%
associate-/l*72.4%
distribute-rgt-neg-in72.4%
associate--l+72.4%
+-commutative72.4%
distribute-neg-frac272.4%
+-commutative72.4%
distribute-neg-in72.4%
metadata-eval72.4%
unsub-neg72.4%
Simplified72.4%
if -2.60000000000000022e139 < y < 1.6600000000000001e159Initial program 98.1%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in t around 0 84.7%
Taylor expanded in y around 0 69.5%
sub-neg69.5%
mul-1-neg69.5%
remove-double-neg69.5%
associate-/l*81.2%
Simplified81.2%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e+69) (not (<= z 1.3e+34))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e+69) || !(z <= 1.3e+34)) {
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 <= (-2.2d+69)) .or. (.not. (z <= 1.3d+34))) 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 <= -2.2e+69) || !(z <= 1.3e+34)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e+69) or not (z <= 1.3e+34): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e+69) || !(z <= 1.3e+34)) 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 <= -2.2e+69) || ~((z <= 1.3e+34))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e+69], N[Not[LessEqual[z, 1.3e+34]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+69} \lor \neg \left(z \leq 1.3 \cdot 10^{+34}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -2.2000000000000002e69 or 1.29999999999999999e34 < z Initial program 95.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.3%
if -2.2000000000000002e69 < z < 1.29999999999999999e34Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 76.3%
Taylor expanded in z around 0 71.2%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.6e+68) (not (<= z 8.8e+33))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.6e+68) || !(z <= 8.8e+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 <= (-5.6d+68)) .or. (.not. (z <= 8.8d+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 <= -5.6e+68) || !(z <= 8.8e+33)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.6e+68) or not (z <= 8.8e+33): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.6e+68) || !(z <= 8.8e+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 <= -5.6e+68) || ~((z <= 8.8e+33))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.6e+68], N[Not[LessEqual[z, 8.8e+33]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+68} \lor \neg \left(z \leq 8.8 \cdot 10^{+33}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.6e68 or 8.79999999999999975e33 < z Initial program 95.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.3%
if -5.6e68 < z < 8.79999999999999975e33Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in x around inf 55.4%
Final simplification67.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.6e+142) (not (<= a 1.05e+104))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.6e+142) || !(a <= 1.05e+104)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-8.6d+142)) .or. (.not. (a <= 1.05d+104))) then
tmp = -a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.6e+142) || !(a <= 1.05e+104)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.6e+142) or not (a <= 1.05e+104): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.6e+142) || !(a <= 1.05e+104)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.6e+142) || ~((a <= 1.05e+104))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.6e+142], N[Not[LessEqual[a, 1.05e+104]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{+142} \lor \neg \left(a \leq 1.05 \cdot 10^{+104}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.60000000000000025e142 or 1.0499999999999999e104 < a Initial program 99.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 38.9%
Taylor expanded in x around 0 34.4%
neg-mul-134.4%
Simplified34.4%
if -8.60000000000000025e142 < a < 1.0499999999999999e104Initial program 97.3%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in x around inf 69.6%
Final simplification58.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in x around inf 52.9%
(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 2024141
(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))))