
(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 15 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 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}
Initial program 87.4%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (- 1.0 (/ a z))))))
(if (<= z -6.4e+100)
t_1
(if (<= z -1.8e-133)
(+ x (* (- z t) (/ y z)))
(if (<= z 5.6e-81) (+ x (* y (/ t a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (1.0 - (a / z)));
double tmp;
if (z <= -6.4e+100) {
tmp = t_1;
} else if (z <= -1.8e-133) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 5.6e-81) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
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 + (y / (1.0d0 - (a / z)))
if (z <= (-6.4d+100)) then
tmp = t_1
else if (z <= (-1.8d-133)) then
tmp = x + ((z - t) * (y / z))
else if (z <= 5.6d-81) then
tmp = x + (y * (t / a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (1.0 - (a / z)));
double tmp;
if (z <= -6.4e+100) {
tmp = t_1;
} else if (z <= -1.8e-133) {
tmp = x + ((z - t) * (y / z));
} else if (z <= 5.6e-81) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (1.0 - (a / z))) tmp = 0 if z <= -6.4e+100: tmp = t_1 elif z <= -1.8e-133: tmp = x + ((z - t) * (y / z)) elif z <= 5.6e-81: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))) tmp = 0.0 if (z <= -6.4e+100) tmp = t_1; elseif (z <= -1.8e-133) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); elseif (z <= 5.6e-81) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (1.0 - (a / z))); tmp = 0.0; if (z <= -6.4e+100) tmp = t_1; elseif (z <= -1.8e-133) tmp = x + ((z - t) * (y / z)); elseif (z <= 5.6e-81) tmp = x + (y * (t / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+100], t$95$1, If[LessEqual[z, -1.8e-133], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-81], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-133}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-81}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.3999999999999998e100 or 5.5999999999999998e-81 < z Initial program 79.9%
associate-*l/91.8%
Simplified91.8%
Taylor expanded in t around 0 73.7%
associate-/l*87.5%
div-sub87.5%
*-inverses87.5%
Simplified87.5%
if -6.3999999999999998e100 < z < -1.8000000000000002e-133Initial program 95.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.4%
if -1.8000000000000002e-133 < z < 5.5999999999999998e-81Initial program 95.4%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around 0 79.6%
+-commutative79.6%
associate-/l*78.5%
Simplified78.5%
associate-/r/79.8%
Applied egg-rr79.8%
Final simplification85.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.2e+101)
(+ x y)
(if (<= z -4.6e-59)
(- x (* y (/ t z)))
(if (<= z 2e+42) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+101) {
tmp = x + y;
} else if (z <= -4.6e-59) {
tmp = x - (y * (t / z));
} else if (z <= 2e+42) {
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 <= (-4.2d+101)) then
tmp = x + y
else if (z <= (-4.6d-59)) then
tmp = x - (y * (t / z))
else if (z <= 2d+42) 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 <= -4.2e+101) {
tmp = x + y;
} else if (z <= -4.6e-59) {
tmp = x - (y * (t / z));
} else if (z <= 2e+42) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+101: tmp = x + y elif z <= -4.6e-59: tmp = x - (y * (t / z)) elif z <= 2e+42: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+101) tmp = Float64(x + y); elseif (z <= -4.6e-59) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 2e+42) 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 <= -4.2e+101) tmp = x + y; elseif (z <= -4.6e-59) tmp = x - (y * (t / z)); elseif (z <= 2e+42) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+101], N[(x + y), $MachinePrecision], If[LessEqual[z, -4.6e-59], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+42], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+101}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-59}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+42}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.2e101 or 2.00000000000000009e42 < z Initial program 75.4%
associate-*l/89.6%
Simplified89.6%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -4.2e101 < z < -4.59999999999999959e-59Initial program 94.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 87.3%
Taylor expanded in z around 0 76.9%
mul-1-neg76.9%
distribute-lft-neg-out76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in x around 0 76.9%
mul-1-neg76.9%
associate-*l/76.9%
*-commutative76.9%
sub-neg76.9%
Simplified76.9%
if -4.59999999999999959e-59 < z < 2.00000000000000009e42Initial program 96.0%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around 0 77.1%
+-commutative77.1%
associate-/l*77.1%
Simplified77.1%
associate-/r/78.0%
Applied egg-rr78.0%
Final simplification77.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.02e+101)
(+ x y)
(if (<= z -1.66e-133)
(- x (/ (* y t) z))
(if (<= z 2.6e+38) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.02e+101) {
tmp = x + y;
} else if (z <= -1.66e-133) {
tmp = x - ((y * t) / z);
} else if (z <= 2.6e+38) {
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 <= (-2.02d+101)) then
tmp = x + y
else if (z <= (-1.66d-133)) then
tmp = x - ((y * t) / z)
else if (z <= 2.6d+38) 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 <= -2.02e+101) {
tmp = x + y;
} else if (z <= -1.66e-133) {
tmp = x - ((y * t) / z);
} else if (z <= 2.6e+38) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.02e+101: tmp = x + y elif z <= -1.66e-133: tmp = x - ((y * t) / z) elif z <= 2.6e+38: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.02e+101) tmp = Float64(x + y); elseif (z <= -1.66e-133) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 2.6e+38) 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 <= -2.02e+101) tmp = x + y; elseif (z <= -1.66e-133) tmp = x - ((y * t) / z); elseif (z <= 2.6e+38) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.02e+101], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.66e-133], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+38], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.02 \cdot 10^{+101}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.66 \cdot 10^{-133}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+38}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.02000000000000015e101 or 2.5999999999999999e38 < z Initial program 75.4%
associate-*l/89.6%
Simplified89.6%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -2.02000000000000015e101 < z < -1.66e-133Initial program 93.2%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 85.3%
Taylor expanded in z around 0 77.3%
mul-1-neg77.3%
distribute-lft-neg-out77.3%
*-commutative77.3%
Simplified77.3%
if -1.66e-133 < z < 2.5999999999999999e38Initial program 96.5%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around 0 78.5%
+-commutative78.5%
associate-/l*77.7%
Simplified77.7%
associate-/r/78.6%
Applied egg-rr78.6%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e-58) (not (<= z 6e+34))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-58) || !(z <= 6e+34)) {
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 ((z <= (-1.15d-58)) .or. (.not. (z <= 6d+34))) 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 ((z <= -1.15e-58) || !(z <= 6e+34)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e-58) or not (z <= 6e+34): 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 ((z <= -1.15e-58) || !(z <= 6e+34)) 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 ((z <= -1.15e-58) || ~((z <= 6e+34))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e-58], N[Not[LessEqual[z, 6e+34]], $MachinePrecision]], 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}\;z \leq -1.15 \cdot 10^{-58} \lor \neg \left(z \leq 6 \cdot 10^{+34}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.1499999999999999e-58 or 6.00000000000000037e34 < z Initial program 79.9%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in x around 0 79.9%
associate-*r/99.9%
+-commutative99.9%
fma-udef99.9%
Simplified99.9%
Taylor expanded in a around 0 70.9%
associate-*r/86.2%
Simplified86.2%
if -1.1499999999999999e-58 < z < 6.00000000000000037e34Initial program 96.0%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around 0 77.1%
+-commutative77.1%
associate-/l*77.1%
Simplified77.1%
associate-/r/78.0%
Applied egg-rr78.0%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+98) (not (<= z 1.8e+25))) (+ x (/ y (- 1.0 (/ a z)))) (- x (* t (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+98) || !(z <= 1.8e+25)) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x - (t * (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 <= (-1.85d+98)) .or. (.not. (z <= 1.8d+25))) then
tmp = x + (y / (1.0d0 - (a / z)))
else
tmp = x - (t * (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 <= -1.85e+98) || !(z <= 1.8e+25)) {
tmp = x + (y / (1.0 - (a / z)));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e+98) or not (z <= 1.8e+25): tmp = x + (y / (1.0 - (a / z))) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+98) || !(z <= 1.8e+25)) tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e+98) || ~((z <= 1.8e+25))) tmp = x + (y / (1.0 - (a / z))); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+98], N[Not[LessEqual[z, 1.8e+25]], $MachinePrecision]], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+98} \lor \neg \left(z \leq 1.8 \cdot 10^{+25}\right):\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -1.8499999999999999e98 or 1.80000000000000008e25 < z Initial program 76.3%
associate-*l/90.3%
Simplified90.3%
Taylor expanded in t around 0 73.2%
associate-/l*89.4%
div-sub89.4%
*-inverses89.4%
Simplified89.4%
if -1.8499999999999999e98 < z < 1.80000000000000008e25Initial program 96.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 89.2%
associate-*r/89.2%
mul-1-neg89.2%
distribute-lft-neg-out89.2%
associate-*r/90.5%
*-commutative90.5%
Simplified90.5%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.3e+250) (not (<= y 1.2e+37))) (* y (- 1.0 (/ t z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.3e+250) || !(y <= 1.2e+37)) {
tmp = y * (1.0 - (t / z));
} 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 ((y <= (-1.3d+250)) .or. (.not. (y <= 1.2d+37))) then
tmp = y * (1.0d0 - (t / z))
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 ((y <= -1.3e+250) || !(y <= 1.2e+37)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.3e+250) or not (y <= 1.2e+37): tmp = y * (1.0 - (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.3e+250) || !(y <= 1.2e+37)) tmp = Float64(y * Float64(1.0 - Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.3e+250) || ~((y <= 1.2e+37))) tmp = y * (1.0 - (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.3e+250], N[Not[LessEqual[y, 1.2e+37]], $MachinePrecision]], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+250} \lor \neg \left(y \leq 1.2 \cdot 10^{+37}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.30000000000000006e250 or 1.2e37 < y Initial program 76.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in a around 0 49.2%
Taylor expanded in x around 0 40.1%
associate-*r/57.5%
div-sub57.5%
*-inverses57.5%
Simplified57.5%
if -1.30000000000000006e250 < y < 1.2e37Initial program 90.8%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in z around inf 68.3%
+-commutative68.3%
Simplified68.3%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e+101) (not (<= z 1.56e+37))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e+101) || !(z <= 1.56e+37)) {
tmp = x + y;
} 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.6d+101)) .or. (.not. (z <= 1.56d+37))) then
tmp = x + y
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.6e+101) || !(z <= 1.56e+37)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e+101) or not (z <= 1.56e+37): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e+101) || !(z <= 1.56e+37)) tmp = Float64(x + y); 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.6e+101) || ~((z <= 1.56e+37))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e+101], N[Not[LessEqual[z, 1.56e+37]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+101} \lor \neg \left(z \leq 1.56 \cdot 10^{+37}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.60000000000000003e101 or 1.56000000000000008e37 < z Initial program 75.4%
associate-*l/89.6%
Simplified89.6%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -1.60000000000000003e101 < z < 1.56000000000000008e37Initial program 95.6%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around 0 74.0%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+101) (not (<= z 8.6e+43))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+101) || !(z <= 8.6e+43)) {
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 <= (-3.7d+101)) .or. (.not. (z <= 8.6d+43))) 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 <= -3.7e+101) || !(z <= 8.6e+43)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+101) or not (z <= 8.6e+43): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+101) || !(z <= 8.6e+43)) 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 <= -3.7e+101) || ~((z <= 8.6e+43))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+101], N[Not[LessEqual[z, 8.6e+43]], $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 -3.7 \cdot 10^{+101} \lor \neg \left(z \leq 8.6 \cdot 10^{+43}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.6999999999999997e101 or 8.6e43 < z Initial program 75.4%
associate-*l/89.6%
Simplified89.6%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -3.6999999999999997e101 < z < 8.6e43Initial program 95.6%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around 0 72.7%
+-commutative72.7%
associate-/l*73.3%
Simplified73.3%
associate-/r/74.0%
Applied egg-rr74.0%
Final simplification75.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.65e+249) (* y (/ (- z t) z)) (if (<= y 8.6e+36) (+ x y) (* y (- 1.0 (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.65e+249) {
tmp = y * ((z - t) / z);
} else if (y <= 8.6e+36) {
tmp = x + y;
} else {
tmp = y * (1.0 - (t / 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 (y <= (-2.65d+249)) then
tmp = y * ((z - t) / z)
else if (y <= 8.6d+36) then
tmp = x + y
else
tmp = y * (1.0d0 - (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.65e+249) {
tmp = y * ((z - t) / z);
} else if (y <= 8.6e+36) {
tmp = x + y;
} else {
tmp = y * (1.0 - (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.65e+249: tmp = y * ((z - t) / z) elif y <= 8.6e+36: tmp = x + y else: tmp = y * (1.0 - (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.65e+249) tmp = Float64(y * Float64(Float64(z - t) / z)); elseif (y <= 8.6e+36) tmp = Float64(x + y); else tmp = Float64(y * Float64(1.0 - Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.65e+249) tmp = y * ((z - t) / z); elseif (y <= 8.6e+36) tmp = x + y; else tmp = y * (1.0 - (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.65e+249], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6e+36], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{+249}:\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+36}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if y < -2.65000000000000019e249Initial program 57.2%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 33.3%
Taylor expanded in x around 0 29.5%
associate-*r/64.5%
Simplified64.5%
if -2.65000000000000019e249 < y < 8.6000000000000001e36Initial program 90.8%
associate-*l/93.6%
Simplified93.6%
Taylor expanded in z around inf 68.3%
+-commutative68.3%
Simplified68.3%
if 8.6000000000000001e36 < y Initial program 81.4%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in a around 0 53.7%
Taylor expanded in x around 0 43.1%
associate-*r/55.6%
div-sub55.6%
*-inverses55.6%
Simplified55.6%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 87.4%
associate-*l/94.6%
Simplified94.6%
Final simplification94.6%
(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 87.4%
associate-/l*98.0%
Simplified98.0%
clear-num97.9%
associate-/r/97.6%
clear-num97.7%
Applied egg-rr97.7%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e-58) (not (<= z 2.8e+34))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e-58) || !(z <= 2.8e+34)) {
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.25d-58)) .or. (.not. (z <= 2.8d+34))) 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.25e-58) || !(z <= 2.8e+34)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e-58) or not (z <= 2.8e+34): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.25e-58) || !(z <= 2.8e+34)) 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.25e-58) || ~((z <= 2.8e+34))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.25e-58], N[Not[LessEqual[z, 2.8e+34]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-58} \lor \neg \left(z \leq 2.8 \cdot 10^{+34}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.24999999999999994e-58 or 2.80000000000000008e34 < z Initial program 80.0%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in z around inf 71.9%
+-commutative71.9%
Simplified71.9%
if -1.24999999999999994e-58 < z < 2.80000000000000008e34Initial program 96.0%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in x around inf 56.0%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -7e-195) x (if (<= x 6e-95) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7e-195) {
tmp = x;
} else if (x <= 6e-95) {
tmp = 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 (x <= (-7d-195)) then
tmp = x
else if (x <= 6d-95) then
tmp = 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 (x <= -7e-195) {
tmp = x;
} else if (x <= 6e-95) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7e-195: tmp = x elif x <= 6e-95: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7e-195) tmp = x; elseif (x <= 6e-95) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7e-195) tmp = x; elseif (x <= 6e-95) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7e-195], x, If[LessEqual[x, 6e-95], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-195}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-95}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.00000000000000028e-195 or 6e-95 < x Initial program 90.3%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in x around inf 70.4%
if -7.00000000000000028e-195 < x < 6e-95Initial program 80.9%
associate-*l/85.3%
Simplified85.3%
Taylor expanded in a around 0 46.6%
Taylor expanded in x around 0 41.8%
associate-*r/55.2%
div-sub55.2%
*-inverses55.2%
Simplified55.2%
Taylor expanded in t around 0 39.2%
Final simplification60.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 87.4%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in x around inf 53.4%
Final simplification53.4%
(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 2023318
(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))))