
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 97.7%
+-commutative97.7%
fma-define97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5e-56) (not (<= z 1.16e-52))) (+ x (* y (/ (- z t) z))) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5e-56) || !(z <= 1.16e-52)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t / (a / 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 <= (-5d-56)) .or. (.not. (z <= 1.16d-52))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (t / (a / 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 <= -5e-56) || !(z <= 1.16e-52)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5e-56) or not (z <= 1.16e-52): tmp = x + (y * ((z - t) / z)) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5e-56) || !(z <= 1.16e-52)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5e-56) || ~((z <= 1.16e-52))) tmp = x + (y * ((z - t) / z)); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5e-56], N[Not[LessEqual[z, 1.16e-52]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-56} \lor \neg \left(z \leq 1.16 \cdot 10^{-52}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -4.99999999999999997e-56 or 1.1599999999999999e-52 < z Initial program 99.9%
Taylor expanded in a around 0 83.7%
if -4.99999999999999997e-56 < z < 1.1599999999999999e-52Initial program 94.8%
Taylor expanded in z around 0 76.5%
+-commutative76.5%
associate-/l*81.5%
Simplified81.5%
clear-num81.5%
un-div-inv81.6%
Applied egg-rr81.6%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+111) (not (<= z 3.6e+19))) (+ x (* y (/ (- z t) z))) (- x (/ y (/ (- z a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+111) || !(z <= 3.6e+19)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - (y / ((z - 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.9d+111)) .or. (.not. (z <= 3.6d+19))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x - (y / ((z - 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.9e+111) || !(z <= 3.6e+19)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - (y / ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+111) or not (z <= 3.6e+19): tmp = x + (y * ((z - t) / z)) else: tmp = x - (y / ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+111) || !(z <= 3.6e+19)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+111) || ~((z <= 3.6e+19))) tmp = x + (y * ((z - t) / z)); else tmp = x - (y / ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+111], N[Not[LessEqual[z, 3.6e+19]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+111} \lor \neg \left(z \leq 3.6 \cdot 10^{+19}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\end{array}
\end{array}
if z < -1.89999999999999988e111 or 3.6e19 < z Initial program 100.0%
Taylor expanded in a around 0 92.3%
if -1.89999999999999988e111 < z < 3.6e19Initial program 96.3%
clear-num96.2%
un-div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in t around inf 83.4%
associate-*r/83.4%
neg-mul-183.4%
Simplified83.4%
Taylor expanded in z around 0 80.3%
+-commutative80.3%
mul-1-neg80.3%
sub-neg80.3%
div-sub83.4%
Simplified83.4%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5000000000.0) (not (<= t 4.5e-52))) (- x (/ y (/ (- z a) t))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5000000000.0) || !(t <= 4.5e-52)) {
tmp = x - (y / ((z - a) / 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 ((t <= (-5000000000.0d0)) .or. (.not. (t <= 4.5d-52))) then
tmp = x - (y / ((z - a) / 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 ((t <= -5000000000.0) || !(t <= 4.5e-52)) {
tmp = x - (y / ((z - a) / t));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5000000000.0) or not (t <= 4.5e-52): tmp = x - (y / ((z - a) / t)) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5000000000.0) || !(t <= 4.5e-52)) tmp = Float64(x - Float64(y / Float64(Float64(z - a) / 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 ((t <= -5000000000.0) || ~((t <= 4.5e-52))) tmp = x - (y / ((z - a) / t)); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5000000000.0], N[Not[LessEqual[t, 4.5e-52]], $MachinePrecision]], N[(x - N[(y / N[(N[(z - a), $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}\;t \leq -5000000000 \lor \neg \left(t \leq 4.5 \cdot 10^{-52}\right):\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -5e9 or 4.5e-52 < t Initial program 97.0%
clear-num96.9%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in t around inf 87.4%
associate-*r/87.4%
neg-mul-187.4%
Simplified87.4%
Taylor expanded in z around 0 84.4%
+-commutative84.4%
mul-1-neg84.4%
sub-neg84.4%
div-sub87.4%
Simplified87.4%
if -5e9 < t < 4.5e-52Initial program 98.5%
Taylor expanded in t around 0 82.9%
+-commutative82.9%
associate-/l*91.0%
Simplified91.0%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6000000000.0) (not (<= t 7.2e-68))) (- x (* t (/ y (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6000000000.0) || !(t <= 7.2e-68)) {
tmp = x - (t * (y / (z - a)));
} 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 ((t <= (-6000000000.0d0)) .or. (.not. (t <= 7.2d-68))) then
tmp = x - (t * (y / (z - a)))
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 ((t <= -6000000000.0) || !(t <= 7.2e-68)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6000000000.0) or not (t <= 7.2e-68): tmp = x - (t * (y / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6000000000.0) || !(t <= 7.2e-68)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); 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 ((t <= -6000000000.0) || ~((t <= 7.2e-68))) tmp = x - (t * (y / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6000000000.0], N[Not[LessEqual[t, 7.2e-68]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6000000000 \lor \neg \left(t \leq 7.2 \cdot 10^{-68}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -6e9 or 7.20000000000000015e-68 < t Initial program 97.0%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
associate-/l*89.1%
Simplified89.1%
if -6e9 < t < 7.20000000000000015e-68Initial program 98.5%
Taylor expanded in t around 0 82.9%
+-commutative82.9%
associate-/l*91.0%
Simplified91.0%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e-39) (not (<= z 1.1e+20))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-39) || !(z <= 1.1e+20)) {
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 <= (-4.8d-39)) .or. (.not. (z <= 1.1d+20))) 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 <= -4.8e-39) || !(z <= 1.1e+20)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e-39) or not (z <= 1.1e+20): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e-39) || !(z <= 1.1e+20)) 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 <= -4.8e-39) || ~((z <= 1.1e+20))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e-39], N[Not[LessEqual[z, 1.1e+20]], $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 -4.8 \cdot 10^{-39} \lor \neg \left(z \leq 1.1 \cdot 10^{+20}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.80000000000000031e-39 or 1.1e20 < z Initial program 99.9%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -4.80000000000000031e-39 < z < 1.1e20Initial program 95.6%
Taylor expanded in z around 0 69.9%
*-commutative69.9%
associate-/l*73.4%
Simplified73.4%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-38) (not (<= z 2.6e+22))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-38) || !(z <= 2.6e+22)) {
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 <= (-4.5d-38)) .or. (.not. (z <= 2.6d+22))) 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 <= -4.5e-38) || !(z <= 2.6e+22)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-38) or not (z <= 2.6e+22): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-38) || !(z <= 2.6e+22)) tmp = Float64(y + x); 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 <= -4.5e-38) || ~((z <= 2.6e+22))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-38], N[Not[LessEqual[z, 2.6e+22]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-38} \lor \neg \left(z \leq 2.6 \cdot 10^{+22}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.50000000000000009e-38 or 2.6e22 < z Initial program 99.9%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -4.50000000000000009e-38 < z < 2.6e22Initial program 95.6%
Taylor expanded in z around 0 69.9%
+-commutative69.9%
associate-/l*74.7%
Simplified74.7%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-40) (not (<= z 3.7e+18))) (+ y x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-40) || !(z <= 3.7e+18)) {
tmp = y + x;
} else {
tmp = x + (t / (a / 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 <= (-1.9d-40)) .or. (.not. (z <= 3.7d+18))) then
tmp = y + x
else
tmp = x + (t / (a / 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 <= -1.9e-40) || !(z <= 3.7e+18)) {
tmp = y + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e-40) or not (z <= 3.7e+18): tmp = y + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e-40) || !(z <= 3.7e+18)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e-40) || ~((z <= 3.7e+18))) tmp = y + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e-40], N[Not[LessEqual[z, 3.7e+18]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-40} \lor \neg \left(z \leq 3.7 \cdot 10^{+18}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.8999999999999999e-40 or 3.7e18 < z Initial program 99.9%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
Simplified79.5%
if -1.8999999999999999e-40 < z < 3.7e18Initial program 95.6%
Taylor expanded in z around 0 69.9%
+-commutative69.9%
associate-/l*74.7%
Simplified74.7%
clear-num74.8%
un-div-inv74.9%
Applied egg-rr74.9%
Final simplification77.1%
(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 97.7%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (if (<= a 15000000000.0) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 15000000000.0) {
tmp = y + x;
} 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 <= 15000000000.0d0) then
tmp = y + x
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 <= 15000000000.0) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 15000000000.0: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 15000000000.0) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 15000000000.0) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 15000000000.0], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 15000000000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.5e10Initial program 97.0%
Taylor expanded in z around inf 59.0%
+-commutative59.0%
Simplified59.0%
if 1.5e10 < a Initial program 99.9%
Taylor expanded in x around inf 64.0%
Final simplification60.2%
(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 97.7%
Taylor expanded in x around inf 47.6%
Final simplification47.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 2024082
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))