
(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}
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 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}
(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 98.1%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e-162) (not (<= z 2.3e+44))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e-162) || !(z <= 2.3e+44)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.25d-162)) .or. (.not. (z <= 2.3d+44))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e-162) || !(z <= 2.3e+44)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e-162) or not (z <= 2.3e+44): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.25e-162) || !(z <= 2.3e+44)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.25e-162) || ~((z <= 2.3e+44))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.25e-162], N[Not[LessEqual[z, 2.3e+44]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 2.3 \cdot 10^{+44}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.25000000000000004e-162 or 2.30000000000000004e44 < z Initial program 99.3%
Taylor expanded in t around 0 84.1%
if -1.25000000000000004e-162 < z < 2.30000000000000004e44Initial program 96.1%
Taylor expanded in z around 0 81.3%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e+38) (not (<= a 1.7e+38))) (- x (/ y (/ a (- z t)))) (+ x (/ (- z t) (/ z y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e+38) || !(a <= 1.7e+38)) {
tmp = x - (y / (a / (z - 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 ((a <= (-2.5d+38)) .or. (.not. (a <= 1.7d+38))) then
tmp = x - (y / (a / (z - 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 ((a <= -2.5e+38) || !(a <= 1.7e+38)) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((z - t) / (z / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e+38) or not (a <= 1.7e+38): tmp = x - (y / (a / (z - t))) else: tmp = x + ((z - t) / (z / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e+38) || !(a <= 1.7e+38)) tmp = Float64(x - Float64(y / Float64(a / Float64(z - 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 ((a <= -2.5e+38) || ~((a <= 1.7e+38))) tmp = x - (y / (a / (z - t))); else tmp = x + ((z - t) / (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e+38], N[Not[LessEqual[a, 1.7e+38]], $MachinePrecision]], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+38} \lor \neg \left(a \leq 1.7 \cdot 10^{+38}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\end{array}
\end{array}
if a < -2.49999999999999985e38 or 1.69999999999999998e38 < a Initial program 99.2%
Taylor expanded in a around inf 76.1%
mul-1-neg76.1%
associate-/l*86.7%
Simplified86.7%
if -2.49999999999999985e38 < a < 1.69999999999999998e38Initial program 97.0%
associate-*r/87.5%
*-commutative87.5%
associate-/l*96.0%
Applied egg-rr96.0%
Taylor expanded in a around 0 75.7%
*-commutative75.7%
associate-/l*84.1%
Simplified84.1%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e+76) (not (<= t 17.0))) (- x (* y (/ t (- z a)))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e+76) || !(t <= 17.0)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / 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.5d+76)) .or. (.not. (t <= 17.0d0))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (y / (1.0d0 - (a / 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.5e+76) || !(t <= 17.0)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e+76) or not (t <= 17.0): tmp = x - (y * (t / (z - a))) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e+76) || !(t <= 17.0)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.5e+76) || ~((t <= 17.0))) tmp = x - (y * (t / (z - a))); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.5e+76], N[Not[LessEqual[t, 17.0]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+76} \lor \neg \left(t \leq 17\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.4999999999999999e76 or 17 < t Initial program 96.6%
Taylor expanded in t around inf 88.3%
neg-mul-188.3%
distribute-neg-frac88.3%
Simplified88.3%
if -1.4999999999999999e76 < t < 17Initial program 99.3%
Taylor expanded in t around 0 80.8%
associate-/l*92.3%
div-sub92.3%
*-inverses92.3%
Simplified92.3%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.3e+38) (+ x (* t (/ y a))) (if (<= a 1.66e+38) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.3e+38) {
tmp = x + (t * (y / a));
} else if (a <= 1.66e+38) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.3d+38)) then
tmp = x + (t * (y / a))
else if (a <= 1.66d+38) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.3e+38) {
tmp = x + (t * (y / a));
} else if (a <= 1.66e+38) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.3e+38: tmp = x + (t * (y / a)) elif a <= 1.66e+38: tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.3e+38) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 1.66e+38) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.3e+38) tmp = x + (t * (y / a)); elseif (a <= 1.66e+38) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.3e+38], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.66e+38], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+38}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.66 \cdot 10^{+38}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.3e38Initial program 98.5%
associate-*r/83.5%
*-commutative83.5%
associate-/l*99.8%
Applied egg-rr99.8%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 70.8%
*-commutative70.8%
associate-*l/83.3%
Simplified83.3%
if -1.3e38 < a < 1.66e38Initial program 97.0%
Taylor expanded in a around 0 83.7%
if 1.66e38 < a Initial program 99.9%
Taylor expanded in z around 0 86.5%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.02e+38) (+ x (* t (/ y a))) (if (<= a 1.18e+38) (+ x (* (- z t) (/ y z))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.02e+38) {
tmp = x + (t * (y / a));
} else if (a <= 1.18e+38) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.02d+38)) then
tmp = x + (t * (y / a))
else if (a <= 1.18d+38) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.02e+38) {
tmp = x + (t * (y / a));
} else if (a <= 1.18e+38) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.02e+38: tmp = x + (t * (y / a)) elif a <= 1.18e+38: tmp = x + ((z - t) * (y / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.02e+38) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 1.18e+38) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.02e+38) tmp = x + (t * (y / a)); elseif (a <= 1.18e+38) tmp = x + ((z - t) * (y / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.02e+38], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.18e+38], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{+38}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.18 \cdot 10^{+38}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.02000000000000006e38Initial program 98.5%
associate-*r/83.5%
*-commutative83.5%
associate-/l*99.8%
Applied egg-rr99.8%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 70.8%
*-commutative70.8%
associate-*l/83.3%
Simplified83.3%
if -1.02000000000000006e38 < a < 1.18e38Initial program 97.0%
associate-*r/87.5%
Simplified87.5%
associate-/l*97.1%
associate-/r/95.6%
Applied egg-rr95.6%
Taylor expanded in z around inf 83.7%
if 1.18e38 < a Initial program 99.9%
Taylor expanded in z around 0 86.5%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.8e+38) (+ x (* t (/ y a))) (if (<= a 1.35e+38) (+ x (/ (- z t) (/ z y))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e+38) {
tmp = x + (t * (y / a));
} else if (a <= 1.35e+38) {
tmp = x + ((z - t) / (z / y));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.8d+38)) then
tmp = x + (t * (y / a))
else if (a <= 1.35d+38) then
tmp = x + ((z - t) / (z / y))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e+38) {
tmp = x + (t * (y / a));
} else if (a <= 1.35e+38) {
tmp = x + ((z - t) / (z / y));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e+38: tmp = x + (t * (y / a)) elif a <= 1.35e+38: tmp = x + ((z - t) / (z / y)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e+38) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (a <= 1.35e+38) tmp = Float64(x + Float64(Float64(z - t) / Float64(z / y))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e+38) tmp = x + (t * (y / a)); elseif (a <= 1.35e+38) tmp = x + ((z - t) / (z / y)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e+38], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.35e+38], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+38}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -1.79999999999999985e38Initial program 98.5%
associate-*r/83.5%
*-commutative83.5%
associate-/l*99.8%
Applied egg-rr99.8%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 70.8%
*-commutative70.8%
associate-*l/83.3%
Simplified83.3%
if -1.79999999999999985e38 < a < 1.34999999999999998e38Initial program 97.0%
associate-*r/87.5%
*-commutative87.5%
associate-/l*96.0%
Applied egg-rr96.0%
Taylor expanded in a around 0 75.7%
*-commutative75.7%
associate-/l*84.1%
Simplified84.1%
if 1.34999999999999998e38 < a Initial program 99.9%
Taylor expanded in z around 0 86.5%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+76) (- x (* t (/ y (- z a)))) (if (<= t 48.0) (+ x (/ y (- 1.0 (/ a z)))) (- x (* y (/ t (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+76) {
tmp = x - (t * (y / (z - a)));
} else if (t <= 48.0) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x - (y * (t / (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 (t <= (-2.5d+76)) then
tmp = x - (t * (y / (z - a)))
else if (t <= 48.0d0) then
tmp = x + (y / (1.0d0 - (a / z)))
else
tmp = x - (y * (t / (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 (t <= -2.5e+76) {
tmp = x - (t * (y / (z - a)));
} else if (t <= 48.0) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.5e+76: tmp = x - (t * (y / (z - a))) elif t <= 48.0: tmp = x + (y / (1.0 - (a / z))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+76) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); elseif (t <= 48.0) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.5e+76) tmp = x - (t * (y / (z - a))); elseif (t <= 48.0) tmp = x + (y / (1.0 - (a / z))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+76], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 48.0], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+76}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t \leq 48:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if t < -2.49999999999999996e76Initial program 93.1%
associate-*r/84.5%
*-commutative84.5%
associate-/l*94.8%
Applied egg-rr94.8%
Taylor expanded in t around inf 82.6%
mul-1-neg82.6%
associate-*r/86.2%
distribute-lft-neg-in86.2%
Simplified86.2%
if -2.49999999999999996e76 < t < 48Initial program 99.3%
Taylor expanded in t around 0 80.8%
associate-/l*92.3%
div-sub92.3%
*-inverses92.3%
Simplified92.3%
if 48 < t Initial program 99.9%
Taylor expanded in t around inf 92.0%
neg-mul-192.0%
distribute-neg-frac92.0%
Simplified92.0%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e-139) (not (<= z 1.45e+45))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-139) || !(z <= 1.45e+45)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1d-139)) .or. (.not. (z <= 1.45d+45))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e-139) || !(z <= 1.45e+45)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e-139) or not (z <= 1.45e+45): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e-139) || !(z <= 1.45e+45)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e-139) || ~((z <= 1.45e+45))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e-139], N[Not[LessEqual[z, 1.45e+45]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-139} \lor \neg \left(z \leq 1.45 \cdot 10^{+45}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.00000000000000003e-139 or 1.4499999999999999e45 < z Initial program 99.3%
Taylor expanded in z around inf 74.3%
if -1.00000000000000003e-139 < z < 1.4499999999999999e45Initial program 96.3%
Taylor expanded in z around 0 81.1%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-186) (not (<= z 1.2e-41))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-186) || !(z <= 1.2e-41)) {
tmp = x + y;
} 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 <= (-1.75d-186)) .or. (.not. (z <= 1.2d-41))) then
tmp = x + y
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 <= -1.75e-186) || !(z <= 1.2e-41)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-186) or not (z <= 1.2e-41): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-186) || !(z <= 1.2e-41)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e-186) || ~((z <= 1.2e-41))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-186], N[Not[LessEqual[z, 1.2e-41]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-186} \lor \neg \left(z \leq 1.2 \cdot 10^{-41}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.74999999999999995e-186 or 1.20000000000000011e-41 < z Initial program 99.4%
Taylor expanded in z around inf 71.9%
if -1.74999999999999995e-186 < z < 1.20000000000000011e-41Initial program 95.4%
Taylor expanded in z around 0 85.5%
Taylor expanded in x around inf 55.0%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.1%
Taylor expanded in z around 0 64.6%
Taylor expanded in x around inf 54.5%
Final simplification54.5%
(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 2024027
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))