
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\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) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ y (/ (- a t) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((a - t) / (t - z)));
}
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 / ((a - t) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((a - t) / (t - z)));
}
def code(x, y, z, t, a): return x - (y / ((a - t) / (t - z)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(a - t) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((a - t) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{a - t}{t - z}}
\end{array}
Initial program 99.5%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e-21) (not (<= z 7.5e-53))) (- x (/ y (/ (- t a) z))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e-21) || !(z <= 7.5e-53)) {
tmp = x - (y / ((t - a) / z));
} else {
tmp = x + (y * (t / (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 <= (-6.5d-21)) .or. (.not. (z <= 7.5d-53))) then
tmp = x - (y / ((t - a) / z))
else
tmp = x + (y * (t / (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 <= -6.5e-21) || !(z <= 7.5e-53)) {
tmp = x - (y / ((t - a) / z));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e-21) or not (z <= 7.5e-53): tmp = x - (y / ((t - a) / z)) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e-21) || !(z <= 7.5e-53)) tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.5e-21) || ~((z <= 7.5e-53))) tmp = x - (y / ((t - a) / z)); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e-21], N[Not[LessEqual[z, 7.5e-53]], $MachinePrecision]], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-21} \lor \neg \left(z \leq 7.5 \cdot 10^{-53}\right):\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -6.49999999999999987e-21 or 7.5000000000000001e-53 < z Initial program 99.1%
clear-num99.1%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 88.2%
if -6.49999999999999987e-21 < z < 7.5000000000000001e-53Initial program 100.0%
Taylor expanded in z around 0 84.1%
mul-1-neg84.1%
unsub-neg84.1%
*-commutative84.1%
associate-/l*96.1%
Simplified96.1%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.95e+120) (not (<= t 1.55e+89))) (- x (* y (+ (/ z t) -1.0))) (- x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.95e+120) || !(t <= 1.55e+89)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x - (y / ((t - a) / 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 ((t <= (-1.95d+120)) .or. (.not. (t <= 1.55d+89))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else
tmp = x - (y / ((t - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.95e+120) || !(t <= 1.55e+89)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.95e+120) or not (t <= 1.55e+89): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x - (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.95e+120) || !(t <= 1.55e+89)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); else tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.95e+120) || ~((t <= 1.55e+89))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x - (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.95e+120], N[Not[LessEqual[t, 1.55e+89]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+120} \lor \neg \left(t \leq 1.55 \cdot 10^{+89}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if t < -1.9499999999999999e120 or 1.55e89 < t Initial program 99.9%
Taylor expanded in a around 0 56.7%
mul-1-neg56.7%
unsub-neg56.7%
associate-/l*91.4%
div-sub91.4%
sub-neg91.4%
*-inverses91.4%
metadata-eval91.4%
Simplified91.4%
if -1.9499999999999999e120 < t < 1.55e89Initial program 99.3%
clear-num99.3%
un-div-inv99.3%
Applied egg-rr99.3%
Taylor expanded in z around inf 85.7%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+120) (not (<= t 6.2e+89))) (+ x y) (- x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+120) || !(t <= 6.2e+89)) {
tmp = x + y;
} else {
tmp = x - (y / ((t - a) / 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 ((t <= (-3.5d+120)) .or. (.not. (t <= 6.2d+89))) then
tmp = x + y
else
tmp = x - (y / ((t - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+120) || !(t <= 6.2e+89)) {
tmp = x + y;
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+120) or not (t <= 6.2e+89): tmp = x + y else: tmp = x - (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+120) || !(t <= 6.2e+89)) tmp = Float64(x + y); else tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.5e+120) || ~((t <= 6.2e+89))) tmp = x + y; else tmp = x - (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e+120], N[Not[LessEqual[t, 6.2e+89]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+120} \lor \neg \left(t \leq 6.2 \cdot 10^{+89}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if t < -3.50000000000000007e120 or 6.2e89 < t Initial program 99.9%
Taylor expanded in t around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -3.50000000000000007e120 < t < 6.2e89Initial program 99.3%
clear-num99.3%
un-div-inv99.3%
Applied egg-rr99.3%
Taylor expanded in z around inf 85.8%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e-10) (not (<= t 3.2e+89))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e-10) || !(t <= 3.2e+89)) {
tmp = x + y;
} else {
tmp = x + (y / (a / 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 ((t <= (-3.4d-10)) .or. (.not. (t <= 3.2d+89))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e-10) || !(t <= 3.2e+89)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e-10) or not (t <= 3.2e+89): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e-10) || !(t <= 3.2e+89)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e-10) || ~((t <= 3.2e+89))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e-10], N[Not[LessEqual[t, 3.2e+89]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-10} \lor \neg \left(t \leq 3.2 \cdot 10^{+89}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -3.40000000000000015e-10 or 3.19999999999999987e89 < t Initial program 99.9%
Taylor expanded in t around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -3.40000000000000015e-10 < t < 3.19999999999999987e89Initial program 99.2%
Taylor expanded in t around 0 74.7%
+-commutative74.7%
associate-/l*77.9%
Simplified77.9%
clear-num77.9%
un-div-inv78.6%
Applied egg-rr78.6%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.6e-13) (not (<= t 2.7e+89))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.6e-13) || !(t <= 2.7e+89)) {
tmp = x + y;
} else {
tmp = x + (y * (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 <= (-6.6d-13)) .or. (.not. (t <= 2.7d+89))) then
tmp = x + y
else
tmp = x + (y * (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 <= -6.6e-13) || !(t <= 2.7e+89)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.6e-13) or not (t <= 2.7e+89): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.6e-13) || !(t <= 2.7e+89)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.6e-13) || ~((t <= 2.7e+89))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.6e-13], N[Not[LessEqual[t, 2.7e+89]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{-13} \lor \neg \left(t \leq 2.7 \cdot 10^{+89}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -6.6000000000000001e-13 or 2.7e89 < t Initial program 99.9%
Taylor expanded in t around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -6.6000000000000001e-13 < t < 2.7e89Initial program 99.2%
Taylor expanded in t around 0 74.7%
+-commutative74.7%
associate-/l*77.9%
Simplified77.9%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-22) (not (<= t 6.2e+90))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-22) || !(t <= 6.2e+90)) {
tmp = x + y;
} else {
tmp = x + ((y * 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 <= (-2.2d-22)) .or. (.not. (t <= 6.2d+90))) then
tmp = x + y
else
tmp = x + ((y * 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 <= -2.2e-22) || !(t <= 6.2e+90)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-22) or not (t <= 6.2e+90): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-22) || !(t <= 6.2e+90)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e-22) || ~((t <= 6.2e+90))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-22], N[Not[LessEqual[t, 6.2e+90]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-22} \lor \neg \left(t \leq 6.2 \cdot 10^{+90}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.2000000000000001e-22 or 6.19999999999999977e90 < t Initial program 99.9%
Taylor expanded in t around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -2.2000000000000001e-22 < t < 6.19999999999999977e90Initial program 99.2%
Taylor expanded in t around 0 74.7%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e-103) (not (<= t 5.5e-132))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e-103) || !(t <= 5.5e-132)) {
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 ((t <= (-4.8d-103)) .or. (.not. (t <= 5.5d-132))) 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 ((t <= -4.8e-103) || !(t <= 5.5e-132)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e-103) or not (t <= 5.5e-132): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e-103) || !(t <= 5.5e-132)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e-103) || ~((t <= 5.5e-132))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e-103], N[Not[LessEqual[t, 5.5e-132]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-103} \lor \neg \left(t \leq 5.5 \cdot 10^{-132}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.8000000000000004e-103 or 5.4999999999999999e-132 < t Initial program 99.9%
Taylor expanded in t around inf 69.6%
+-commutative69.6%
Simplified69.6%
if -4.8000000000000004e-103 < t < 5.4999999999999999e-132Initial program 98.7%
Taylor expanded in x around inf 54.8%
Final simplification65.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 99.5%
(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 99.5%
Taylor expanded in x around inf 48.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024106
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))