
(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 8 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.2%
associate-/r/99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.9e-8)
(- x a)
(if (<= z 2.7e-211)
(- x (* y a))
(if (<= z 1.42e+103)
(- x (/ a (/ t y)))
(if (<= z 1.5e+114) (/ a (/ z (- y z))) (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-8) {
tmp = x - a;
} else if (z <= 2.7e-211) {
tmp = x - (y * a);
} else if (z <= 1.42e+103) {
tmp = x - (a / (t / y));
} else if (z <= 1.5e+114) {
tmp = a / (z / (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 (z <= (-1.9d-8)) then
tmp = x - a
else if (z <= 2.7d-211) then
tmp = x - (y * a)
else if (z <= 1.42d+103) then
tmp = x - (a / (t / y))
else if (z <= 1.5d+114) then
tmp = a / (z / (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 (z <= -1.9e-8) {
tmp = x - a;
} else if (z <= 2.7e-211) {
tmp = x - (y * a);
} else if (z <= 1.42e+103) {
tmp = x - (a / (t / y));
} else if (z <= 1.5e+114) {
tmp = a / (z / (y - z));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-8: tmp = x - a elif z <= 2.7e-211: tmp = x - (y * a) elif z <= 1.42e+103: tmp = x - (a / (t / y)) elif z <= 1.5e+114: tmp = a / (z / (y - z)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-8) tmp = Float64(x - a); elseif (z <= 2.7e-211) tmp = Float64(x - Float64(y * a)); elseif (z <= 1.42e+103) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 1.5e+114) tmp = Float64(a / Float64(z / 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 (z <= -1.9e-8) tmp = x - a; elseif (z <= 2.7e-211) tmp = x - (y * a); elseif (z <= 1.42e+103) tmp = x - (a / (t / y)); elseif (z <= 1.5e+114) tmp = a / (z / (y - z)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-8], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.7e-211], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e+103], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+114], N[(a / N[(z / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-8}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-211}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+103}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+114}:\\
\;\;\;\;\frac{a}{\frac{z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.90000000000000014e-8 or 1.5e114 < z Initial program 95.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.1%
if -1.90000000000000014e-8 < z < 2.6999999999999999e-211Initial program 99.8%
Taylor expanded in t around 0 82.4%
Taylor expanded in z around 0 76.2%
if 2.6999999999999999e-211 < z < 1.42e103Initial program 96.8%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in t around inf 60.9%
Taylor expanded in y around inf 64.8%
*-commutative64.8%
clear-num64.8%
un-div-inv64.8%
Applied egg-rr64.8%
if 1.42e103 < z < 1.5e114Initial program 80.6%
Taylor expanded in z around inf 80.6%
mul-1-neg80.6%
distribute-neg-frac80.6%
Simplified80.6%
Taylor expanded in x around 0 81.7%
associate-/l*99.7%
Simplified99.7%
Final simplification74.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e+164) (not (<= t 4e+69))) (+ x (/ (- z y) (/ t a))) (+ x (/ (- z y) (/ (- 1.0 z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+164) || !(t <= 4e+69)) {
tmp = x + ((z - y) / (t / a));
} else {
tmp = x + ((z - y) / ((1.0 - 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 ((t <= (-1.6d+164)) .or. (.not. (t <= 4d+69))) then
tmp = x + ((z - y) / (t / a))
else
tmp = x + ((z - y) / ((1.0d0 - 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 ((t <= -1.6e+164) || !(t <= 4e+69)) {
tmp = x + ((z - y) / (t / a));
} else {
tmp = x + ((z - y) / ((1.0 - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e+164) or not (t <= 4e+69): tmp = x + ((z - y) / (t / a)) else: tmp = x + ((z - y) / ((1.0 - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e+164) || !(t <= 4e+69)) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(1.0 - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.6e+164) || ~((t <= 4e+69))) tmp = x + ((z - y) / (t / a)); else tmp = x + ((z - y) / ((1.0 - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e+164], N[Not[LessEqual[t, 4e+69]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(1.0 - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+164} \lor \neg \left(t \leq 4 \cdot 10^{+69}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{1 - z}{a}}\\
\end{array}
\end{array}
if t < -1.5999999999999999e164 or 4.0000000000000003e69 < t Initial program 98.7%
Taylor expanded in t around inf 89.8%
if -1.5999999999999999e164 < t < 4.0000000000000003e69Initial program 96.5%
Taylor expanded in t around 0 93.6%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.35e+41) (not (<= z 280000.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 <= -2.35e+41) || !(z <= 280000.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 <= (-2.35d+41)) .or. (.not. (z <= 280000.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 <= -2.35e+41) || !(z <= 280000.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 <= -2.35e+41) or not (z <= 280000.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 <= -2.35e+41) || !(z <= 280000.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 <= -2.35e+41) || ~((z <= 280000.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, -2.35e+41], N[Not[LessEqual[z, 280000.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 -2.35 \cdot 10^{+41} \lor \neg \left(z \leq 280000\right):\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -2.35e41 or 2.8e5 < z Initial program 95.6%
Taylor expanded in z around inf 83.5%
mul-1-neg83.5%
distribute-neg-frac83.5%
Simplified83.5%
if -2.35e41 < z < 2.8e5Initial program 98.5%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in z around 0 89.6%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+127) (not (<= z 9.5e+78))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+127) || !(z <= 9.5e+78)) {
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 <= (-4.8d+127)) .or. (.not. (z <= 9.5d+78))) 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 <= -4.8e+127) || !(z <= 9.5e+78)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+127) or not (z <= 9.5e+78): 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 <= -4.8e+127) || !(z <= 9.5e+78)) 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 <= -4.8e+127) || ~((z <= 9.5e+78))) 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, -4.8e+127], N[Not[LessEqual[z, 9.5e+78]], $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 -4.8 \cdot 10^{+127} \lor \neg \left(z \leq 9.5 \cdot 10^{+78}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -4.8000000000000004e127 or 9.5000000000000006e78 < z Initial program 94.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.3%
if -4.8000000000000004e127 < z < 9.5000000000000006e78Initial program 98.7%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 85.0%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e-8) (not (<= z 7.4e-31))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e-8) || !(z <= 7.4e-31)) {
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 <= (-2d-8)) .or. (.not. (z <= 7.4d-31))) 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 <= -2e-8) || !(z <= 7.4e-31)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e-8) or not (z <= 7.4e-31): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e-8) || !(z <= 7.4e-31)) 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 <= -2e-8) || ~((z <= 7.4e-31))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e-8], N[Not[LessEqual[z, 7.4e-31]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-8} \lor \neg \left(z \leq 7.4 \cdot 10^{-31}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -2e-8 or 7.3999999999999996e-31 < z Initial program 95.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 75.0%
if -2e-8 < z < 7.3999999999999996e-31Initial program 98.4%
Taylor expanded in t around 0 79.1%
Taylor expanded in z around 0 70.5%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+41) (not (<= z 6.5e-77))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+41) || !(z <= 6.5e-77)) {
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.35d+41)) .or. (.not. (z <= 6.5d-77))) 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.35e+41) || !(z <= 6.5e-77)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e+41) or not (z <= 6.5e-77): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+41) || !(z <= 6.5e-77)) 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.35e+41) || ~((z <= 6.5e-77))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+41], N[Not[LessEqual[z, 6.5e-77]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+41} \lor \neg \left(z \leq 6.5 \cdot 10^{-77}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.35e41 or 6.4999999999999999e-77 < z Initial program 96.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.9%
if -1.35e41 < z < 6.4999999999999999e-77Initial program 98.3%
associate-/r/98.9%
Simplified98.9%
Taylor expanded in x around inf 55.8%
Final simplification64.5%
(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.2%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in x around inf 52.0%
Final simplification52.0%
(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 2024021
(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))))