
(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 12 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 (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * 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 + (((z - t) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 90.8%
*-commutative90.8%
associate-*l/98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -210000000.0) (not (<= z 8.5e-10))) (- x (/ (- t z) (/ z y))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -210000000.0) || !(z <= 8.5e-10)) {
tmp = x - ((t - z) / (z / y));
} else {
tmp = x + (t * (y / 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 <= (-210000000.0d0)) .or. (.not. (z <= 8.5d-10))) then
tmp = x - ((t - z) / (z / y))
else
tmp = x + (t * (y / 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 <= -210000000.0) || !(z <= 8.5e-10)) {
tmp = x - ((t - z) / (z / y));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -210000000.0) or not (z <= 8.5e-10): tmp = x - ((t - z) / (z / y)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -210000000.0) || !(z <= 8.5e-10)) tmp = Float64(x - Float64(Float64(t - z) / Float64(z / y))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -210000000.0) || ~((z <= 8.5e-10))) tmp = x - ((t - z) / (z / y)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -210000000.0], N[Not[LessEqual[z, 8.5e-10]], $MachinePrecision]], N[(x - N[(N[(t - z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -210000000 \lor \neg \left(z \leq 8.5 \cdot 10^{-10}\right):\\
\;\;\;\;x - \frac{t - z}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.1e8 or 8.4999999999999996e-10 < z Initial program 84.7%
*-commutative84.7%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 80.4%
if -2.1e8 < z < 8.4999999999999996e-10Initial program 96.0%
Taylor expanded in z around 0 82.2%
+-commutative82.2%
associate-/l*85.2%
Simplified85.2%
clear-num85.2%
associate-/r/85.2%
clear-num85.3%
Applied egg-rr85.3%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e-69) (not (<= z 6.5e-10))) (+ x (* z (/ y (- z a)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e-69) || !(z <= 6.5e-10)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (t * (y / 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 <= (-6d-69)) .or. (.not. (z <= 6.5d-10))) then
tmp = x + (z * (y / (z - a)))
else
tmp = x + (t * (y / 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 <= -6e-69) || !(z <= 6.5e-10)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e-69) or not (z <= 6.5e-10): tmp = x + (z * (y / (z - a))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e-69) || !(z <= 6.5e-10)) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e-69) || ~((z <= 6.5e-10))) tmp = x + (z * (y / (z - a))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e-69], N[Not[LessEqual[z, 6.5e-10]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-69} \lor \neg \left(z \leq 6.5 \cdot 10^{-10}\right):\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.99999999999999978e-69 or 6.5000000000000003e-10 < z Initial program 85.7%
Taylor expanded in t around 0 70.0%
+-commutative70.0%
associate-*l/78.4%
*-commutative78.4%
Simplified78.4%
if -5.99999999999999978e-69 < z < 6.5000000000000003e-10Initial program 97.0%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
associate-/l*90.9%
Simplified90.9%
clear-num90.9%
associate-/r/91.0%
clear-num91.0%
Applied egg-rr91.0%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e-35) (not (<= a 6.6e-122))) (+ x (* y (/ (- t z) a))) (+ x (/ y (/ z (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-35) || !(a <= 6.6e-122)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y / (z / (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 ((a <= (-2d-35)) .or. (.not. (a <= 6.6d-122))) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + (y / (z / (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 ((a <= -2e-35) || !(a <= 6.6e-122)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e-35) or not (a <= 6.6e-122): tmp = x + (y * ((t - z) / a)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e-35) || !(a <= 6.6e-122)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e-35) || ~((a <= 6.6e-122))) tmp = x + (y * ((t - z) / a)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e-35], N[Not[LessEqual[a, 6.6e-122]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-35} \lor \neg \left(a \leq 6.6 \cdot 10^{-122}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if a < -2.00000000000000002e-35 or 6.59999999999999999e-122 < a Initial program 89.7%
Taylor expanded in a around inf 79.9%
mul-1-neg79.9%
unsub-neg79.9%
associate-/l*86.7%
Simplified86.7%
clear-num86.6%
associate-/r/86.7%
clear-num86.7%
Applied egg-rr86.7%
if -2.00000000000000002e-35 < a < 6.59999999999999999e-122Initial program 92.8%
Taylor expanded in a around 0 81.9%
+-commutative81.9%
associate-/l*88.0%
Simplified88.0%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.25e-12) (+ x (* z (/ y (- z a)))) (if (<= a 6.6e-122) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.25e-12) {
tmp = x + (z * (y / (z - a)));
} else if (a <= 6.6e-122) {
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 (a <= (-1.25d-12)) then
tmp = x + (z * (y / (z - a)))
else if (a <= 6.6d-122) 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 (a <= -1.25e-12) {
tmp = x + (z * (y / (z - a)));
} else if (a <= 6.6e-122) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.25e-12: tmp = x + (z * (y / (z - a))) elif a <= 6.6e-122: 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 (a <= -1.25e-12) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (a <= 6.6e-122) 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 (a <= -1.25e-12) tmp = x + (z * (y / (z - a))); elseif (a <= 6.6e-122) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.25e-12], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-122], 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}\;a \leq -1.25 \cdot 10^{-12}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if a < -1.24999999999999992e-12Initial program 89.4%
Taylor expanded in t around 0 78.9%
+-commutative78.9%
associate-*l/84.3%
*-commutative84.3%
Simplified84.3%
if -1.24999999999999992e-12 < a < 6.59999999999999999e-122Initial program 93.1%
Taylor expanded in a around 0 80.8%
+-commutative80.8%
associate-/l*86.6%
Simplified86.6%
if 6.59999999999999999e-122 < a Initial program 89.3%
Taylor expanded in z around 0 78.5%
+-commutative78.5%
associate-/l*82.8%
Simplified82.8%
clear-num82.9%
associate-/r/82.8%
clear-num83.1%
Applied egg-rr83.1%
associate-*l/78.5%
associate-/l*84.4%
Applied egg-rr84.4%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.5e-36) (+ x (* y (/ (- t z) a))) (if (<= a 6.6e-122) (+ 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 (a <= -1.5e-36) {
tmp = x + (y * ((t - z) / a));
} else if (a <= 6.6e-122) {
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 (a <= (-1.5d-36)) then
tmp = x + (y * ((t - z) / a))
else if (a <= 6.6d-122) 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 (a <= -1.5e-36) {
tmp = x + (y * ((t - z) / a));
} else if (a <= 6.6e-122) {
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 a <= -1.5e-36: tmp = x + (y * ((t - z) / a)) elif a <= 6.6e-122: 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 (a <= -1.5e-36) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (a <= 6.6e-122) 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 (a <= -1.5e-36) tmp = x + (y * ((t - z) / a)); elseif (a <= 6.6e-122) 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[LessEqual[a, -1.5e-36], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-122], 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}\;a \leq -1.5 \cdot 10^{-36}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if a < -1.5000000000000001e-36Initial program 90.0%
Taylor expanded in a around inf 78.3%
mul-1-neg78.3%
unsub-neg78.3%
associate-/l*84.8%
Simplified84.8%
clear-num84.8%
associate-/r/84.8%
clear-num84.9%
Applied egg-rr84.9%
if -1.5000000000000001e-36 < a < 6.59999999999999999e-122Initial program 92.8%
Taylor expanded in a around 0 81.9%
+-commutative81.9%
associate-/l*88.0%
Simplified88.0%
if 6.59999999999999999e-122 < a Initial program 89.3%
Taylor expanded in a around inf 81.6%
mul-1-neg81.6%
unsub-neg81.6%
associate-/l*88.6%
Simplified88.6%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+42) (not (<= z 105000.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+42) || !(z <= 105000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.4d+42)) .or. (.not. (z <= 105000.0d0))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+42) || !(z <= 105000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+42) or not (z <= 105000.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e+42) || !(z <= 105000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.4e+42) || ~((z <= 105000.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e+42], N[Not[LessEqual[z, 105000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+42} \lor \neg \left(z \leq 105000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.3999999999999999e42 or 105000 < z Initial program 83.7%
Taylor expanded in z around inf 77.4%
+-commutative77.4%
Simplified77.4%
if -2.3999999999999999e42 < z < 105000Initial program 96.2%
Taylor expanded in a around inf 83.1%
mul-1-neg83.1%
unsub-neg83.1%
associate-/l*86.0%
Simplified86.0%
Taylor expanded in z around inf 56.7%
associate-/l*56.7%
associate-/r/58.5%
Applied egg-rr58.5%
sub-neg58.5%
associate-*l/56.7%
associate-*r/56.7%
distribute-rgt-neg-out56.7%
add-sqr-sqrt34.7%
sqrt-unprod52.9%
sqr-neg52.9%
sqrt-unprod34.9%
add-sqr-sqrt52.8%
associate-*r/52.8%
associate-*l/58.0%
*-commutative58.0%
Applied egg-rr58.0%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+43) (not (<= z 1.25e-9))) (+ x y) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+43) || !(z <= 1.25e-9)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / 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 <= (-4.8d+43)) .or. (.not. (z <= 1.25d-9))) then
tmp = x + y
else
tmp = x + ((t * y) / 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 <= -4.8e+43) || !(z <= 1.25e-9)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+43) or not (z <= 1.25e-9): tmp = x + y else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+43) || !(z <= 1.25e-9)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+43) || ~((z <= 1.25e-9))) tmp = x + y; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+43], N[Not[LessEqual[z, 1.25e-9]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+43} \lor \neg \left(z \leq 1.25 \cdot 10^{-9}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -4.80000000000000046e43 or 1.25e-9 < z Initial program 84.0%
Taylor expanded in z around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -4.80000000000000046e43 < z < 1.25e-9Initial program 96.2%
Taylor expanded in z around 0 80.9%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.06e+42) (not (<= z 5.2e-10))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.06e+42) || !(z <= 5.2e-10)) {
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 <= (-1.06d+42)) .or. (.not. (z <= 5.2d-10))) 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 <= -1.06e+42) || !(z <= 5.2e-10)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.06e+42) or not (z <= 5.2e-10): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.06e+42) || !(z <= 5.2e-10)) 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 <= -1.06e+42) || ~((z <= 5.2e-10))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.06e+42], N[Not[LessEqual[z, 5.2e-10]], $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.06 \cdot 10^{+42} \lor \neg \left(z \leq 5.2 \cdot 10^{-10}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.0599999999999999e42 or 5.19999999999999962e-10 < z Initial program 84.0%
Taylor expanded in z around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -1.0599999999999999e42 < z < 5.19999999999999962e-10Initial program 96.2%
Taylor expanded in z around 0 80.9%
+-commutative80.9%
associate-/l*83.8%
Simplified83.8%
associate-/r/83.2%
Applied egg-rr83.2%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+42) (not (<= z 9.5e-10))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+42) || !(z <= 9.5e-10)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.5d+42)) .or. (.not. (z <= 9.5d-10))) then
tmp = x + y
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+42) || !(z <= 9.5e-10)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+42) or not (z <= 9.5e-10): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+42) || !(z <= 9.5e-10)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e+42) || ~((z <= 9.5e-10))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+42], N[Not[LessEqual[z, 9.5e-10]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+42} \lor \neg \left(z \leq 9.5 \cdot 10^{-10}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.50000000000000023e42 or 9.50000000000000028e-10 < z Initial program 84.0%
Taylor expanded in z around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -3.50000000000000023e42 < z < 9.50000000000000028e-10Initial program 96.2%
Taylor expanded in z around 0 80.9%
+-commutative80.9%
associate-/l*83.8%
Simplified83.8%
clear-num83.8%
associate-/r/83.8%
clear-num83.8%
Applied egg-rr83.8%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e+41) (not (<= z 0.0009))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e+41) || !(z <= 0.0009)) {
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.7d+41)) .or. (.not. (z <= 0.0009d0))) 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.7e+41) || !(z <= 0.0009)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e+41) or not (z <= 0.0009): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e+41) || !(z <= 0.0009)) 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.7e+41) || ~((z <= 0.0009))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e+41], N[Not[LessEqual[z, 0.0009]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+41} \lor \neg \left(z \leq 0.0009\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.69999999999999999e41 or 8.9999999999999998e-4 < z Initial program 83.8%
Taylor expanded in z around inf 76.7%
+-commutative76.7%
Simplified76.7%
if -1.69999999999999999e41 < z < 8.9999999999999998e-4Initial program 96.2%
Taylor expanded in x around inf 52.1%
Final simplification62.9%
(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 90.8%
Taylor expanded in x around inf 52.9%
Final simplification52.9%
(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 2023322
(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))))