
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (- -1.0 (- t z))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 - (t - z))));
}
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) - (t - z))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 - (t - z))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 - (t - z))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 - Float64(t - z))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 - (t - z)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 - \left(t - z\right)}
\end{array}
Initial program 96.9%
associate-/r/99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e+25) (not (<= z 1600000000.0))) (- x (/ (- z y) (/ z a))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e+25) || !(z <= 1600000000.0)) {
tmp = x - ((z - y) / (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 <= (-4.6d+25)) .or. (.not. (z <= 1600000000.0d0))) then
tmp = x - ((z - y) / (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 <= -4.6e+25) || !(z <= 1600000000.0)) {
tmp = x - ((z - y) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e+25) or not (z <= 1600000000.0): tmp = x - ((z - y) / (z / a)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e+25) || !(z <= 1600000000.0)) tmp = Float64(x - Float64(Float64(z - y) / 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 <= -4.6e+25) || ~((z <= 1600000000.0))) tmp = x - ((z - y) / (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, -4.6e+25], N[Not[LessEqual[z, 1600000000.0]], $MachinePrecision]], N[(x - N[(N[(z - y), $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 -4.6 \cdot 10^{+25} \lor \neg \left(z \leq 1600000000\right):\\
\;\;\;\;x - \frac{z - y}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -4.5999999999999996e25 or 1.6e9 < z Initial program 94.4%
Taylor expanded in z around inf 85.6%
associate-*r/85.6%
neg-mul-185.6%
Simplified85.6%
if -4.5999999999999996e25 < z < 1.6e9Initial program 99.1%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around 0 91.7%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+34) (not (<= z 15200000000.0))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+34) || !(z <= 15200000000.0)) {
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 <= (-2.4d+34)) .or. (.not. (z <= 15200000000.0d0))) 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 <= -2.4e+34) || !(z <= 15200000000.0)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+34) or not (z <= 15200000000.0): 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 <= -2.4e+34) || !(z <= 15200000000.0)) 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 <= -2.4e+34) || ~((z <= 15200000000.0))) 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, -2.4e+34], N[Not[LessEqual[z, 15200000000.0]], $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.4 \cdot 10^{+34} \lor \neg \left(z \leq 15200000000\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.39999999999999987e34 or 1.52e10 < z Initial program 94.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 83.2%
if -2.39999999999999987e34 < z < 1.52e10Initial program 99.1%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around 0 91.0%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.32e+14) (not (<= t 5.9e+35))) (- x (/ a (/ t y))) (- x a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.32e+14) || !(t <= 5.9e+35)) {
tmp = x - (a / (t / 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 ((t <= (-1.32d+14)) .or. (.not. (t <= 5.9d+35))) then
tmp = x - (a / (t / 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 ((t <= -1.32e+14) || !(t <= 5.9e+35)) {
tmp = x - (a / (t / y));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.32e+14) or not (t <= 5.9e+35): tmp = x - (a / (t / y)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.32e+14) || !(t <= 5.9e+35)) tmp = Float64(x - Float64(a / Float64(t / y))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.32e+14) || ~((t <= 5.9e+35))) tmp = x - (a / (t / y)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.32e+14], N[Not[LessEqual[t, 5.9e+35]], $MachinePrecision]], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.32 \cdot 10^{+14} \lor \neg \left(t \leq 5.9 \cdot 10^{+35}\right):\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if t < -1.32e14 or 5.89999999999999985e35 < t Initial program 97.5%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
clear-num99.3%
un-div-inv99.3%
Applied egg-rr99.3%
Taylor expanded in z around 0 88.7%
Taylor expanded in t around inf 88.7%
if -1.32e14 < t < 5.89999999999999985e35Initial program 96.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 69.0%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8500000.0) (not (<= z 1.7e+28))) (- x a) (+ x (/ (* z a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8500000.0) || !(z <= 1.7e+28)) {
tmp = x - a;
} else {
tmp = x + ((z * a) / 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 <= (-8500000.0d0)) .or. (.not. (z <= 1.7d+28))) then
tmp = x - a
else
tmp = x + ((z * a) / 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 <= -8500000.0) || !(z <= 1.7e+28)) {
tmp = x - a;
} else {
tmp = x + ((z * a) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8500000.0) or not (z <= 1.7e+28): tmp = x - a else: tmp = x + ((z * a) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8500000.0) || !(z <= 1.7e+28)) tmp = Float64(x - a); else tmp = Float64(x + Float64(Float64(z * a) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8500000.0) || ~((z <= 1.7e+28))) tmp = x - a; else tmp = x + ((z * a) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8500000.0], N[Not[LessEqual[z, 1.7e+28]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(N[(z * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8500000 \lor \neg \left(z \leq 1.7 \cdot 10^{+28}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot a}{t}\\
\end{array}
\end{array}
if z < -8.5e6 or 1.7e28 < z Initial program 94.4%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 82.6%
if -8.5e6 < z < 1.7e28Initial program 99.1%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in t around inf 71.7%
Taylor expanded in y around 0 61.8%
associate-*r/61.8%
mul-1-neg61.8%
Simplified61.8%
Taylor expanded in a around 0 61.8%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.02e+14) (- x (/ a (/ t y))) (if (<= t 1.15e+35) (- x a) (- x (/ y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e+14) {
tmp = x - (a / (t / y));
} else if (t <= 1.15e+35) {
tmp = x - a;
} else {
tmp = x - (y / (t / 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.02d+14)) then
tmp = x - (a / (t / y))
else if (t <= 1.15d+35) then
tmp = x - a
else
tmp = x - (y / (t / 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.02e+14) {
tmp = x - (a / (t / y));
} else if (t <= 1.15e+35) {
tmp = x - a;
} else {
tmp = x - (y / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.02e+14: tmp = x - (a / (t / y)) elif t <= 1.15e+35: tmp = x - a else: tmp = x - (y / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.02e+14) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (t <= 1.15e+35) tmp = Float64(x - a); else tmp = Float64(x - Float64(y / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.02e+14) tmp = x - (a / (t / y)); elseif (t <= 1.15e+35) tmp = x - a; else tmp = x - (y / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.02e+14], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+35], N[(x - a), $MachinePrecision], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+14}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -1.02e14Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 91.0%
Taylor expanded in t around inf 90.9%
if -1.02e14 < t < 1.1499999999999999e35Initial program 96.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 69.0%
if 1.1499999999999999e35 < t Initial program 98.1%
Taylor expanded in t around inf 89.9%
Taylor expanded in y around inf 87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e-69) (not (<= z 1400000000.0))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e-69) || !(z <= 1400000000.0)) {
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 <= (-2.2d-69)) .or. (.not. (z <= 1400000000.0d0))) 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 <= -2.2e-69) || !(z <= 1400000000.0)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e-69) or not (z <= 1400000000.0): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e-69) || !(z <= 1400000000.0)) 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 <= -2.2e-69) || ~((z <= 1400000000.0))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e-69], N[Not[LessEqual[z, 1400000000.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-69} \lor \neg \left(z \leq 1400000000\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2e-69 or 1.4e9 < z Initial program 95.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 78.6%
if -2.2e-69 < z < 1.4e9Initial program 99.0%
sub-neg99.0%
+-commutative99.0%
associate-/r/99.3%
distribute-rgt-neg-in99.3%
associate-*l/95.9%
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 a around 0 62.9%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5e+242) (not (<= a 1.6e+79))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5e+242) || !(a <= 1.6e+79)) {
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 <= (-5d+242)) .or. (.not. (a <= 1.6d+79))) 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 <= -5e+242) || !(a <= 1.6e+79)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5e+242) or not (a <= 1.6e+79): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5e+242) || !(a <= 1.6e+79)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5e+242) || ~((a <= 1.6e+79))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5e+242], N[Not[LessEqual[a, 1.6e+79]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+242} \lor \neg \left(a \leq 1.6 \cdot 10^{+79}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.0000000000000004e242 or 1.60000000000000001e79 < a Initial program 99.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 50.2%
Taylor expanded in x around 0 40.6%
neg-mul-140.6%
Simplified40.6%
if -5.0000000000000004e242 < a < 1.60000000000000001e79Initial program 96.0%
sub-neg96.0%
+-commutative96.0%
associate-/r/99.6%
distribute-rgt-neg-in99.6%
associate-*l/97.0%
associate-/l*96.5%
fma-define96.5%
distribute-frac-neg96.5%
distribute-neg-frac296.5%
distribute-neg-in96.5%
sub-neg96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in a around 0 69.8%
Final simplification63.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.7%
distribute-rgt-neg-in99.7%
associate-*l/89.7%
associate-/l*97.2%
fma-define97.2%
distribute-frac-neg97.2%
distribute-neg-frac297.2%
distribute-neg-in97.2%
sub-neg97.2%
distribute-neg-in97.2%
remove-double-neg97.2%
+-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in a around 0 59.0%
(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.7%
Simplified99.7%
Taylor expanded in z around inf 64.5%
Taylor expanded in x around 0 17.9%
neg-mul-117.9%
Simplified17.9%
neg-sub017.9%
sub-neg17.9%
add-sqr-sqrt6.0%
sqrt-unprod8.1%
sqr-neg8.1%
sqrt-unprod1.3%
add-sqr-sqrt2.7%
Applied egg-rr2.7%
+-lft-identity2.7%
Simplified2.7%
(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 2024180
(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))))