
(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 14 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) (- 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 97.7%
clear-num97.6%
un-div-inv97.7%
Applied egg-rr97.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.05e-70)
(+ x y)
(if (<= t 3.25e-83)
(+ x (/ y (/ a z)))
(if (<= t 4.5e+97) (- x (/ y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05e-70) {
tmp = x + y;
} else if (t <= 3.25e-83) {
tmp = x + (y / (a / z));
} else if (t <= 4.5e+97) {
tmp = x - (y / (t / z));
} else {
tmp = x + 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 (t <= (-1.05d-70)) then
tmp = x + y
else if (t <= 3.25d-83) then
tmp = x + (y / (a / z))
else if (t <= 4.5d+97) then
tmp = x - (y / (t / z))
else
tmp = x + y
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.05e-70) {
tmp = x + y;
} else if (t <= 3.25e-83) {
tmp = x + (y / (a / z));
} else if (t <= 4.5e+97) {
tmp = x - (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.05e-70: tmp = x + y elif t <= 3.25e-83: tmp = x + (y / (a / z)) elif t <= 4.5e+97: tmp = x - (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.05e-70) tmp = Float64(x + y); elseif (t <= 3.25e-83) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 4.5e+97) tmp = Float64(x - Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.05e-70) tmp = x + y; elseif (t <= 3.25e-83) tmp = x + (y / (a / z)); elseif (t <= 4.5e+97) tmp = x - (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.05e-70], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.25e-83], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+97], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-70}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.25 \cdot 10^{-83}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+97}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.0500000000000001e-70 or 4.49999999999999976e97 < t Initial program 99.1%
Taylor expanded in t around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -1.0500000000000001e-70 < t < 3.25e-83Initial program 95.0%
Taylor expanded in t around 0 84.3%
+-commutative84.3%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.4%
Applied egg-rr85.4%
if 3.25e-83 < t < 4.49999999999999976e97Initial program 99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 86.7%
Taylor expanded in a around 0 79.4%
neg-mul-179.4%
distribute-neg-frac279.4%
Simplified79.4%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -9.5e-72)
(+ x y)
(if (<= t 2.9e-81)
(+ x (/ y (/ a z)))
(if (<= t 6.2e+97) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e-72) {
tmp = x + y;
} else if (t <= 2.9e-81) {
tmp = x + (y / (a / z));
} else if (t <= 6.2e+97) {
tmp = x - (y * (z / t));
} else {
tmp = x + 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 (t <= (-9.5d-72)) then
tmp = x + y
else if (t <= 2.9d-81) then
tmp = x + (y / (a / z))
else if (t <= 6.2d+97) then
tmp = x - (y * (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e-72) {
tmp = x + y;
} else if (t <= 2.9e-81) {
tmp = x + (y / (a / z));
} else if (t <= 6.2e+97) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.5e-72: tmp = x + y elif t <= 2.9e-81: tmp = x + (y / (a / z)) elif t <= 6.2e+97: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.5e-72) tmp = Float64(x + y); elseif (t <= 2.9e-81) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 6.2e+97) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.5e-72) tmp = x + y; elseif (t <= 2.9e-81) tmp = x + (y / (a / z)); elseif (t <= 6.2e+97) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.5e-72], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.9e-81], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+97], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-72}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+97}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -9.4999999999999998e-72 or 6.19999999999999962e97 < t Initial program 99.1%
Taylor expanded in t around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -9.4999999999999998e-72 < t < 2.89999999999999989e-81Initial program 95.0%
Taylor expanded in t around 0 84.3%
+-commutative84.3%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.4%
Applied egg-rr85.4%
if 2.89999999999999989e-81 < t < 6.19999999999999962e97Initial program 99.8%
Taylor expanded in z around inf 82.1%
Taylor expanded in a around 0 77.2%
mul-1-neg77.2%
unsub-neg77.2%
associate-/l*79.4%
Simplified79.4%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+74) (not (<= t 1.45e+99))) (+ x (* y (/ (- t z) t))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+74) || !(t <= 1.45e+99)) {
tmp = x + (y * ((t - z) / t));
} 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 ((t <= (-1.05d+74)) .or. (.not. (t <= 1.45d+99))) then
tmp = x + (y * ((t - z) / t))
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 ((t <= -1.05e+74) || !(t <= 1.45e+99)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+74) or not (t <= 1.45e+99): tmp = x + (y * ((t - z) / t)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+74) || !(t <= 1.45e+99)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+74) || ~((t <= 1.45e+99))) tmp = x + (y * ((t - z) / t)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+74], N[Not[LessEqual[t, 1.45e+99]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+74} \lor \neg \left(t \leq 1.45 \cdot 10^{+99}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.0499999999999999e74 or 1.4500000000000001e99 < t Initial program 99.9%
Taylor expanded in a around 0 62.5%
mul-1-neg62.5%
associate-/l*85.4%
distribute-rgt-neg-in85.4%
distribute-frac-neg85.4%
neg-sub085.4%
sub-neg85.4%
+-commutative85.4%
associate--r+85.4%
neg-sub085.4%
remove-double-neg85.4%
Simplified85.4%
if -1.0499999999999999e74 < t < 1.4500000000000001e99Initial program 96.3%
clear-num96.3%
un-div-inv96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 88.5%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e+82) (not (<= t 9.5e+96))) (+ x (* y (/ (- t z) t))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e+82) || !(t <= 9.5e+96)) {
tmp = x + (y * ((t - z) / t));
} 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 ((t <= (-1.9d+82)) .or. (.not. (t <= 9.5d+96))) then
tmp = x + (y * ((t - z) / t))
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 ((t <= -1.9e+82) || !(t <= 9.5e+96)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e+82) or not (t <= 9.5e+96): tmp = x + (y * ((t - z) / t)) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e+82) || !(t <= 9.5e+96)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.9e+82) || ~((t <= 9.5e+96))) tmp = x + (y * ((t - z) / t)); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.9e+82], N[Not[LessEqual[t, 9.5e+96]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+82} \lor \neg \left(t \leq 9.5 \cdot 10^{+96}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.90000000000000017e82 or 9.50000000000000089e96 < t Initial program 99.9%
Taylor expanded in a around 0 61.7%
mul-1-neg61.7%
associate-/l*85.0%
distribute-rgt-neg-in85.0%
distribute-frac-neg85.0%
neg-sub085.0%
sub-neg85.0%
+-commutative85.0%
associate--r+85.0%
neg-sub085.0%
remove-double-neg85.0%
Simplified85.0%
if -1.90000000000000017e82 < t < 9.50000000000000089e96Initial program 96.4%
Taylor expanded in z around inf 87.1%
associate-/l*88.5%
Simplified88.5%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e+82) (not (<= t 2.8e+182))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e+82) || !(t <= 2.8e+182)) {
tmp = x + y;
} 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 ((t <= (-2.3d+82)) .or. (.not. (t <= 2.8d+182))) then
tmp = x + y
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 ((t <= -2.3e+82) || !(t <= 2.8e+182)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e+82) or not (t <= 2.8e+182): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e+82) || !(t <= 2.8e+182)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.3e+82) || ~((t <= 2.8e+182))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e+82], N[Not[LessEqual[t, 2.8e+182]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+82} \lor \neg \left(t \leq 2.8 \cdot 10^{+182}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.29999999999999988e82 or 2.80000000000000006e182 < t Initial program 100.0%
Taylor expanded in t around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -2.29999999999999988e82 < t < 2.80000000000000006e182Initial program 96.8%
Taylor expanded in z around inf 81.6%
associate-/l*84.8%
Simplified84.8%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e-45) (+ x (/ y (/ (- a t) z))) (if (<= z 8.8e-48) (- x (/ y (+ (/ a t) -1.0))) (+ x (* y (/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e-45) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 8.8e-48) {
tmp = x - (y / ((a / t) + -1.0));
} 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 <= (-4.4d-45)) then
tmp = x + (y / ((a - t) / z))
else if (z <= 8.8d-48) then
tmp = x - (y / ((a / t) + (-1.0d0)))
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 <= -4.4e-45) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 8.8e-48) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e-45: tmp = x + (y / ((a - t) / z)) elif z <= 8.8e-48: tmp = x - (y / ((a / t) + -1.0)) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e-45) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); elseif (z <= 8.8e-48) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.4e-45) tmp = x + (y / ((a - t) / z)); elseif (z <= 8.8e-48) tmp = x - (y / ((a / t) + -1.0)); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e-45], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-48], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-45}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-48}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if z < -4.39999999999999987e-45Initial program 96.9%
clear-num96.8%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 87.5%
if -4.39999999999999987e-45 < z < 8.8000000000000005e-48Initial program 98.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 92.6%
mul-1-neg92.6%
div-sub92.6%
sub-neg92.6%
*-inverses92.6%
metadata-eval92.6%
Simplified92.6%
if 8.8000000000000005e-48 < z Initial program 97.4%
Taylor expanded in z around inf 85.7%
associate-/l*93.5%
Simplified93.5%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e-46) (+ x (/ y (/ (- a t) z))) (if (<= z 2.45e-48) (+ x (* y (/ t (- t a)))) (+ x (* y (/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-46) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 2.45e-48) {
tmp = x + (y * (t / (t - a)));
} 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 <= (-7.5d-46)) then
tmp = x + (y / ((a - t) / z))
else if (z <= 2.45d-48) then
tmp = x + (y * (t / (t - a)))
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 <= -7.5e-46) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 2.45e-48) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e-46: tmp = x + (y / ((a - t) / z)) elif z <= 2.45e-48: tmp = x + (y * (t / (t - a))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e-46) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); elseif (z <= 2.45e-48) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e-46) tmp = x + (y / ((a - t) / z)); elseif (z <= 2.45e-48) tmp = x + (y * (t / (t - a))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e-46], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-48], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-46}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-48}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if z < -7.50000000000000027e-46Initial program 96.9%
clear-num96.8%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 87.5%
if -7.50000000000000027e-46 < z < 2.4500000000000001e-48Initial program 98.3%
Taylor expanded in z around 0 80.7%
+-commutative80.7%
associate-*r/80.7%
mul-1-neg80.7%
distribute-lft-neg-out80.7%
*-commutative80.7%
*-lft-identity80.7%
times-frac92.5%
/-rgt-identity92.5%
distribute-neg-frac92.5%
distribute-neg-frac292.5%
neg-sub092.5%
sub-neg92.5%
+-commutative92.5%
associate--r+92.5%
neg-sub092.5%
remove-double-neg92.5%
Simplified92.5%
if 2.4500000000000001e-48 < z Initial program 97.4%
Taylor expanded in z around inf 85.7%
associate-/l*93.5%
Simplified93.5%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e-72) (not (<= t 4.8e-66))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-72) || !(t <= 4.8e-66)) {
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 <= (-2.7d-72)) .or. (.not. (t <= 4.8d-66))) 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 <= -2.7e-72) || !(t <= 4.8e-66)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e-72) or not (t <= 4.8e-66): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e-72) || !(t <= 4.8e-66)) 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 <= -2.7e-72) || ~((t <= 4.8e-66))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e-72], N[Not[LessEqual[t, 4.8e-66]], $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 -2.7 \cdot 10^{-72} \lor \neg \left(t \leq 4.8 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.7e-72 or 4.80000000000000052e-66 < t Initial program 99.3%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -2.7e-72 < t < 4.80000000000000052e-66Initial program 95.1%
Taylor expanded in t around 0 83.6%
+-commutative83.6%
associate-/l*84.6%
Simplified84.6%
clear-num84.6%
un-div-inv84.6%
Applied egg-rr84.6%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e-70) (not (<= t 4.2e-66))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e-70) || !(t <= 4.2e-66)) {
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 <= (-1d-70)) .or. (.not. (t <= 4.2d-66))) 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 <= -1e-70) || !(t <= 4.2e-66)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e-70) or not (t <= 4.2e-66): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e-70) || !(t <= 4.2e-66)) 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 <= -1e-70) || ~((t <= 4.2e-66))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e-70], N[Not[LessEqual[t, 4.2e-66]], $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 \cdot 10^{-70} \lor \neg \left(t \leq 4.2 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -9.99999999999999996e-71 or 4.2000000000000001e-66 < t Initial program 99.3%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -9.99999999999999996e-71 < t < 4.2000000000000001e-66Initial program 95.1%
Taylor expanded in t around 0 83.6%
+-commutative83.6%
associate-/l*84.6%
Simplified84.6%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.15e-70) (not (<= t 3.8e-66))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.15e-70) || !(t <= 3.8e-66)) {
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.15d-70)) .or. (.not. (t <= 3.8d-66))) 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.15e-70) || !(t <= 3.8e-66)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.15e-70) or not (t <= 3.8e-66): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.15e-70) || !(t <= 3.8e-66)) 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 <= -1.15e-70) || ~((t <= 3.8e-66))) 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.15e-70], N[Not[LessEqual[t, 3.8e-66]], $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 -1.15 \cdot 10^{-70} \lor \neg \left(t \leq 3.8 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.15e-70 or 3.7999999999999998e-66 < t Initial program 99.3%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -1.15e-70 < t < 3.7999999999999998e-66Initial program 95.1%
Taylor expanded in t around 0 83.6%
Final simplification73.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e-71) (not (<= t 5e-66))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e-71) || !(t <= 5e-66)) {
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 <= (-6d-71)) .or. (.not. (t <= 5d-66))) 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 <= -6e-71) || !(t <= 5e-66)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e-71) or not (t <= 5e-66): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e-71) || !(t <= 5e-66)) 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 <= -6e-71) || ~((t <= 5e-66))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6e-71], N[Not[LessEqual[t, 5e-66]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-71} \lor \neg \left(t \leq 5 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.0000000000000003e-71 or 4.99999999999999962e-66 < t Initial program 99.3%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -6.0000000000000003e-71 < t < 4.99999999999999962e-66Initial program 95.1%
Taylor expanded in x around inf 54.2%
Final simplification62.5%
(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 97.7%
(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 52.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 2024180
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))