
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- z a)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (z - a)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(z - a)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{z - a}, y, x\right)
\end{array}
Initial program 85.1%
+-commutative85.1%
div-inv85.1%
div-inv85.1%
*-commutative85.1%
associate-*l/98.4%
fma-def98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- z a)))))
(if (<= y -7.6e+248)
t_1
(if (<= y 6.8e+145) (+ y x) (if (<= y 2.15e+223) (* y (/ t a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (z - a));
double tmp;
if (y <= -7.6e+248) {
tmp = t_1;
} else if (y <= 6.8e+145) {
tmp = y + x;
} else if (y <= 2.15e+223) {
tmp = 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 = z * (y / (z - a))
if (y <= (-7.6d+248)) then
tmp = t_1
else if (y <= 6.8d+145) then
tmp = y + x
else if (y <= 2.15d+223) then
tmp = 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 = z * (y / (z - a));
double tmp;
if (y <= -7.6e+248) {
tmp = t_1;
} else if (y <= 6.8e+145) {
tmp = y + x;
} else if (y <= 2.15e+223) {
tmp = y * (t / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (z - a)) tmp = 0 if y <= -7.6e+248: tmp = t_1 elif y <= 6.8e+145: tmp = y + x elif y <= 2.15e+223: tmp = y * (t / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(z - a))) tmp = 0.0 if (y <= -7.6e+248) tmp = t_1; elseif (y <= 6.8e+145) tmp = Float64(y + x); elseif (y <= 2.15e+223) tmp = Float64(y * Float64(t / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (z - a)); tmp = 0.0; if (y <= -7.6e+248) tmp = t_1; elseif (y <= 6.8e+145) tmp = y + x; elseif (y <= 2.15e+223) tmp = y * (t / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.6e+248], t$95$1, If[LessEqual[y, 6.8e+145], N[(y + x), $MachinePrecision], If[LessEqual[y, 2.15e+223], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{z - a}\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{+248}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+145}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+223}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.6000000000000002e248 or 2.15e223 < y Initial program 51.7%
Taylor expanded in x around 0 47.8%
Taylor expanded in t around 0 27.3%
associate-*l/60.2%
*-commutative60.2%
Simplified60.2%
if -7.6000000000000002e248 < y < 6.7999999999999998e145Initial program 90.0%
Taylor expanded in z around inf 65.1%
+-commutative65.1%
Simplified65.1%
if 6.7999999999999998e145 < y < 2.15e223Initial program 80.6%
Taylor expanded in x around 0 61.9%
Taylor expanded in z around 0 55.9%
associate-/l*50.0%
Simplified50.0%
associate-/r/55.9%
Applied egg-rr55.9%
Final simplification64.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.1e-49) (not (<= z 0.00066))) (+ x (* z (/ y (- z a)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e-49) || !(z <= 0.00066)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.1d-49)) .or. (.not. (z <= 0.00066d0))) then
tmp = x + (z * (y / (z - a)))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e-49) || !(z <= 0.00066)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.1e-49) or not (z <= 0.00066): tmp = x + (z * (y / (z - a))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.1e-49) || !(z <= 0.00066)) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.1e-49) || ~((z <= 0.00066))) tmp = x + (z * (y / (z - a))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.1e-49], N[Not[LessEqual[z, 0.00066]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-49} \lor \neg \left(z \leq 0.00066\right):\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.1e-49 or 6.6e-4 < z Initial program 75.8%
Taylor expanded in t around 0 66.4%
+-commutative66.4%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
if -3.1e-49 < z < 6.6e-4Initial program 95.2%
Taylor expanded in z around 0 80.3%
+-commutative80.3%
associate-/l*81.7%
Simplified81.7%
associate-/r/35.3%
Applied egg-rr82.6%
*-commutative82.6%
clear-num82.6%
un-div-inv82.6%
Applied egg-rr82.6%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.9e-54) (+ x (* z (/ y (- z a)))) (if (<= z 3.4e-7) (+ x (/ y (/ a t))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-54) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 3.4e-7) {
tmp = x + (y / (a / t));
} 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 (z <= (-2.9d-54)) then
tmp = x + (z * (y / (z - a)))
else if (z <= 3.4d-7) then
tmp = x + (y / (a / t))
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 (z <= -2.9e-54) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 3.4e-7) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-54: tmp = x + (z * (y / (z - a))) elif z <= 3.4e-7: tmp = x + (y / (a / t)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e-54) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 3.4e-7) tmp = Float64(x + Float64(y / Float64(a / t))); 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 (z <= -2.9e-54) tmp = x + (z * (y / (z - a))); elseif (z <= 3.4e-7) tmp = x + (y / (a / t)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e-54], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-7], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-54}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-7}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -2.90000000000000015e-54Initial program 77.2%
Taylor expanded in t around 0 69.0%
+-commutative69.0%
associate-*l/85.6%
*-commutative85.6%
Simplified85.6%
if -2.90000000000000015e-54 < z < 3.39999999999999974e-7Initial program 95.2%
Taylor expanded in z around 0 80.3%
+-commutative80.3%
associate-/l*81.7%
Simplified81.7%
associate-/r/35.3%
Applied egg-rr82.6%
*-commutative82.6%
clear-num82.6%
un-div-inv82.6%
Applied egg-rr82.6%
if 3.39999999999999974e-7 < z Initial program 74.6%
Taylor expanded in a around 0 64.0%
+-commutative64.0%
associate-/l*86.6%
Simplified86.6%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.7e-49) (+ x (* z (/ y (- z a)))) (if (<= z 5.5e-7) (- x (/ y (/ a (- z t)))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e-49) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 5.5e-7) {
tmp = x - (y / (a / (z - t)));
} 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 (z <= (-1.7d-49)) then
tmp = x + (z * (y / (z - a)))
else if (z <= 5.5d-7) then
tmp = x - (y / (a / (z - t)))
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 (z <= -1.7e-49) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 5.5e-7) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e-49: tmp = x + (z * (y / (z - a))) elif z <= 5.5e-7: tmp = x - (y / (a / (z - t))) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e-49) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 5.5e-7) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); 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 (z <= -1.7e-49) tmp = x + (z * (y / (z - a))); elseif (z <= 5.5e-7) tmp = x - (y / (a / (z - t))); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e-49], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-7], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-49}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-7}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -1.70000000000000002e-49Initial program 77.2%
Taylor expanded in t around 0 69.0%
+-commutative69.0%
associate-*l/85.6%
*-commutative85.6%
Simplified85.6%
if -1.70000000000000002e-49 < z < 5.5000000000000003e-7Initial program 95.2%
Taylor expanded in a around inf 82.9%
mul-1-neg82.9%
unsub-neg82.9%
associate-/l*85.3%
Simplified85.3%
if 5.5000000000000003e-7 < z Initial program 74.6%
Taylor expanded in a around 0 64.0%
+-commutative64.0%
associate-/l*86.6%
Simplified86.6%
Final simplification85.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- z a))))
(if (<= z -1.2e-49)
(+ x (* z t_1))
(if (<= z 1160.0) (- x (* t t_1)) (+ x (/ y (/ z (- z t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (z - a);
double tmp;
if (z <= -1.2e-49) {
tmp = x + (z * t_1);
} else if (z <= 1160.0) {
tmp = x - (t * t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = y / (z - a)
if (z <= (-1.2d-49)) then
tmp = x + (z * t_1)
else if (z <= 1160.0d0) then
tmp = x - (t * t_1)
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 t_1 = y / (z - a);
double tmp;
if (z <= -1.2e-49) {
tmp = x + (z * t_1);
} else if (z <= 1160.0) {
tmp = x - (t * t_1);
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (z - a) tmp = 0 if z <= -1.2e-49: tmp = x + (z * t_1) elif z <= 1160.0: tmp = x - (t * t_1) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(z - a)) tmp = 0.0 if (z <= -1.2e-49) tmp = Float64(x + Float64(z * t_1)); elseif (z <= 1160.0) tmp = Float64(x - Float64(t * t_1)); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (z - a); tmp = 0.0; if (z <= -1.2e-49) tmp = x + (z * t_1); elseif (z <= 1160.0) tmp = x - (t * t_1); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e-49], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1160.0], N[(x - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z - a}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{-49}:\\
\;\;\;\;x + z \cdot t_1\\
\mathbf{elif}\;z \leq 1160:\\
\;\;\;\;x - t \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -1.19999999999999996e-49Initial program 77.2%
Taylor expanded in t around 0 69.0%
+-commutative69.0%
associate-*l/85.6%
*-commutative85.6%
Simplified85.6%
if -1.19999999999999996e-49 < z < 1160Initial program 95.2%
Taylor expanded in t around inf 90.2%
mul-1-neg90.2%
associate-*r/91.1%
distribute-rgt-neg-in91.1%
distribute-neg-frac91.1%
Simplified91.1%
if 1160 < z Initial program 74.6%
Taylor expanded in a around 0 64.0%
+-commutative64.0%
associate-/l*86.6%
Simplified86.6%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-48) (not (<= z 1.7e-6))) (+ y x) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-48) || !(z <= 1.7e-6)) {
tmp = y + x;
} 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 <= (-8d-48)) .or. (.not. (z <= 1.7d-6))) then
tmp = y + x
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 <= -8e-48) || !(z <= 1.7e-6)) {
tmp = y + x;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-48) or not (z <= 1.7e-6): tmp = y + x else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-48) || !(z <= 1.7e-6)) tmp = Float64(y + x); 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 <= -8e-48) || ~((z <= 1.7e-6))) tmp = y + x; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-48], N[Not[LessEqual[z, 1.7e-6]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-48} \lor \neg \left(z \leq 1.7 \cdot 10^{-6}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -7.9999999999999998e-48 or 1.70000000000000003e-6 < z Initial program 75.8%
Taylor expanded in z around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -7.9999999999999998e-48 < z < 1.70000000000000003e-6Initial program 95.2%
Taylor expanded in z around 0 80.3%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e-51) (not (<= z 90.0))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e-51) || !(z <= 90.0)) {
tmp = y + x;
} 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.8d-51)) .or. (.not. (z <= 90.0d0))) then
tmp = y + x
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.8e-51) || !(z <= 90.0)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e-51) or not (z <= 90.0): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e-51) || !(z <= 90.0)) tmp = Float64(y + x); 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.8e-51) || ~((z <= 90.0))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e-51], N[Not[LessEqual[z, 90.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-51} \lor \neg \left(z \leq 90\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.8e-51 or 90 < z Initial program 75.8%
Taylor expanded in z around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -1.8e-51 < z < 90Initial program 95.2%
Taylor expanded in z around 0 80.3%
+-commutative80.3%
associate-/l*81.7%
Simplified81.7%
associate-/r/35.3%
Applied egg-rr82.6%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e-48) (not (<= z 1.56))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-48) || !(z <= 1.56)) {
tmp = y + x;
} 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 <= (-3.5d-48)) .or. (.not. (z <= 1.56d0))) then
tmp = y + x
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 <= -3.5e-48) || !(z <= 1.56)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e-48) or not (z <= 1.56): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e-48) || !(z <= 1.56)) tmp = Float64(y + x); 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 <= -3.5e-48) || ~((z <= 1.56))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e-48], N[Not[LessEqual[z, 1.56]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-48} \lor \neg \left(z \leq 1.56\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.49999999999999991e-48 or 1.5600000000000001 < z Initial program 75.8%
Taylor expanded in z around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -3.49999999999999991e-48 < z < 1.5600000000000001Initial program 95.2%
Taylor expanded in z around 0 80.3%
+-commutative80.3%
associate-/l*81.7%
Simplified81.7%
associate-/r/35.3%
Applied egg-rr82.6%
*-commutative82.6%
clear-num82.6%
un-div-inv82.6%
Applied egg-rr82.6%
Final simplification78.0%
(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 85.1%
*-commutative85.1%
associate-*l/98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.7e+223) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.7e+223) {
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 (z <= (-7.7d+223)) 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 (z <= -7.7e+223) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.7e+223: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.7e+223) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.7e+223) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.7e+223], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.7 \cdot 10^{+223}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.6999999999999999e223Initial program 37.3%
Taylor expanded in x around 0 15.4%
Taylor expanded in z around inf 78.1%
if -7.6999999999999999e223 < z Initial program 86.9%
Taylor expanded in x around inf 50.6%
Final simplification51.5%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 85.1%
Taylor expanded in z around inf 59.0%
+-commutative59.0%
Simplified59.0%
Final simplification59.0%
(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 85.1%
Taylor expanded in x around inf 49.6%
Final simplification49.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 2024021
(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))))