
(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 12 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.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y (- 1.0 z))))) (t_2 (+ x (* a (/ (- z y) t)))))
(if (<= t -8.5e+36)
t_2
(if (<= t -1.85e-266)
t_1
(if (<= t -1.2e-295)
(- x a)
(if (<= t 5.5e+18)
t_1
(if (<= t 4.4e+153) (+ x (/ z (/ (- 1.0 z) a))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / (1.0 - z)));
double t_2 = x + (a * ((z - y) / t));
double tmp;
if (t <= -8.5e+36) {
tmp = t_2;
} else if (t <= -1.85e-266) {
tmp = t_1;
} else if (t <= -1.2e-295) {
tmp = x - a;
} else if (t <= 5.5e+18) {
tmp = t_1;
} else if (t <= 4.4e+153) {
tmp = x + (z / ((1.0 - z) / a));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x - (a * (y / (1.0d0 - z)))
t_2 = x + (a * ((z - y) / t))
if (t <= (-8.5d+36)) then
tmp = t_2
else if (t <= (-1.85d-266)) then
tmp = t_1
else if (t <= (-1.2d-295)) then
tmp = x - a
else if (t <= 5.5d+18) then
tmp = t_1
else if (t <= 4.4d+153) then
tmp = x + (z / ((1.0d0 - z) / a))
else
tmp = t_2
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 t_2 = x + (a * ((z - y) / t));
double tmp;
if (t <= -8.5e+36) {
tmp = t_2;
} else if (t <= -1.85e-266) {
tmp = t_1;
} else if (t <= -1.2e-295) {
tmp = x - a;
} else if (t <= 5.5e+18) {
tmp = t_1;
} else if (t <= 4.4e+153) {
tmp = x + (z / ((1.0 - z) / a));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / (1.0 - z))) t_2 = x + (a * ((z - y) / t)) tmp = 0 if t <= -8.5e+36: tmp = t_2 elif t <= -1.85e-266: tmp = t_1 elif t <= -1.2e-295: tmp = x - a elif t <= 5.5e+18: tmp = t_1 elif t <= 4.4e+153: tmp = x + (z / ((1.0 - z) / a)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / Float64(1.0 - z)))) t_2 = Float64(x + Float64(a * Float64(Float64(z - y) / t))) tmp = 0.0 if (t <= -8.5e+36) tmp = t_2; elseif (t <= -1.85e-266) tmp = t_1; elseif (t <= -1.2e-295) tmp = Float64(x - a); elseif (t <= 5.5e+18) tmp = t_1; elseif (t <= 4.4e+153) tmp = Float64(x + Float64(z / Float64(Float64(1.0 - z) / a))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / (1.0 - z))); t_2 = x + (a * ((z - y) / t)); tmp = 0.0; if (t <= -8.5e+36) tmp = t_2; elseif (t <= -1.85e-266) tmp = t_1; elseif (t <= -1.2e-295) tmp = x - a; elseif (t <= 5.5e+18) tmp = t_1; elseif (t <= 4.4e+153) tmp = x + (z / ((1.0 - z) / a)); else tmp = t_2; 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]}, Block[{t$95$2 = N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.5e+36], t$95$2, If[LessEqual[t, -1.85e-266], t$95$1, If[LessEqual[t, -1.2e-295], N[(x - a), $MachinePrecision], If[LessEqual[t, 5.5e+18], t$95$1, If[LessEqual[t, 4.4e+153], N[(x + N[(z / N[(N[(1.0 - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{1 - z}\\
t_2 := x + a \cdot \frac{z - y}{t}\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-266}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-295}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;x + \frac{z}{\frac{1 - z}{a}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -8.50000000000000014e36 or 4.3999999999999999e153 < t Initial program 96.5%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 87.1%
if -8.50000000000000014e36 < t < -1.8500000000000001e-266 or -1.1999999999999999e-295 < t < 5.5e18Initial program 99.8%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 99.5%
Taylor expanded in y around inf 81.3%
if -1.8500000000000001e-266 < t < -1.1999999999999999e-295Initial program 82.0%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 82.5%
if 5.5e18 < t < 4.3999999999999999e153Initial program 99.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 80.0%
Taylor expanded in y around 0 62.0%
sub-neg62.0%
mul-1-neg62.0%
remove-double-neg62.0%
*-commutative62.0%
associate-/l*75.9%
Simplified75.9%
Final simplification82.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= z -3.4e+29)
(- x a)
(if (<= z -2.9e-161)
t_1
(if (<= z 3.5e-25) (- x (* a y)) (if (<= z 5.2e+46) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (z <= -3.4e+29) {
tmp = x - a;
} else if (z <= -2.9e-161) {
tmp = t_1;
} else if (z <= 3.5e-25) {
tmp = x - (a * y);
} else if (z <= 5.2e+46) {
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 / (t / y))
if (z <= (-3.4d+29)) then
tmp = x - a
else if (z <= (-2.9d-161)) then
tmp = t_1
else if (z <= 3.5d-25) then
tmp = x - (a * y)
else if (z <= 5.2d+46) 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 / (t / y));
double tmp;
if (z <= -3.4e+29) {
tmp = x - a;
} else if (z <= -2.9e-161) {
tmp = t_1;
} else if (z <= 3.5e-25) {
tmp = x - (a * y);
} else if (z <= 5.2e+46) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if z <= -3.4e+29: tmp = x - a elif z <= -2.9e-161: tmp = t_1 elif z <= 3.5e-25: tmp = x - (a * y) elif z <= 5.2e+46: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (z <= -3.4e+29) tmp = Float64(x - a); elseif (z <= -2.9e-161) tmp = t_1; elseif (z <= 3.5e-25) tmp = Float64(x - Float64(a * y)); elseif (z <= 5.2e+46) 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 / (t / y)); tmp = 0.0; if (z <= -3.4e+29) tmp = x - a; elseif (z <= -2.9e-161) tmp = t_1; elseif (z <= 3.5e-25) tmp = x - (a * y); elseif (z <= 5.2e+46) 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[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+29], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.9e-161], t$95$1, If[LessEqual[z, 3.5e-25], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+46], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+29}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-161}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-25}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -3.39999999999999981e29 or 5.20000000000000027e46 < z Initial program 95.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 77.7%
if -3.39999999999999981e29 < z < -2.9e-161 or 3.5000000000000002e-25 < z < 5.20000000000000027e46Initial program 99.8%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 73.6%
Taylor expanded in y around inf 74.6%
*-commutative74.6%
associate-/l*80.1%
Simplified80.1%
if -2.9e-161 < z < 3.5000000000000002e-25Initial program 99.9%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 82.7%
Taylor expanded in z around 0 80.4%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e+124) (not (<= t 1.15e+129))) (+ x (* a (/ (- z y) t))) (+ x (* a (/ (- z y) (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e+124) || !(t <= 1.15e+129)) {
tmp = x + (a * ((z - y) / t));
} 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 <= (-3.1d+124)) .or. (.not. (t <= 1.15d+129))) then
tmp = x + (a * ((z - y) / t))
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 <= -3.1e+124) || !(t <= 1.15e+129)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.1e+124) or not (t <= 1.15e+129): tmp = x + (a * ((z - y) / t)) else: tmp = x + (a * ((z - y) / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e+124) || !(t <= 1.15e+129)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); 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 <= -3.1e+124) || ~((t <= 1.15e+129))) tmp = x + (a * ((z - y) / t)); else tmp = x + (a * ((z - y) / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.1e+124], N[Not[LessEqual[t, 1.15e+129]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $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 -3.1 \cdot 10^{+124} \lor \neg \left(t \leq 1.15 \cdot 10^{+129}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\end{array}
\end{array}
if t < -3.1000000000000002e124 or 1.14999999999999995e129 < t Initial program 96.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 88.6%
if -3.1000000000000002e124 < t < 1.14999999999999995e129Initial program 98.7%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 95.5%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+33) (not (<= z 1.48e+34))) (+ x (/ (- z y) (/ (- z) a))) (- x (/ a (/ (+ t 1.0) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+33) || !(z <= 1.48e+34)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (a / ((t + 1.0) / 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 ((z <= (-9.2d+33)) .or. (.not. (z <= 1.48d+34))) then
tmp = x + ((z - y) / (-z / a))
else
tmp = x - (a / ((t + 1.0d0) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+33) || !(z <= 1.48e+34)) {
tmp = x + ((z - y) / (-z / a));
} else {
tmp = x - (a / ((t + 1.0) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+33) or not (z <= 1.48e+34): tmp = x + ((z - y) / (-z / a)) else: tmp = x - (a / ((t + 1.0) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+33) || !(z <= 1.48e+34)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); else tmp = Float64(x - Float64(a / Float64(Float64(t + 1.0) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.2e+33) || ~((z <= 1.48e+34))) tmp = x + ((z - y) / (-z / a)); else tmp = x - (a / ((t + 1.0) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e+33], N[Not[LessEqual[z, 1.48e+34]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a / N[(N[(t + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+33} \lor \neg \left(z \leq 1.48 \cdot 10^{+34}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\
\end{array}
\end{array}
if z < -9.20000000000000042e33 or 1.4799999999999999e34 < z Initial program 95.9%
Taylor expanded in z around inf 86.9%
mul-1-neg86.9%
distribute-neg-frac86.9%
Simplified86.9%
if -9.20000000000000042e33 < z < 1.4799999999999999e34Initial program 99.9%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around 0 89.4%
associate-/l*94.3%
Simplified94.3%
Final simplification90.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.3e+30)
(+ x (/ a (/ (+ (- t z) 1.0) z)))
(if (<= z 1.1e+34)
(- x (/ a (/ (+ t 1.0) y)))
(+ x (/ (- z y) (/ (- z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+30) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else if (z <= 1.1e+34) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x + ((z - y) / (-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 <= (-2.3d+30)) then
tmp = x + (a / (((t - z) + 1.0d0) / z))
else if (z <= 1.1d+34) then
tmp = x - (a / ((t + 1.0d0) / y))
else
tmp = x + ((z - y) / (-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 <= -2.3e+30) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else if (z <= 1.1e+34) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x + ((z - y) / (-z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+30: tmp = x + (a / (((t - z) + 1.0) / z)) elif z <= 1.1e+34: tmp = x - (a / ((t + 1.0) / y)) else: tmp = x + ((z - y) / (-z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+30) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / z))); elseif (z <= 1.1e+34) tmp = Float64(x - Float64(a / Float64(Float64(t + 1.0) / y))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e+30) tmp = x + (a / (((t - z) + 1.0) / z)); elseif (z <= 1.1e+34) tmp = x - (a / ((t + 1.0) / y)); else tmp = x + ((z - y) / (-z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+30], N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+34], N[(x - N[(a / N[(N[(t + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+30}:\\
\;\;\;\;x + \frac{a}{\frac{\left(t - z\right) + 1}{z}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+34}:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\end{array}
\end{array}
if z < -2.3e30Initial program 95.0%
clear-num95.0%
associate-/r/94.8%
Applied egg-rr94.8%
Taylor expanded in y around 0 64.1%
sub-neg64.1%
mul-1-neg64.1%
remove-double-neg64.1%
associate-/l*86.5%
associate--l+86.5%
Simplified86.5%
if -2.3e30 < z < 1.1000000000000001e34Initial program 99.9%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around 0 89.4%
associate-/l*94.3%
Simplified94.3%
if 1.1000000000000001e34 < z Initial program 96.7%
Taylor expanded in z around inf 91.1%
mul-1-neg91.1%
distribute-neg-frac91.1%
Simplified91.1%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.6e+87) (- x a) (if (<= z 1e+61) (- x (* a (/ y (- 1.0 z)))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+87) {
tmp = x - a;
} else if (z <= 1e+61) {
tmp = x - (a * (y / (1.0 - 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 <= (-6.6d+87)) then
tmp = x - a
else if (z <= 1d+61) then
tmp = x - (a * (y / (1.0d0 - 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 <= -6.6e+87) {
tmp = x - a;
} else if (z <= 1e+61) {
tmp = x - (a * (y / (1.0 - z)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+87: tmp = x - a elif z <= 1e+61: tmp = x - (a * (y / (1.0 - z))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+87) tmp = Float64(x - a); elseif (z <= 1e+61) tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 - z)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.6e+87) tmp = x - a; elseif (z <= 1e+61) tmp = x - (a * (y / (1.0 - z))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+87], N[(x - a), $MachinePrecision], If[LessEqual[z, 1e+61], N[(x - N[(a * N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+87}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 10^{+61}:\\
\;\;\;\;x - a \cdot \frac{y}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.6000000000000003e87 or 9.99999999999999949e60 < z Initial program 95.4%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 79.1%
if -6.6000000000000003e87 < z < 9.99999999999999949e60Initial program 99.9%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 75.6%
Taylor expanded in y around inf 75.2%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.1e+32) (- x a) (if (<= z 1.2e+34) (- x (/ a (/ (+ t 1.0) y))) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.1e+32) {
tmp = x - a;
} else if (z <= 1.2e+34) {
tmp = x - (a / ((t + 1.0) / 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 (z <= (-6.1d+32)) then
tmp = x - a
else if (z <= 1.2d+34) then
tmp = x - (a / ((t + 1.0d0) / 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 (z <= -6.1e+32) {
tmp = x - a;
} else if (z <= 1.2e+34) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.1e+32: tmp = x - a elif z <= 1.2e+34: tmp = x - (a / ((t + 1.0) / y)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.1e+32) tmp = Float64(x - a); elseif (z <= 1.2e+34) tmp = Float64(x - Float64(a / Float64(Float64(t + 1.0) / y))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.1e+32) tmp = x - a; elseif (z <= 1.2e+34) tmp = x - (a / ((t + 1.0) / y)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.1e+32], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.2e+34], N[(x - N[(a / N[(N[(t + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.1 \cdot 10^{+32}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+34}:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.10000000000000027e32 or 1.19999999999999993e34 < z Initial program 95.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 77.4%
if -6.10000000000000027e32 < z < 1.19999999999999993e34Initial program 99.9%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around 0 89.4%
associate-/l*94.3%
Simplified94.3%
Final simplification86.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.6e-23)
(- x a)
(if (<= z 3.7e-184)
x
(if (<= z 3.9e-123) (* a (- y)) (if (<= z 1.35e+34) x (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-23) {
tmp = x - a;
} else if (z <= 3.7e-184) {
tmp = x;
} else if (z <= 3.9e-123) {
tmp = a * -y;
} else if (z <= 1.35e+34) {
tmp = x;
} 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.6d-23)) then
tmp = x - a
else if (z <= 3.7d-184) then
tmp = x
else if (z <= 3.9d-123) then
tmp = a * -y
else if (z <= 1.35d+34) then
tmp = x
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.6e-23) {
tmp = x - a;
} else if (z <= 3.7e-184) {
tmp = x;
} else if (z <= 3.9e-123) {
tmp = a * -y;
} else if (z <= 1.35e+34) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-23: tmp = x - a elif z <= 3.7e-184: tmp = x elif z <= 3.9e-123: tmp = a * -y elif z <= 1.35e+34: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-23) tmp = Float64(x - a); elseif (z <= 3.7e-184) tmp = x; elseif (z <= 3.9e-123) tmp = Float64(a * Float64(-y)); elseif (z <= 1.35e+34) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e-23) tmp = x - a; elseif (z <= 3.7e-184) tmp = x; elseif (z <= 3.9e-123) tmp = a * -y; elseif (z <= 1.35e+34) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-23], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.7e-184], x, If[LessEqual[z, 3.9e-123], N[(a * (-y)), $MachinePrecision], If[LessEqual[z, 1.35e+34], x, N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-23}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-184}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-123}:\\
\;\;\;\;a \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.59999999999999988e-23 or 1.35e34 < z Initial program 96.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 75.8%
if -1.59999999999999988e-23 < z < 3.6999999999999999e-184 or 3.89999999999999976e-123 < z < 1.35e34Initial program 99.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 65.3%
if 3.6999999999999999e-184 < z < 3.89999999999999976e-123Initial program 99.7%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 75.6%
associate-*r/75.6%
*-commutative75.6%
associate-*r*75.6%
mul-1-neg75.6%
associate--l+75.6%
Simplified75.6%
Taylor expanded in z around 0 75.6%
associate-*r/75.6%
mul-1-neg75.6%
*-commutative75.6%
distribute-rgt-neg-in75.6%
Simplified75.6%
Taylor expanded in t around 0 67.3%
associate-*r*67.3%
mul-1-neg67.3%
Simplified67.3%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e-10) (- x a) (if (<= z 9.9e+33) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-10) {
tmp = x - a;
} else if (z <= 9.9e+33) {
tmp = x - (a * 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 (z <= (-3.5d-10)) then
tmp = x - a
else if (z <= 9.9d+33) then
tmp = x - (a * 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 (z <= -3.5e-10) {
tmp = x - a;
} else if (z <= 9.9e+33) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e-10: tmp = x - a elif z <= 9.9e+33: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e-10) tmp = Float64(x - a); elseif (z <= 9.9e+33) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e-10) tmp = x - a; elseif (z <= 9.9e+33) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e-10], N[(x - a), $MachinePrecision], If[LessEqual[z, 9.9e+33], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-10}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 9.9 \cdot 10^{+33}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -3.4999999999999998e-10 or 9.89999999999999986e33 < z Initial program 96.1%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 76.3%
if -3.4999999999999998e-10 < z < 9.89999999999999986e33Initial program 99.9%
associate-/r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 76.5%
Taylor expanded in z around 0 74.9%
Final simplification75.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-23) (- x a) (if (<= z 1.55e+34) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-23) {
tmp = x - a;
} else if (z <= 1.55e+34) {
tmp = x;
} 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.6d-23)) then
tmp = x - a
else if (z <= 1.55d+34) then
tmp = x
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.6e-23) {
tmp = x - a;
} else if (z <= 1.55e+34) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-23: tmp = x - a elif z <= 1.55e+34: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-23) tmp = Float64(x - a); elseif (z <= 1.55e+34) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e-23) tmp = x - a; elseif (z <= 1.55e+34) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-23], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.55e+34], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-23}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.59999999999999988e-23 or 1.54999999999999989e34 < z Initial program 96.2%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 75.8%
if -1.59999999999999988e-23 < z < 1.54999999999999989e34Initial program 99.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 60.7%
Final simplification68.7%
(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.9%
associate-/r/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 53.9%
Final simplification53.9%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (((y - z) / ((t - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2023268
(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))))