
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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 - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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 - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 84.7%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in y around 0 84.7%
associate-*r/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e-56) (not (<= z 2.1e-11))) (+ x (* z (/ y (- z a)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e-56) || !(z <= 2.1e-11)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y / (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 <= (-1.02d-56)) .or. (.not. (z <= 2.1d-11))) then
tmp = x + (z * (y / (z - a)))
else
tmp = x + (y / (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 <= -1.02e-56) || !(z <= 2.1e-11)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e-56) or not (z <= 2.1e-11): tmp = x + (z * (y / (z - a))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e-56) || !(z <= 2.1e-11)) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.02e-56) || ~((z <= 2.1e-11))) tmp = x + (z * (y / (z - a))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e-56], N[Not[LessEqual[z, 2.1e-11]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-56} \lor \neg \left(z \leq 2.1 \cdot 10^{-11}\right):\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.02e-56 or 2.0999999999999999e-11 < z Initial program 77.0%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around 0 64.9%
associate-*l/78.7%
*-commutative78.7%
Simplified78.7%
if -1.02e-56 < z < 2.0999999999999999e-11Initial program 94.0%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around 0 94.0%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around 0 85.4%
clear-num85.4%
un-div-inv87.1%
Applied egg-rr87.1%
Final simplification82.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -52000000000.0) (not (<= z 18500.0))) (+ x (* (- z t) (/ y z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -52000000000.0) || !(z <= 18500.0)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (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 <= (-52000000000.0d0)) .or. (.not. (z <= 18500.0d0))) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (y / (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 <= -52000000000.0) || !(z <= 18500.0)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -52000000000.0) or not (z <= 18500.0): tmp = x + ((z - t) * (y / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -52000000000.0) || !(z <= 18500.0)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -52000000000.0) || ~((z <= 18500.0))) tmp = x + ((z - t) * (y / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -52000000000.0], N[Not[LessEqual[z, 18500.0]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -52000000000 \lor \neg \left(z \leq 18500\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -5.2e10 or 18500 < z Initial program 73.9%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in z around inf 83.7%
if -5.2e10 < z < 18500Initial program 94.8%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around 0 94.8%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around 0 82.9%
clear-num82.9%
un-div-inv84.3%
Applied egg-rr84.3%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -220000000000.0) (not (<= z 1.48e-5))) (+ x (- y (* t (/ y z)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -220000000000.0) || !(z <= 1.48e-5)) {
tmp = x + (y - (t * (y / z)));
} else {
tmp = x + (y / (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 <= (-220000000000.0d0)) .or. (.not. (z <= 1.48d-5))) then
tmp = x + (y - (t * (y / z)))
else
tmp = x + (y / (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 <= -220000000000.0) || !(z <= 1.48e-5)) {
tmp = x + (y - (t * (y / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -220000000000.0) or not (z <= 1.48e-5): tmp = x + (y - (t * (y / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -220000000000.0) || !(z <= 1.48e-5)) tmp = Float64(x + Float64(y - Float64(t * Float64(y / z)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -220000000000.0) || ~((z <= 1.48e-5))) tmp = x + (y - (t * (y / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -220000000000.0], N[Not[LessEqual[z, 1.48e-5]], $MachinePrecision]], N[(x + N[(y - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -220000000000 \lor \neg \left(z \leq 1.48 \cdot 10^{-5}\right):\\
\;\;\;\;x + \left(y - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.2e11 or 1.4800000000000001e-5 < z Initial program 73.9%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in a around 0 66.0%
+-commutative66.0%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in z around 0 80.4%
associate-*r/80.4%
associate-*r*80.4%
neg-mul-180.4%
associate-*r/86.8%
*-commutative86.8%
distribute-rgt-neg-out86.8%
unsub-neg86.8%
Simplified86.8%
if -2.2e11 < z < 1.4800000000000001e-5Initial program 94.8%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around 0 94.8%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around 0 82.9%
clear-num82.9%
un-div-inv84.3%
Applied egg-rr84.3%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -57000000000.0) (not (<= z 1.5e-5))) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -57000000000.0) || !(z <= 1.5e-5)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (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 <= (-57000000000.0d0)) .or. (.not. (z <= 1.5d-5))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + (y / (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 <= -57000000000.0) || !(z <= 1.5e-5)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -57000000000.0) or not (z <= 1.5e-5): tmp = x + (y / (z / (z - t))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -57000000000.0) || !(z <= 1.5e-5)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -57000000000.0) || ~((z <= 1.5e-5))) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -57000000000.0], N[Not[LessEqual[z, 1.5e-5]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -57000000000 \lor \neg \left(z \leq 1.5 \cdot 10^{-5}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -5.7e10 or 1.50000000000000004e-5 < z Initial program 73.9%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in a around 0 66.0%
+-commutative66.0%
associate-/l*88.9%
Simplified88.9%
if -5.7e10 < z < 1.50000000000000004e-5Initial program 94.8%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around 0 94.8%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around 0 82.9%
clear-num82.9%
un-div-inv84.3%
Applied egg-rr84.3%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1950000000000.0) (not (<= z 3e+39))) (+ x (/ y (/ z (- z t)))) (- x (/ y (/ a (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1950000000000.0) || !(z <= 3e+39)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x - (y / (a / (z - 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 <= (-1950000000000.0d0)) .or. (.not. (z <= 3d+39))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x - (y / (a / (z - 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 <= -1950000000000.0) || !(z <= 3e+39)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x - (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1950000000000.0) or not (z <= 3e+39): tmp = x + (y / (z / (z - t))) else: tmp = x - (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1950000000000.0) || !(z <= 3e+39)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1950000000000.0) || ~((z <= 3e+39))) tmp = x + (y / (z / (z - t))); else tmp = x - (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1950000000000.0], N[Not[LessEqual[z, 3e+39]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1950000000000 \lor \neg \left(z \leq 3 \cdot 10^{+39}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if z < -1.95e12 or 3e39 < z Initial program 72.3%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in a around 0 67.3%
+-commutative67.3%
associate-/l*91.6%
Simplified91.6%
if -1.95e12 < z < 3e39Initial program 95.0%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in a around inf 83.9%
mul-1-neg83.9%
unsub-neg83.9%
associate-/l*86.6%
Simplified86.6%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.8e-56) (+ x (* y (/ z (- z a)))) (if (<= z 9.2e-5) (+ x (/ y (/ a t))) (+ x (* (- z t) (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e-56) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 9.2e-5) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) * (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.8d-56)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 9.2d-5) then
tmp = x + (y / (a / t))
else
tmp = x + ((z - t) * (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.8e-56) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 9.2e-5) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e-56: tmp = x + (y * (z / (z - a))) elif z <= 9.2e-5: tmp = x + (y / (a / t)) else: tmp = x + ((z - t) * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e-56) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 9.2e-5) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.8e-56) tmp = x + (y * (z / (z - a))); elseif (z <= 9.2e-5) tmp = x + (y / (a / t)); else tmp = x + ((z - t) * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e-56], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-5], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-56}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -1.79999999999999989e-56Initial program 75.9%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in y around 0 75.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 62.4%
*-rgt-identity62.4%
*-commutative62.4%
times-frac78.6%
/-rgt-identity78.6%
Simplified78.6%
if -1.79999999999999989e-56 < z < 9.20000000000000001e-5Initial program 94.1%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around 0 94.1%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around 0 85.5%
clear-num85.5%
un-div-inv87.2%
Applied egg-rr87.2%
if 9.20000000000000001e-5 < z Initial program 78.1%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 85.1%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.6e-56) (+ x (* y (/ z (- z a)))) (if (<= z 5.2e-5) (+ x (/ y (/ a t))) (+ x (/ (- z t) (/ z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-56) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 5.2e-5) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) / (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 (z <= (-2.6d-56)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 5.2d-5) then
tmp = x + (y / (a / t))
else
tmp = x + ((z - t) / (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 (z <= -2.6e-56) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 5.2e-5) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) / (z / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e-56: tmp = x + (y * (z / (z - a))) elif z <= 5.2e-5: tmp = x + (y / (a / t)) else: tmp = x + ((z - t) / (z / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e-56) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 5.2e-5) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(Float64(z - t) / Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.6e-56) tmp = x + (y * (z / (z - a))); elseif (z <= 5.2e-5) tmp = x + (y / (a / t)); else tmp = x + ((z - t) / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e-56], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-5], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-56}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -2.59999999999999997e-56Initial program 75.9%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in y around 0 75.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 62.4%
*-rgt-identity62.4%
*-commutative62.4%
times-frac78.6%
/-rgt-identity78.6%
Simplified78.6%
if -2.59999999999999997e-56 < z < 5.19999999999999968e-5Initial program 94.1%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around 0 94.1%
associate-*r/99.0%
Simplified99.0%
Taylor expanded in z around 0 85.5%
clear-num85.5%
un-div-inv87.2%
Applied egg-rr87.2%
if 5.19999999999999968e-5 < z Initial program 78.1%
associate-*l/97.2%
Simplified97.2%
*-commutative97.2%
clear-num97.1%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 85.1%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -340000000000.0) (+ x y) (if (<= z 7.4e-6) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -340000000000.0) {
tmp = x + y;
} else if (z <= 7.4e-6) {
tmp = x + (t * (y / a));
} else {
tmp = x + 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 <= (-340000000000.0d0)) then
tmp = x + y
else if (z <= 7.4d-6) then
tmp = x + (t * (y / a))
else
tmp = x + 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 <= -340000000000.0) {
tmp = x + y;
} else if (z <= 7.4e-6) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -340000000000.0: tmp = x + y elif z <= 7.4e-6: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -340000000000.0) tmp = Float64(x + y); elseif (z <= 7.4e-6) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -340000000000.0) tmp = x + y; elseif (z <= 7.4e-6) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -340000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 7.4e-6], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -340000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-6}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.4e11 or 7.4000000000000003e-6 < z Initial program 74.1%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if -3.4e11 < z < 7.4000000000000003e-6Initial program 94.7%
associate-*l/95.4%
Simplified95.4%
associate-*l/94.7%
clear-num94.7%
Applied egg-rr94.7%
Taylor expanded in z around 0 81.5%
associate-*r/81.3%
Simplified81.3%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -82000000000.0) (+ x y) (if (<= z 4.2e-6) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -82000000000.0) {
tmp = x + y;
} else if (z <= 4.2e-6) {
tmp = x + (y * (t / a));
} else {
tmp = x + 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 <= (-82000000000.0d0)) then
tmp = x + y
else if (z <= 4.2d-6) then
tmp = x + (y * (t / a))
else
tmp = x + 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 <= -82000000000.0) {
tmp = x + y;
} else if (z <= 4.2e-6) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -82000000000.0: tmp = x + y elif z <= 4.2e-6: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -82000000000.0) tmp = Float64(x + y); elseif (z <= 4.2e-6) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -82000000000.0) tmp = x + y; elseif (z <= 4.2e-6) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -82000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 4.2e-6], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -82000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.2e10 or 4.1999999999999996e-6 < z Initial program 74.1%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if -8.2e10 < z < 4.1999999999999996e-6Initial program 94.7%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in y around 0 94.7%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around 0 82.7%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -110000000000.0) (+ x y) (if (<= z 8.8e-12) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -110000000000.0) {
tmp = x + y;
} else if (z <= 8.8e-12) {
tmp = x + (y / (a / t));
} else {
tmp = x + 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 <= (-110000000000.0d0)) then
tmp = x + y
else if (z <= 8.8d-12) then
tmp = x + (y / (a / t))
else
tmp = x + 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 <= -110000000000.0) {
tmp = x + y;
} else if (z <= 8.8e-12) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -110000000000.0: tmp = x + y elif z <= 8.8e-12: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -110000000000.0) tmp = Float64(x + y); elseif (z <= 8.8e-12) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -110000000000.0) tmp = x + y; elseif (z <= 8.8e-12) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -110000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 8.8e-12], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -110000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.1e11 or 8.79999999999999966e-12 < z Initial program 74.1%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if -1.1e11 < z < 8.79999999999999966e-12Initial program 94.7%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in y around 0 94.7%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in z around 0 82.7%
clear-num82.7%
un-div-inv84.2%
Applied egg-rr84.2%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 84.7%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in z around inf 59.7%
+-commutative59.7%
Simplified59.7%
Final simplification59.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 84.7%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in x around inf 47.2%
Final simplification47.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023275
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))