
(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 10 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 (+ 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 98.4%
clear-num98.3%
un-div-inv99.0%
Applied egg-rr99.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.15) (not (<= z 7e-37))) (- x (* y (/ (- t z) z))) (+ x (/ y (/ a (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.15) || !(z <= 7e-37)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y / (a / (t - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-0.15d0)) .or. (.not. (z <= 7d-37))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + (y / (a / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.15) || !(z <= 7e-37)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y / (a / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.15) or not (z <= 7e-37): tmp = x - (y * ((t - z) / z)) else: tmp = x + (y / (a / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.15) || !(z <= 7e-37)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(y / Float64(a / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.15) || ~((z <= 7e-37))) tmp = x - (y * ((t - z) / z)); else tmp = x + (y / (a / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.15], N[Not[LessEqual[z, 7e-37]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.15 \lor \neg \left(z \leq 7 \cdot 10^{-37}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\end{array}
\end{array}
if z < -0.149999999999999994 or 7.0000000000000003e-37 < z Initial program 99.9%
Taylor expanded in a around 0 89.3%
if -0.149999999999999994 < z < 7.0000000000000003e-37Initial program 96.6%
clear-num96.6%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in a around inf 80.6%
mul-1-neg80.6%
unsub-neg80.6%
associate-/l*86.9%
Simplified86.9%
clear-num86.9%
un-div-inv87.8%
Applied egg-rr87.8%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5) (not (<= z 5.6e-37))) (- x (* y (/ (- t z) z))) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5) || !(z <= 5.6e-37)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y * ((t - 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 <= (-6.5d0)) .or. (.not. (z <= 5.6d-37))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + (y * ((t - 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 <= -6.5) || !(z <= 5.6e-37)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5) or not (z <= 5.6e-37): tmp = x - (y * ((t - z) / z)) else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5) || !(z <= 5.6e-37)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.5) || ~((z <= 5.6e-37))) tmp = x - (y * ((t - z) / z)); else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5], N[Not[LessEqual[z, 5.6e-37]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \lor \neg \left(z \leq 5.6 \cdot 10^{-37}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -6.5 or 5.6000000000000002e-37 < z Initial program 99.9%
Taylor expanded in a around 0 89.3%
if -6.5 < z < 5.6000000000000002e-37Initial program 96.6%
clear-num96.6%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in a around inf 80.6%
mul-1-neg80.6%
unsub-neg80.6%
associate-/l*86.9%
Simplified86.9%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e-15) (not (<= z 5e-37))) (- x (* y (/ (- t z) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e-15) || !(z <= 5e-37)) {
tmp = x - (y * ((t - z) / z));
} 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 <= (-4.2d-15)) .or. (.not. (z <= 5d-37))) then
tmp = x - (y * ((t - z) / z))
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 <= -4.2e-15) || !(z <= 5e-37)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e-15) or not (z <= 5e-37): tmp = x - (y * ((t - z) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e-15) || !(z <= 5e-37)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); 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 <= -4.2e-15) || ~((z <= 5e-37))) tmp = x - (y * ((t - z) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e-15], N[Not[LessEqual[z, 5e-37]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-15} \lor \neg \left(z \leq 5 \cdot 10^{-37}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.19999999999999962e-15 or 4.9999999999999997e-37 < z Initial program 99.9%
Taylor expanded in a around 0 88.7%
if -4.19999999999999962e-15 < z < 4.9999999999999997e-37Initial program 96.6%
clear-num96.5%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 85.0%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.135) (- x (* y (/ (- t z) z))) (if (<= z 1.4e-33) (- 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 (z <= -0.135) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 1.4e-33) {
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 (z <= (-0.135d0)) then
tmp = x - (y * ((t - z) / z))
else if (z <= 1.4d-33) 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 (z <= -0.135) {
tmp = x - (y * ((t - z) / z));
} else if (z <= 1.4e-33) {
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 z <= -0.135: tmp = x - (y * ((t - z) / z)) elif z <= 1.4e-33: 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 (z <= -0.135) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); elseif (z <= 1.4e-33) 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 (z <= -0.135) tmp = x - (y * ((t - z) / z)); elseif (z <= 1.4e-33) 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[LessEqual[z, -0.135], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-33], 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}\;z \leq -0.135:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-33}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -0.13500000000000001Initial program 100.0%
Taylor expanded in a around 0 93.3%
if -0.13500000000000001 < z < 1.4e-33Initial program 96.6%
Taylor expanded in t around inf 87.6%
mul-1-neg87.6%
associate-/l*89.5%
Simplified89.5%
if 1.4e-33 < z Initial program 99.9%
Taylor expanded in t around 0 66.4%
+-commutative66.4%
associate-/l*83.9%
Simplified83.9%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.0031) (not (<= z 7.5e-37))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0031) || !(z <= 7.5e-37)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-0.0031d0)) .or. (.not. (z <= 7.5d-37))) then
tmp = x + y
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0031) || !(z <= 7.5e-37)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.0031) or not (z <= 7.5e-37): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.0031) || !(z <= 7.5e-37)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.0031) || ~((z <= 7.5e-37))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.0031], N[Not[LessEqual[z, 7.5e-37]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0031 \lor \neg \left(z \leq 7.5 \cdot 10^{-37}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -0.00309999999999999989 or 7.5000000000000004e-37 < z Initial program 99.9%
Taylor expanded in z around inf 80.4%
+-commutative80.4%
Simplified80.4%
if -0.00309999999999999989 < z < 7.5000000000000004e-37Initial program 96.6%
clear-num96.5%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 85.0%
Final simplification82.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e-11) (not (<= z 9.2e-37))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e-11) || !(z <= 9.2e-37)) {
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 <= (-7.6d-11)) .or. (.not. (z <= 9.2d-37))) 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 <= -7.6e-11) || !(z <= 9.2e-37)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e-11) or not (z <= 9.2e-37): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e-11) || !(z <= 9.2e-37)) 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 <= -7.6e-11) || ~((z <= 9.2e-37))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e-11], N[Not[LessEqual[z, 9.2e-37]], $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 -7.6 \cdot 10^{-11} \lor \neg \left(z \leq 9.2 \cdot 10^{-37}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -7.5999999999999996e-11 or 9.1999999999999999e-37 < z Initial program 99.9%
Taylor expanded in z around inf 80.4%
+-commutative80.4%
Simplified80.4%
if -7.5999999999999996e-11 < z < 9.1999999999999999e-37Initial program 96.6%
Taylor expanded in z around 0 77.8%
*-commutative77.8%
associate-/l*84.1%
Simplified84.1%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e-119) (not (<= z 2.5e-37))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e-119) || !(z <= 2.5e-37)) {
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 <= (-6.8d-119)) .or. (.not. (z <= 2.5d-37))) 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 <= -6.8e-119) || !(z <= 2.5e-37)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e-119) or not (z <= 2.5e-37): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.8e-119) || !(z <= 2.5e-37)) 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 <= -6.8e-119) || ~((z <= 2.5e-37))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.8e-119], N[Not[LessEqual[z, 2.5e-37]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-119} \lor \neg \left(z \leq 2.5 \cdot 10^{-37}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.80000000000000047e-119 or 2.4999999999999999e-37 < z Initial program 99.9%
Taylor expanded in z around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -6.80000000000000047e-119 < z < 2.4999999999999999e-37Initial program 95.6%
Taylor expanded in x around inf 60.4%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
(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 98.4%
Taylor expanded in x around inf 53.4%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024086
(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)))))