
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 85.2%
associate-/l*96.9%
Simplified96.9%
clear-num96.6%
un-div-inv97.3%
Applied egg-rr97.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-14) (not (<= z 1.95e-70))) (+ x (* z (/ y (- a t)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-14) || !(z <= 1.95e-70)) {
tmp = x + (z * (y / (a - t)));
} 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 <= (-4.5d-14)) .or. (.not. (z <= 1.95d-70))) then
tmp = x + (z * (y / (a - t)))
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 <= -4.5e-14) || !(z <= 1.95e-70)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-14) or not (z <= 1.95e-70): tmp = x + (z * (y / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-14) || !(z <= 1.95e-70)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); 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 <= -4.5e-14) || ~((z <= 1.95e-70))) tmp = x + (z * (y / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-14], N[Not[LessEqual[z, 1.95e-70]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $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 -4.5 \cdot 10^{-14} \lor \neg \left(z \leq 1.95 \cdot 10^{-70}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -4.4999999999999998e-14 or 1.9500000000000001e-70 < z Initial program 85.9%
Taylor expanded in z around inf 84.2%
*-commutative84.2%
*-lft-identity84.2%
times-frac91.8%
/-rgt-identity91.8%
Simplified91.8%
if -4.4999999999999998e-14 < z < 1.9500000000000001e-70Initial program 84.1%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in z around 0 94.9%
neg-mul-194.9%
distribute-neg-frac294.9%
neg-sub094.9%
sub-neg94.9%
+-commutative94.9%
associate--r+94.9%
neg-sub094.9%
remove-double-neg94.9%
Simplified94.9%
Final simplification93.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.25e-13) (not (<= z 2.45e-70))) (+ x (* y (/ z (- a t)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.25e-13) || !(z <= 2.45e-70)) {
tmp = x + (y * (z / (a - t)));
} 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 <= (-2.25d-13)) .or. (.not. (z <= 2.45d-70))) then
tmp = x + (y * (z / (a - t)))
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 <= -2.25e-13) || !(z <= 2.45e-70)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.25e-13) or not (z <= 2.45e-70): tmp = x + (y * (z / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.25e-13) || !(z <= 2.45e-70)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); 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 <= -2.25e-13) || ~((z <= 2.45e-70))) tmp = x + (y * (z / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.25e-13], N[Not[LessEqual[z, 2.45e-70]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $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 -2.25 \cdot 10^{-13} \lor \neg \left(z \leq 2.45 \cdot 10^{-70}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -2.25e-13 or 2.45e-70 < z Initial program 85.9%
Taylor expanded in z around inf 84.2%
associate-/l*88.0%
Simplified88.0%
if -2.25e-13 < z < 2.45e-70Initial program 84.1%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in z around 0 94.9%
neg-mul-194.9%
distribute-neg-frac294.9%
neg-sub094.9%
sub-neg94.9%
+-commutative94.9%
associate--r+94.9%
neg-sub094.9%
remove-double-neg94.9%
Simplified94.9%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.6e-120) (not (<= t 1.45e+17))) (+ x (* y (/ t (- t a)))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.6e-120) || !(t <= 1.45e+17)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.6d-120)) .or. (.not. (t <= 1.45d+17))) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.6e-120) || !(t <= 1.45e+17)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.6e-120) or not (t <= 1.45e+17): tmp = x + (y * (t / (t - a))) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.6e-120) || !(t <= 1.45e+17)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.6e-120) || ~((t <= 1.45e+17))) tmp = x + (y * (t / (t - a))); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.6e-120], N[Not[LessEqual[t, 1.45e+17]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-120} \lor \neg \left(t \leq 1.45 \cdot 10^{+17}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.59999999999999973e-120 or 1.45e17 < t Initial program 75.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 85.0%
neg-mul-185.0%
distribute-neg-frac285.0%
neg-sub085.0%
sub-neg85.0%
+-commutative85.0%
associate--r+85.0%
neg-sub085.0%
remove-double-neg85.0%
Simplified85.0%
if -4.59999999999999973e-120 < t < 1.45e17Initial program 95.9%
associate-/l*95.2%
Simplified95.2%
associate-*r/95.9%
clear-num95.9%
Applied egg-rr95.9%
Taylor expanded in t around 0 79.8%
associate-/r*83.3%
Simplified83.3%
associate-/r/83.3%
clear-num83.3%
Applied egg-rr83.3%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e-85) (not (<= t 6.4e-105))) (+ x (* t (/ y (- t a)))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e-85) || !(t <= 6.4e-105)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.4d-85)) .or. (.not. (t <= 6.4d-105))) then
tmp = x + (t * (y / (t - a)))
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e-85) || !(t <= 6.4e-105)) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e-85) or not (t <= 6.4e-105): tmp = x + (t * (y / (t - a))) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e-85) || !(t <= 6.4e-105)) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.4e-85) || ~((t <= 6.4e-105))) tmp = x + (t * (y / (t - a))); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e-85], N[Not[LessEqual[t, 6.4e-105]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-85} \lor \neg \left(t \leq 6.4 \cdot 10^{-105}\right):\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.4000000000000001e-85 or 6.39999999999999962e-105 < t Initial program 78.1%
Taylor expanded in z around 0 66.6%
mul-1-neg66.6%
associate-/l*80.0%
distribute-rgt-neg-in80.0%
distribute-neg-frac280.0%
neg-sub080.0%
sub-neg80.0%
+-commutative80.0%
associate--r+80.0%
neg-sub080.0%
remove-double-neg80.0%
Simplified80.0%
if -2.4000000000000001e-85 < t < 6.39999999999999962e-105Initial program 96.0%
associate-/l*95.1%
Simplified95.1%
associate-*r/96.0%
clear-num96.0%
Applied egg-rr96.0%
Taylor expanded in t around 0 84.0%
associate-/r*87.3%
Simplified87.3%
associate-/r/87.3%
clear-num87.4%
Applied egg-rr87.4%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e+65) (not (<= t 7.5e+18))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+65) || !(t <= 7.5e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.6d+65)) .or. (.not. (t <= 7.5d+18))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+65) || !(t <= 7.5e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.6e+65) or not (t <= 7.5e+18): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+65) || !(t <= 7.5e+18)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.6e+65) || ~((t <= 7.5e+18))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+65], N[Not[LessEqual[t, 7.5e+18]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+65} \lor \neg \left(t \leq 7.5 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.60000000000000003e65 or 7.5e18 < t Initial program 68.3%
Taylor expanded in t around inf 75.1%
if -2.60000000000000003e65 < t < 7.5e18Initial program 96.1%
associate-/l*95.0%
Simplified95.0%
associate-*r/96.1%
clear-num96.1%
Applied egg-rr96.1%
Taylor expanded in t around 0 78.4%
associate-/r*81.7%
Simplified81.7%
associate-/r/81.7%
clear-num81.7%
Applied egg-rr81.7%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e+64) (not (<= t 5.5e+18))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e+64) || !(t <= 5.5e+18)) {
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 <= (-1.5d+64)) .or. (.not. (t <= 5.5d+18))) 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 <= -1.5e+64) || !(t <= 5.5e+18)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e+64) or not (t <= 5.5e+18): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e+64) || !(t <= 5.5e+18)) 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 <= -1.5e+64) || ~((t <= 5.5e+18))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.5e+64], N[Not[LessEqual[t, 5.5e+18]], $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 -1.5 \cdot 10^{+64} \lor \neg \left(t \leq 5.5 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.5000000000000001e64 or 5.5e18 < t Initial program 68.3%
Taylor expanded in t around inf 75.1%
if -1.5000000000000001e64 < t < 5.5e18Initial program 96.1%
Taylor expanded in t around 0 78.3%
associate-/l*79.9%
Simplified79.9%
Final simplification78.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 85.2%
associate-/l*96.9%
Simplified96.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 6.5e+57) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 6.5e+57) {
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 (a <= 6.5d+57) 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 (a <= 6.5e+57) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 6.5e+57: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 6.5e+57) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 6.5e+57) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 6.5e+57], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.5 \cdot 10^{+57}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 6.4999999999999997e57Initial program 84.0%
Taylor expanded in t around inf 60.5%
if 6.4999999999999997e57 < a Initial program 89.5%
Taylor expanded in a around 0 32.2%
mul-1-neg32.2%
associate-/l*34.0%
distribute-rgt-neg-in34.0%
distribute-frac-neg34.0%
neg-sub034.0%
sub-neg34.0%
+-commutative34.0%
associate--r+34.0%
neg-sub034.0%
remove-double-neg34.0%
Simplified34.0%
Taylor expanded in t around 0 35.1%
associate-*r/35.1%
associate-*r*35.1%
neg-mul-135.1%
Simplified35.1%
Taylor expanded in x around inf 71.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 85.2%
Taylor expanded in a around 0 54.9%
mul-1-neg54.9%
associate-/l*61.1%
distribute-rgt-neg-in61.1%
distribute-frac-neg61.1%
neg-sub061.1%
sub-neg61.1%
+-commutative61.1%
associate--r+61.1%
neg-sub061.1%
remove-double-neg61.1%
Simplified61.1%
Taylor expanded in t around 0 51.4%
associate-*r/51.4%
associate-*r*51.4%
neg-mul-151.4%
Simplified51.4%
Taylor expanded in x around inf 53.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024111
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))