
(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 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(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 82.9%
associate-/l*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ a t)))) (t_2 (+ x (* z (/ y (- z a))))))
(if (<= z -4.8e-36)
t_2
(if (<= z 4e-60)
t_1
(if (<= z 0.0002)
(- x (* y (/ t z)))
(if (<= z 2e+50) t_1 (if (<= z 3.2e+61) (- x (/ y (/ z t))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (a / t));
double t_2 = x + (z * (y / (z - a)));
double tmp;
if (z <= -4.8e-36) {
tmp = t_2;
} else if (z <= 4e-60) {
tmp = t_1;
} else if (z <= 0.0002) {
tmp = x - (y * (t / z));
} else if (z <= 2e+50) {
tmp = t_1;
} else if (z <= 3.2e+61) {
tmp = x - (y / (z / t));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y / (a / t))
t_2 = x + (z * (y / (z - a)))
if (z <= (-4.8d-36)) then
tmp = t_2
else if (z <= 4d-60) then
tmp = t_1
else if (z <= 0.0002d0) then
tmp = x - (y * (t / z))
else if (z <= 2d+50) then
tmp = t_1
else if (z <= 3.2d+61) then
tmp = x - (y / (z / t))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (a / t));
double t_2 = x + (z * (y / (z - a)));
double tmp;
if (z <= -4.8e-36) {
tmp = t_2;
} else if (z <= 4e-60) {
tmp = t_1;
} else if (z <= 0.0002) {
tmp = x - (y * (t / z));
} else if (z <= 2e+50) {
tmp = t_1;
} else if (z <= 3.2e+61) {
tmp = x - (y / (z / t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (a / t)) t_2 = x + (z * (y / (z - a))) tmp = 0 if z <= -4.8e-36: tmp = t_2 elif z <= 4e-60: tmp = t_1 elif z <= 0.0002: tmp = x - (y * (t / z)) elif z <= 2e+50: tmp = t_1 elif z <= 3.2e+61: tmp = x - (y / (z / t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(a / t))) t_2 = Float64(x + Float64(z * Float64(y / Float64(z - a)))) tmp = 0.0 if (z <= -4.8e-36) tmp = t_2; elseif (z <= 4e-60) tmp = t_1; elseif (z <= 0.0002) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 2e+50) tmp = t_1; elseif (z <= 3.2e+61) tmp = Float64(x - Float64(y / Float64(z / t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (a / t)); t_2 = x + (z * (y / (z - a))); tmp = 0.0; if (z <= -4.8e-36) tmp = t_2; elseif (z <= 4e-60) tmp = t_1; elseif (z <= 0.0002) tmp = x - (y * (t / z)); elseif (z <= 2e+50) tmp = t_1; elseif (z <= 3.2e+61) tmp = x - (y / (z / t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-36], t$95$2, If[LessEqual[z, 4e-60], t$95$1, If[LessEqual[z, 0.0002], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+50], t$95$1, If[LessEqual[z, 3.2e+61], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a}{t}}\\
t_2 := x + z \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.0002:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+61}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.8e-36 or 3.1999999999999998e61 < z Initial program 68.4%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in t around 0 63.6%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
if -4.8e-36 < z < 3.9999999999999999e-60 or 2.0000000000000001e-4 < z < 2.0000000000000002e50Initial program 96.4%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in z around 0 82.7%
associate-/l*85.1%
Simplified85.1%
if 3.9999999999999999e-60 < z < 2.0000000000000001e-4Initial program 99.9%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around inf 77.9%
Taylor expanded in z around 0 77.9%
*-commutative77.9%
associate-*r/77.8%
neg-mul-177.8%
distribute-rgt-neg-in77.8%
Simplified77.8%
Taylor expanded in t around 0 77.9%
mul-1-neg77.9%
*-commutative77.9%
associate-*l/77.8%
*-commutative77.8%
Simplified77.8%
if 2.0000000000000002e50 < z < 3.1999999999999998e61Initial program 99.7%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in z around 0 99.7%
mul-1-neg99.7%
associate-/l*100.0%
Simplified100.0%
Final simplification87.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ a t)))))
(if (<= z -3.4e-41)
(+ x y)
(if (<= z 1.88e-59)
t_1
(if (<= z 0.0045) (- x (* y (/ t z))) (if (<= z 9e+61) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (a / t));
double tmp;
if (z <= -3.4e-41) {
tmp = x + y;
} else if (z <= 1.88e-59) {
tmp = t_1;
} else if (z <= 0.0045) {
tmp = x - (y * (t / z));
} else if (z <= 9e+61) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y / (a / t))
if (z <= (-3.4d-41)) then
tmp = x + y
else if (z <= 1.88d-59) then
tmp = t_1
else if (z <= 0.0045d0) then
tmp = x - (y * (t / z))
else if (z <= 9d+61) then
tmp = t_1
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 t_1 = x + (y / (a / t));
double tmp;
if (z <= -3.4e-41) {
tmp = x + y;
} else if (z <= 1.88e-59) {
tmp = t_1;
} else if (z <= 0.0045) {
tmp = x - (y * (t / z));
} else if (z <= 9e+61) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (a / t)) tmp = 0 if z <= -3.4e-41: tmp = x + y elif z <= 1.88e-59: tmp = t_1 elif z <= 0.0045: tmp = x - (y * (t / z)) elif z <= 9e+61: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(a / t))) tmp = 0.0 if (z <= -3.4e-41) tmp = Float64(x + y); elseif (z <= 1.88e-59) tmp = t_1; elseif (z <= 0.0045) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 9e+61) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (a / t)); tmp = 0.0; if (z <= -3.4e-41) tmp = x + y; elseif (z <= 1.88e-59) tmp = t_1; elseif (z <= 0.0045) tmp = x - (y * (t / z)); elseif (z <= 9e+61) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-41], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.88e-59], t$95$1, If[LessEqual[z, 0.0045], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+61], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a}{t}}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-41}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.88 \cdot 10^{-59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.0045:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.3999999999999998e-41 or 9e61 < z Initial program 68.9%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 85.3%
if -3.3999999999999998e-41 < z < 1.88e-59 or 0.00449999999999999966 < z < 9e61Initial program 95.7%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 80.4%
associate-/l*83.4%
Simplified83.4%
if 1.88e-59 < z < 0.00449999999999999966Initial program 99.9%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in z around inf 77.9%
Taylor expanded in z around 0 77.9%
*-commutative77.9%
associate-*r/77.8%
neg-mul-177.8%
distribute-rgt-neg-in77.8%
Simplified77.8%
Taylor expanded in t around 0 77.9%
mul-1-neg77.9%
*-commutative77.9%
associate-*l/77.8%
*-commutative77.8%
Simplified77.8%
Final simplification83.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.2e+103) (not (<= a 2050000000000.0))) (+ x (/ y (/ a t))) (+ x (* (- z t) (/ y z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.2e+103) || !(a <= 2050000000000.0)) {
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 ((a <= (-9.2d+103)) .or. (.not. (a <= 2050000000000.0d0))) 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 ((a <= -9.2e+103) || !(a <= 2050000000000.0)) {
tmp = x + (y / (a / t));
} else {
tmp = x + ((z - t) * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.2e+103) or not (a <= 2050000000000.0): 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 ((a <= -9.2e+103) || !(a <= 2050000000000.0)) 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 ((a <= -9.2e+103) || ~((a <= 2050000000000.0))) tmp = x + (y / (a / t)); else tmp = x + ((z - t) * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.2e+103], N[Not[LessEqual[a, 2050000000000.0]], $MachinePrecision]], 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}\;a \leq -9.2 \cdot 10^{+103} \lor \neg \left(a \leq 2050000000000\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\end{array}
\end{array}
if a < -9.20000000000000034e103 or 2.05e12 < a Initial program 85.9%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around 0 80.5%
associate-/l*86.6%
Simplified86.6%
if -9.20000000000000034e103 < a < 2.05e12Initial program 80.8%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 87.6%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e+65) (not (<= z 2.6e+62))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+65) || !(z <= 2.6e+62)) {
tmp = x + (y * (z / (z - a)));
} 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 <= (-1.8d+65)) .or. (.not. (z <= 2.6d+62))) then
tmp = x + (y * (z / (z - a)))
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 <= -1.8e+65) || !(z <= 2.6e+62)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+65) or not (z <= 2.6e+62): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+65) || !(z <= 2.6e+62)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.8e+65) || ~((z <= 2.6e+62))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e+65], N[Not[LessEqual[z, 2.6e+62]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+65} \lor \neg \left(z \leq 2.6 \cdot 10^{+62}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.79999999999999989e65 or 2.59999999999999984e62 < z Initial program 64.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 94.9%
clear-num94.8%
associate-/r/94.9%
clear-num94.9%
Applied egg-rr94.9%
if -1.79999999999999989e65 < z < 2.59999999999999984e62Initial program 95.5%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in t around inf 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
Taylor expanded in y around 0 87.3%
associate-/l*89.8%
Simplified89.8%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.8e+65) (+ x (/ y (/ (- z a) z))) (if (<= z 1.2e+62) (+ x (/ y (/ (- a z) t))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+65) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 1.2e+62) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y * (z / (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 <= (-5.8d+65)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 1.2d+62) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + (y * (z / (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 <= -5.8e+65) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 1.2e+62) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+65: tmp = x + (y / ((z - a) / z)) elif z <= 1.2e+62: tmp = x + (y / ((a - z) / t)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+65) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 1.2e+62) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.8e+65) tmp = x + (y / ((z - a) / z)); elseif (z <= 1.2e+62) tmp = x + (y / ((a - z) / t)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+65], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+62], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+65}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+62}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -5.8000000000000001e65Initial program 64.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 96.8%
if -5.8000000000000001e65 < z < 1.2e62Initial program 95.5%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in t around inf 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
Taylor expanded in y around 0 87.3%
associate-/l*89.8%
Simplified89.8%
if 1.2e62 < z Initial program 64.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 93.1%
clear-num93.0%
associate-/r/93.1%
clear-num93.1%
Applied egg-rr93.1%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.28e-40) (not (<= z 4.7e+62))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.28e-40) || !(z <= 4.7e+62)) {
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.28d-40)) .or. (.not. (z <= 4.7d+62))) 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.28e-40) || !(z <= 4.7e+62)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.28e-40) or not (z <= 4.7e+62): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.28e-40) || !(z <= 4.7e+62)) 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.28e-40) || ~((z <= 4.7e+62))) 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.28e-40], N[Not[LessEqual[z, 4.7e+62]], $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.28 \cdot 10^{-40} \lor \neg \left(z \leq 4.7 \cdot 10^{+62}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.28000000000000005e-40 or 4.7000000000000003e62 < z Initial program 68.9%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 85.3%
if -1.28000000000000005e-40 < z < 4.7000000000000003e62Initial program 96.3%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around 0 75.5%
associate-/l*78.1%
Simplified78.1%
Final simplification81.6%
(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 82.9%
associate-*l/97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.45e+153) (+ x (* z (/ y a))) (if (<= a 6.1e+181) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.45e+153) {
tmp = x + (z * (y / a));
} else if (a <= 6.1e+181) {
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 (a <= (-1.45d+153)) then
tmp = x + (z * (y / a))
else if (a <= 6.1d+181) 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 (a <= -1.45e+153) {
tmp = x + (z * (y / a));
} else if (a <= 6.1e+181) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.45e+153: tmp = x + (z * (y / a)) elif a <= 6.1e+181: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.45e+153) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (a <= 6.1e+181) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.45e+153) tmp = x + (z * (y / a)); elseif (a <= 6.1e+181) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.45e+153], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.1e+181], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{+153}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 6.1 \cdot 10^{+181}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.45000000000000001e153Initial program 89.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 70.2%
Taylor expanded in z around 0 66.6%
neg-mul-166.6%
distribute-neg-frac66.6%
Simplified66.6%
associate-/r/66.1%
add-sqr-sqrt66.1%
sqrt-unprod63.7%
sqr-neg63.7%
sqrt-unprod0.0%
add-sqr-sqrt63.8%
Applied egg-rr63.8%
if -1.45000000000000001e153 < a < 6.10000000000000001e181Initial program 81.6%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 72.3%
if 6.10000000000000001e181 < a Initial program 85.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 87.3%
Taylor expanded in x around inf 81.6%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.5e+153) x (if (<= a 5.5e+182) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+153) {
tmp = x;
} else if (a <= 5.5e+182) {
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 (a <= (-2.5d+153)) then
tmp = x
else if (a <= 5.5d+182) 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 (a <= -2.5e+153) {
tmp = x;
} else if (a <= 5.5e+182) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.5e+153: tmp = x elif a <= 5.5e+182: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e+153) tmp = x; elseif (a <= 5.5e+182) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.5e+153) tmp = x; elseif (a <= 5.5e+182) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e+153], x, If[LessEqual[a, 5.5e+182], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+182}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.50000000000000009e153 or 5.49999999999999977e182 < a Initial program 87.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 79.7%
Taylor expanded in x around inf 73.7%
if -2.50000000000000009e153 < a < 5.49999999999999977e182Initial program 81.6%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 72.3%
Final simplification72.6%
(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 82.9%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in t around 0 77.4%
Taylor expanded in x around inf 56.6%
Final simplification56.6%
(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 2023257
(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))))