
(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 11 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.1%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y (- 1.0 z))))))
(if (<= z -9.4e+63)
(- x a)
(if (<= z -9.5e-85)
t_1
(if (<= z -5.8e-191)
(- x (/ a (/ t y)))
(if (<= z 170000.0) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / (1.0 - z)));
double tmp;
if (z <= -9.4e+63) {
tmp = x - a;
} else if (z <= -9.5e-85) {
tmp = t_1;
} else if (z <= -5.8e-191) {
tmp = x - (a / (t / y));
} else if (z <= 170000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x - (a * (y / (1.0d0 - z)))
if (z <= (-9.4d+63)) then
tmp = x - a
else if (z <= (-9.5d-85)) then
tmp = t_1
else if (z <= (-5.8d-191)) then
tmp = x - (a / (t / y))
else if (z <= 170000.0d0) then
tmp = t_1
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 t_1 = x - (a * (y / (1.0 - z)));
double tmp;
if (z <= -9.4e+63) {
tmp = x - a;
} else if (z <= -9.5e-85) {
tmp = t_1;
} else if (z <= -5.8e-191) {
tmp = x - (a / (t / y));
} else if (z <= 170000.0) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / (1.0 - z))) tmp = 0 if z <= -9.4e+63: tmp = x - a elif z <= -9.5e-85: tmp = t_1 elif z <= -5.8e-191: tmp = x - (a / (t / y)) elif z <= 170000.0: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / Float64(1.0 - z)))) tmp = 0.0 if (z <= -9.4e+63) tmp = Float64(x - a); elseif (z <= -9.5e-85) tmp = t_1; elseif (z <= -5.8e-191) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 170000.0) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / (1.0 - z))); tmp = 0.0; if (z <= -9.4e+63) tmp = x - a; elseif (z <= -9.5e-85) tmp = t_1; elseif (z <= -5.8e-191) tmp = x - (a / (t / y)); elseif (z <= 170000.0) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.4e+63], N[(x - a), $MachinePrecision], If[LessEqual[z, -9.5e-85], t$95$1, If[LessEqual[z, -5.8e-191], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 170000.0], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{1 - z}\\
\mathbf{if}\;z \leq -9.4 \cdot 10^{+63}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-191}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 170000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -9.4000000000000006e63 or 1.7e5 < z Initial program 93.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.3%
if -9.4000000000000006e63 < z < -9.49999999999999964e-85 or -5.7999999999999999e-191 < z < 1.7e5Initial program 99.9%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around 0 83.6%
associate-/l*83.5%
associate-/r/83.5%
Simplified83.5%
Taylor expanded in y around inf 82.3%
expm1-log1p-u71.8%
expm1-udef69.1%
Applied egg-rr69.1%
expm1-def71.8%
expm1-log1p82.3%
associate-*r/82.3%
Simplified82.3%
if -9.49999999999999964e-85 < z < -5.7999999999999999e-191Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 96.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 96.0%
associate-/l*99.8%
Simplified99.8%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e+98) (not (<= t 1.46e+26))) (+ x (/ (- z y) (/ t a))) (+ x (* (/ a (- 1.0 z)) (- z y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+98) || !(t <= 1.46e+26)) {
tmp = x + ((z - y) / (t / a));
} else {
tmp = x + ((a / (1.0 - z)) * (z - y));
}
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 <= (-3.6d+98)) .or. (.not. (t <= 1.46d+26))) then
tmp = x + ((z - y) / (t / a))
else
tmp = x + ((a / (1.0d0 - z)) * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+98) || !(t <= 1.46e+26)) {
tmp = x + ((z - y) / (t / a));
} else {
tmp = x + ((a / (1.0 - z)) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e+98) or not (t <= 1.46e+26): tmp = x + ((z - y) / (t / a)) else: tmp = x + ((a / (1.0 - z)) * (z - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e+98) || !(t <= 1.46e+26)) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); else tmp = Float64(x + Float64(Float64(a / Float64(1.0 - z)) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.6e+98) || ~((t <= 1.46e+26))) tmp = x + ((z - y) / (t / a)); else tmp = x + ((a / (1.0 - z)) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e+98], N[Not[LessEqual[t, 1.46e+26]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+98} \lor \neg \left(t \leq 1.46 \cdot 10^{+26}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{1 - z} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -3.59999999999999981e98 or 1.45999999999999992e26 < t Initial program 98.8%
Taylor expanded in t around inf 93.0%
if -3.59999999999999981e98 < t < 1.45999999999999992e26Initial program 96.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 78.1%
associate-/l*97.0%
associate-/r/93.7%
Simplified93.7%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.86e+99) (not (<= t 6.1e+25))) (+ x (/ (- z y) (/ t a))) (+ x (* a (/ (- z y) (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.86e+99) || !(t <= 6.1e+25)) {
tmp = x + ((z - y) / (t / a));
} else {
tmp = x + (a * ((z - y) / (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 ((t <= (-1.86d+99)) .or. (.not. (t <= 6.1d+25))) then
tmp = x + ((z - y) / (t / a))
else
tmp = x + (a * ((z - y) / (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 ((t <= -1.86e+99) || !(t <= 6.1e+25)) {
tmp = x + ((z - y) / (t / a));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.86e+99) or not (t <= 6.1e+25): tmp = x + ((z - y) / (t / a)) else: tmp = x + (a * ((z - y) / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.86e+99) || !(t <= 6.1e+25)) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.86e+99) || ~((t <= 6.1e+25))) tmp = x + ((z - y) / (t / a)); else tmp = x + (a * ((z - y) / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.86e+99], N[Not[LessEqual[t, 6.1e+25]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.86 \cdot 10^{+99} \lor \neg \left(t \leq 6.1 \cdot 10^{+25}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\end{array}
\end{array}
if t < -1.85999999999999999e99 or 6.1000000000000003e25 < t Initial program 98.8%
Taylor expanded in t around inf 93.0%
if -1.85999999999999999e99 < t < 6.1000000000000003e25Initial program 96.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 97.0%
Final simplification95.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.95e+35)
(- x a)
(if (<= z -1.35e-190)
(- x (/ a (/ t y)))
(if (<= z 6.4e-9) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+35) {
tmp = x - a;
} else if (z <= -1.35e-190) {
tmp = x - (a / (t / y));
} else if (z <= 6.4e-9) {
tmp = x - (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 (z <= (-1.95d+35)) then
tmp = x - a
else if (z <= (-1.35d-190)) then
tmp = x - (a / (t / y))
else if (z <= 6.4d-9) then
tmp = x - (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 (z <= -1.95e+35) {
tmp = x - a;
} else if (z <= -1.35e-190) {
tmp = x - (a / (t / y));
} else if (z <= 6.4e-9) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e+35: tmp = x - a elif z <= -1.35e-190: tmp = x - (a / (t / y)) elif z <= 6.4e-9: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e+35) tmp = Float64(x - a); elseif (z <= -1.35e-190) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 6.4e-9) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e+35) tmp = x - a; elseif (z <= -1.35e-190) tmp = x - (a / (t / y)); elseif (z <= 6.4e-9) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+35], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.35e-190], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-9], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+35}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-190}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-9}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.95e35 or 6.40000000000000023e-9 < z Initial program 93.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.5%
if -1.95e35 < z < -1.35e-190Initial program 99.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 92.7%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in t around inf 87.6%
associate-/l*89.7%
Simplified89.7%
if -1.35e-190 < z < 6.40000000000000023e-9Initial program 99.9%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in z around 0 89.7%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in t around 0 79.9%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+35)
(+ x (- (* y (/ a z)) a))
(if (<= z 6.5e-8)
(- x (* a (/ y (+ t 1.0))))
(- x (/ a (/ (- z) (- y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+35) {
tmp = x + ((y * (a / z)) - a);
} else if (z <= 6.5e-8) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x - (a / (-z / (y - 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.05d+35)) then
tmp = x + ((y * (a / z)) - a)
else if (z <= 6.5d-8) then
tmp = x - (a * (y / (t + 1.0d0)))
else
tmp = x - (a / (-z / (y - 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.05e+35) {
tmp = x + ((y * (a / z)) - a);
} else if (z <= 6.5e-8) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x - (a / (-z / (y - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+35: tmp = x + ((y * (a / z)) - a) elif z <= 6.5e-8: tmp = x - (a * (y / (t + 1.0))) else: tmp = x - (a / (-z / (y - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+35) tmp = Float64(x + Float64(Float64(y * Float64(a / z)) - a)); elseif (z <= 6.5e-8) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); else tmp = Float64(x - Float64(a / Float64(Float64(-z) / Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+35) tmp = x + ((y * (a / z)) - a); elseif (z <= 6.5e-8) tmp = x - (a * (y / (t + 1.0))); else tmp = x - (a / (-z / (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+35], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-8], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a / N[((-z) / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+35}:\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-8}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{-z}{y - z}}\\
\end{array}
\end{array}
if z < -1.0499999999999999e35Initial program 97.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 62.6%
associate-/l*93.1%
associate-/r/90.2%
Simplified90.2%
Taylor expanded in z around inf 90.2%
associate-*r/90.2%
neg-mul-190.2%
Simplified90.2%
Taylor expanded in z around 0 85.0%
mul-1-neg85.0%
unsub-neg85.0%
associate-*l/93.1%
*-commutative93.1%
Simplified93.1%
if -1.0499999999999999e35 < z < 6.49999999999999997e-8Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 92.7%
if 6.49999999999999997e-8 < z Initial program 90.6%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around 0 68.6%
associate-/l*96.6%
associate-/r/88.6%
Simplified88.6%
Taylor expanded in z around inf 87.6%
associate-*r/87.6%
neg-mul-187.6%
Simplified87.6%
associate-*l/67.6%
frac-2neg67.6%
add-sqr-sqrt33.6%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod25.3%
add-sqr-sqrt40.7%
distribute-lft-neg-out40.7%
add-sqr-sqrt15.4%
sqrt-unprod47.8%
sqr-neg47.8%
sqrt-unprod33.9%
add-sqr-sqrt67.6%
Applied egg-rr67.6%
associate-/l*95.5%
Simplified95.5%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.9e+59) (not (<= z 6.5e-8))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.9e+59) || !(z <= 6.5e-8)) {
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 <= (-7.9d+59)) .or. (.not. (z <= 6.5d-8))) 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 <= -7.9e+59) || !(z <= 6.5e-8)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.9e+59) or not (z <= 6.5e-8): 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 <= -7.9e+59) || !(z <= 6.5e-8)) 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 <= -7.9e+59) || ~((z <= 6.5e-8))) 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, -7.9e+59], N[Not[LessEqual[z, 6.5e-8]], $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 -7.9 \cdot 10^{+59} \lor \neg \left(z \leq 6.5 \cdot 10^{-8}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -7.9000000000000001e59 or 6.49999999999999997e-8 < z Initial program 93.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.8%
if -7.9000000000000001e59 < z < 6.49999999999999997e-8Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 91.8%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+35) (not (<= z 6.5e-8))) (+ x (- (* y (/ a z)) a)) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e+35) || !(z <= 6.5e-8)) {
tmp = x + ((y * (a / 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 <= (-1.95d+35)) .or. (.not. (z <= 6.5d-8))) then
tmp = x + ((y * (a / 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 <= -1.95e+35) || !(z <= 6.5e-8)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e+35) or not (z <= 6.5e-8): tmp = x + ((y * (a / z)) - a) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e+35) || !(z <= 6.5e-8)) tmp = Float64(x + Float64(Float64(y * Float64(a / 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 <= -1.95e+35) || ~((z <= 6.5e-8))) tmp = x + ((y * (a / 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, -1.95e+35], N[Not[LessEqual[z, 6.5e-8]], $MachinePrecision]], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $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 -1.95 \cdot 10^{+35} \lor \neg \left(z \leq 6.5 \cdot 10^{-8}\right):\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.95e35 or 6.49999999999999997e-8 < z Initial program 93.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 65.7%
associate-/l*94.9%
associate-/r/89.4%
Simplified89.4%
Taylor expanded in z around inf 88.8%
associate-*r/88.8%
neg-mul-188.8%
Simplified88.8%
Taylor expanded in z around 0 84.1%
mul-1-neg84.1%
unsub-neg84.1%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if -1.95e35 < z < 6.49999999999999997e-8Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 92.7%
Final simplification93.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+59) (not (<= z 6.4e-9))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+59) || !(z <= 6.4e-9)) {
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 <= (-3.5d+59)) .or. (.not. (z <= 6.4d-9))) 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 <= -3.5e+59) || !(z <= 6.4e-9)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+59) or not (z <= 6.4e-9): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+59) || !(z <= 6.4e-9)) 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 <= -3.5e+59) || ~((z <= 6.4e-9))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+59], N[Not[LessEqual[z, 6.4e-9]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+59} \lor \neg \left(z \leq 6.4 \cdot 10^{-9}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -3.5e59 or 6.40000000000000023e-9 < z Initial program 93.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.1%
if -3.5e59 < z < 6.40000000000000023e-9Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 89.8%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in t around 0 77.4%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+34) (not (<= z 1.05e-9))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+34) || !(z <= 1.05e-9)) {
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 <= (-8.2d+34)) .or. (.not. (z <= 1.05d-9))) 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 <= -8.2e+34) || !(z <= 1.05e-9)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+34) or not (z <= 1.05e-9): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+34) || !(z <= 1.05e-9)) 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 <= -8.2e+34) || ~((z <= 1.05e-9))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+34], N[Not[LessEqual[z, 1.05e-9]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+34} \lor \neg \left(z \leq 1.05 \cdot 10^{-9}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.1999999999999997e34 or 1.0500000000000001e-9 < z Initial program 93.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.5%
if -8.1999999999999997e34 < z < 1.0500000000000001e-9Initial program 99.9%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 90.6%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in x around inf 65.3%
Final simplification72.8%
(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.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around 0 69.9%
associate-/l*71.3%
Simplified71.3%
Taylor expanded in x around inf 56.7%
Final simplification56.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 2024036
(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))))