
(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 (- 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.0%
associate-/r/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6.2e+110)
(- x (/ a (/ t (- y z))))
(if (<= t 3e+195)
(+ x (* a (/ (- y z) (+ z -1.0))))
(+ x (* a (/ (- z y) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e+110) {
tmp = x - (a / (t / (y - z)));
} else if (t <= 3e+195) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-6.2d+110)) then
tmp = x - (a / (t / (y - z)))
else if (t <= 3d+195) then
tmp = x + (a * ((y - z) / (z + (-1.0d0))))
else
tmp = x + (a * ((z - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e+110) {
tmp = x - (a / (t / (y - z)));
} else if (t <= 3e+195) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.2e+110: tmp = x - (a / (t / (y - z))) elif t <= 3e+195: tmp = x + (a * ((y - z) / (z + -1.0))) else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.2e+110) tmp = Float64(x - Float64(a / Float64(t / Float64(y - z)))); elseif (t <= 3e+195) tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.2e+110) tmp = x - (a / (t / (y - z))); elseif (t <= 3e+195) tmp = x + (a * ((y - z) / (z + -1.0))); else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.2e+110], N[(x - N[(a / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+195], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+110}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+195}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if t < -6.20000000000000035e110Initial program 97.0%
associate-/r/99.8%
Simplified99.8%
*-commutative99.8%
clear-num99.7%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 100.0%
if -6.20000000000000035e110 < t < 3.0000000000000001e195Initial program 98.4%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 93.8%
if 3.0000000000000001e195 < t Initial program 95.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 95.2%
Final simplification94.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+19) (not (<= z 1.2))) (+ 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.2e+19) || !(z <= 1.2)) {
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.2d+19)) .or. (.not. (z <= 1.2d0))) 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.2e+19) || !(z <= 1.2)) {
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.2e+19) or not (z <= 1.2): 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.2e+19) || !(z <= 1.2)) 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.2e+19) || ~((z <= 1.2))) 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.2e+19], N[Not[LessEqual[z, 1.2]], $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.2 \cdot 10^{+19} \lor \neg \left(z \leq 1.2\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -5.2e19 or 1.19999999999999996 < z Initial program 97.3%
Taylor expanded in z around inf 90.7%
mul-1-neg90.7%
distribute-neg-frac290.7%
Simplified90.7%
if -5.2e19 < z < 1.19999999999999996Initial program 98.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 92.7%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.4e-106) (not (<= z 1.4e-47))) (+ x (* z (/ a (- 1.0 z)))) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.4e-106) || !(z <= 1.4e-47)) {
tmp = x + (z * (a / (1.0 - z)));
} 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 <= (-8.4d-106)) .or. (.not. (z <= 1.4d-47))) then
tmp = x + (z * (a / (1.0d0 - z)))
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 <= -8.4e-106) || !(z <= 1.4e-47)) {
tmp = x + (z * (a / (1.0 - z)));
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.4e-106) or not (z <= 1.4e-47): tmp = x + (z * (a / (1.0 - z))) else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.4e-106) || !(z <= 1.4e-47)) tmp = Float64(x + Float64(z * Float64(a / Float64(1.0 - z)))); 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 <= -8.4e-106) || ~((z <= 1.4e-47))) tmp = x + (z * (a / (1.0 - z))); else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.4e-106], N[Not[LessEqual[z, 1.4e-47]], $MachinePrecision]], N[(x + N[(z * N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.4 \cdot 10^{-106} \lor \neg \left(z \leq 1.4 \cdot 10^{-47}\right):\\
\;\;\;\;x + z \cdot \frac{a}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -8.40000000000000013e-106 or 1.39999999999999996e-47 < z Initial program 97.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 70.8%
mul-1-neg70.8%
*-commutative70.8%
associate--l+70.8%
+-commutative70.8%
associate-*r/86.7%
distribute-rgt-neg-in86.7%
distribute-neg-frac286.7%
+-commutative86.7%
distribute-neg-in86.7%
metadata-eval86.7%
unsub-neg86.7%
associate--r-86.7%
Simplified86.7%
Taylor expanded in t around 0 82.0%
if -8.40000000000000013e-106 < z < 1.39999999999999996e-47Initial program 99.7%
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 79.4%
Taylor expanded in z around 0 78.6%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.7e-42) (+ x (* a (/ z (- (+ t 1.0) z)))) (if (<= z 1.35) (+ x (* a (/ y (- -1.0 t)))) (+ x (/ (- y z) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e-42) {
tmp = x + (a * (z / ((t + 1.0) - z)));
} else if (z <= 1.35) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (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 (z <= (-1.7d-42)) then
tmp = x + (a * (z / ((t + 1.0d0) - z)))
else if (z <= 1.35d0) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + ((y - z) / (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 (z <= -1.7e-42) {
tmp = x + (a * (z / ((t + 1.0) - z)));
} else if (z <= 1.35) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e-42: tmp = x + (a * (z / ((t + 1.0) - z))) elif z <= 1.35: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + ((y - z) / (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e-42) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t + 1.0) - z)))); elseif (z <= 1.35) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e-42) tmp = x + (a * (z / ((t + 1.0) - z))); elseif (z <= 1.35) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + ((y - z) / (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e-42], N[(x + N[(a * N[(z / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-42}:\\
\;\;\;\;x + a \cdot \frac{z}{\left(t + 1\right) - z}\\
\mathbf{elif}\;z \leq 1.35:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\end{array}
\end{array}
if z < -1.70000000000000011e-42Initial program 95.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 91.2%
mul-1-neg91.2%
associate--l+91.2%
+-commutative91.2%
distribute-neg-frac291.2%
+-commutative91.2%
distribute-neg-in91.2%
metadata-eval91.2%
unsub-neg91.2%
associate--r-91.2%
Simplified91.2%
if -1.70000000000000011e-42 < z < 1.3500000000000001Initial program 98.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 94.7%
if 1.3500000000000001 < z Initial program 99.9%
Taylor expanded in z around inf 97.5%
mul-1-neg97.5%
distribute-neg-frac297.5%
Simplified97.5%
Final simplification94.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-47) (- x (* z (/ a (+ z (- -1.0 t))))) (if (<= z 1.95) (+ x (* a (/ y (- -1.0 t)))) (+ x (/ (- y z) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-47) {
tmp = x - (z * (a / (z + (-1.0 - t))));
} else if (z <= 1.95) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (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 (z <= (-1.35d-47)) then
tmp = x - (z * (a / (z + ((-1.0d0) - t))))
else if (z <= 1.95d0) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + ((y - z) / (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 (z <= -1.35e-47) {
tmp = x - (z * (a / (z + (-1.0 - t))));
} else if (z <= 1.95) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-47: tmp = x - (z * (a / (z + (-1.0 - t)))) elif z <= 1.95: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + ((y - z) / (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-47) tmp = Float64(x - Float64(z * Float64(a / Float64(z + Float64(-1.0 - t))))); elseif (z <= 1.95) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.35e-47) tmp = x - (z * (a / (z + (-1.0 - t)))); elseif (z <= 1.95) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + ((y - z) / (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-47], N[(x - N[(z * N[(a / N[(z + N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-47}:\\
\;\;\;\;x - z \cdot \frac{a}{z + \left(-1 - t\right)}\\
\mathbf{elif}\;z \leq 1.95:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\end{array}
\end{array}
if z < -1.3499999999999999e-47Initial program 95.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 74.7%
mul-1-neg74.7%
*-commutative74.7%
associate--l+74.7%
+-commutative74.7%
associate-*r/88.4%
distribute-rgt-neg-in88.4%
distribute-neg-frac288.4%
+-commutative88.4%
distribute-neg-in88.4%
metadata-eval88.4%
unsub-neg88.4%
associate--r-88.4%
Simplified88.4%
if -1.3499999999999999e-47 < z < 1.94999999999999996Initial program 98.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 94.7%
if 1.94999999999999996 < z Initial program 99.9%
Taylor expanded in z around inf 97.5%
mul-1-neg97.5%
distribute-neg-frac297.5%
Simplified97.5%
Final simplification93.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e+21)
(- x a)
(if (<= z 6.5e-46)
(+ x (* a (/ y (- -1.0 t))))
(+ x (* z (/ a (- 1.0 z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+21) {
tmp = x - a;
} else if (z <= 6.5e-46) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (z * (a / (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 (z <= (-1.6d+21)) then
tmp = x - a
else if (z <= 6.5d-46) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + (z * (a / (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 (z <= -1.6e+21) {
tmp = x - a;
} else if (z <= 6.5e-46) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (z * (a / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+21: tmp = x - a elif z <= 6.5e-46: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (z * (a / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+21) tmp = Float64(x - a); elseif (z <= 6.5e-46) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(z * Float64(a / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e+21) tmp = x - a; elseif (z <= 6.5e-46) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (z * (a / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+21], N[(x - a), $MachinePrecision], If[LessEqual[z, 6.5e-46], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+21}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-46}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{a}{1 - z}\\
\end{array}
\end{array}
if z < -1.6e21Initial program 95.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.2%
if -1.6e21 < z < 6.49999999999999966e-46Initial program 98.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.2%
if 6.49999999999999966e-46 < z Initial program 99.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 68.4%
mul-1-neg68.4%
*-commutative68.4%
associate--l+68.4%
+-commutative68.4%
associate-*r/88.5%
distribute-rgt-neg-in88.5%
distribute-neg-frac288.5%
+-commutative88.5%
distribute-neg-in88.5%
metadata-eval88.5%
unsub-neg88.5%
associate--r-88.5%
Simplified88.5%
Taylor expanded in t around 0 86.5%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e-42) (not (<= z 0.011))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e-42) || !(z <= 0.011)) {
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 <= (-1.7d-42)) .or. (.not. (z <= 0.011d0))) 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 <= -1.7e-42) || !(z <= 0.011)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e-42) or not (z <= 0.011): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e-42) || !(z <= 0.011)) 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 <= -1.7e-42) || ~((z <= 0.011))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e-42], N[Not[LessEqual[z, 0.011]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-42} \lor \neg \left(z \leq 0.011\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.70000000000000011e-42 or 0.010999999999999999 < z Initial program 97.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 83.0%
if -1.70000000000000011e-42 < z < 0.010999999999999999Initial program 98.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 80.1%
Taylor expanded in z around 0 76.5%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -850000000.0) (not (<= z 2.35e-52))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -850000000.0) || !(z <= 2.35e-52)) {
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 <= (-850000000.0d0)) .or. (.not. (z <= 2.35d-52))) 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 <= -850000000.0) || !(z <= 2.35e-52)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -850000000.0) or not (z <= 2.35e-52): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -850000000.0) || !(z <= 2.35e-52)) 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 <= -850000000.0) || ~((z <= 2.35e-52))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -850000000.0], N[Not[LessEqual[z, 2.35e-52]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -850000000 \lor \neg \left(z \leq 2.35 \cdot 10^{-52}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.5e8 or 2.3499999999999999e-52 < z Initial program 97.4%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 83.1%
if -8.5e8 < z < 2.3499999999999999e-52Initial program 98.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 60.4%
Taylor expanded in x around inf 54.6%
Final simplification71.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 98.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around inf 49.8%
Taylor expanded in x around inf 56.2%
(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 2024100
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))