
(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 11 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 (fma y (/ (- z t) (- a t)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (a - t)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(a - t)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)
\end{array}
Initial program 98.0%
+-commutative98.0%
fma-def98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.8e+33)
(+ y x)
(if (<= t -1.15e-89)
(- x (/ y (/ t z)))
(if (or (<= t -2.05e-103) (not (<= t 2.05e+47)))
(+ y x)
(+ x (* y (/ (- z t) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+33) {
tmp = y + x;
} else if (t <= -1.15e-89) {
tmp = x - (y / (t / z));
} else if ((t <= -2.05e-103) || !(t <= 2.05e+47)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - 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 (t <= (-4.8d+33)) then
tmp = y + x
else if (t <= (-1.15d-89)) then
tmp = x - (y / (t / z))
else if ((t <= (-2.05d-103)) .or. (.not. (t <= 2.05d+47))) then
tmp = y + x
else
tmp = x + (y * ((z - 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 (t <= -4.8e+33) {
tmp = y + x;
} else if (t <= -1.15e-89) {
tmp = x - (y / (t / z));
} else if ((t <= -2.05e-103) || !(t <= 2.05e+47)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.8e+33: tmp = y + x elif t <= -1.15e-89: tmp = x - (y / (t / z)) elif (t <= -2.05e-103) or not (t <= 2.05e+47): tmp = y + x else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+33) tmp = Float64(y + x); elseif (t <= -1.15e-89) tmp = Float64(x - Float64(y / Float64(t / z))); elseif ((t <= -2.05e-103) || !(t <= 2.05e+47)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.8e+33) tmp = y + x; elseif (t <= -1.15e-89) tmp = x - (y / (t / z)); elseif ((t <= -2.05e-103) || ~((t <= 2.05e+47))) tmp = y + x; else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+33], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.15e-89], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.05e-103], N[Not[LessEqual[t, 2.05e+47]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+33}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-89}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-103} \lor \neg \left(t \leq 2.05 \cdot 10^{+47}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -4.8e33 or -1.15e-89 < t < -2.04999999999999998e-103 or 2.05000000000000005e47 < t Initial program 99.9%
Taylor expanded in t around inf 81.4%
+-commutative81.4%
Simplified81.4%
if -4.8e33 < t < -1.15e-89Initial program 93.6%
Taylor expanded in z around inf 81.9%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in a around 0 69.7%
mul-1-neg69.7%
unsub-neg69.7%
associate-/l*69.7%
Simplified69.7%
if -2.04999999999999998e-103 < t < 2.05000000000000005e47Initial program 97.1%
Taylor expanded in a around inf 84.3%
Final simplification81.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.1e+33)
(+ y x)
(if (<= t -1.3e-82)
(- x (/ y (/ t z)))
(if (<= t -2.05e-103)
(+ y x)
(if (<= t 3.2e-51) (+ x (/ y (/ a z))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+33) {
tmp = y + x;
} else if (t <= -1.3e-82) {
tmp = x - (y / (t / z));
} else if (t <= -2.05e-103) {
tmp = y + x;
} else if (t <= 3.2e-51) {
tmp = x + (y / (a / z));
} else {
tmp = y + 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 <= (-3.1d+33)) then
tmp = y + x
else if (t <= (-1.3d-82)) then
tmp = x - (y / (t / z))
else if (t <= (-2.05d-103)) then
tmp = y + x
else if (t <= 3.2d-51) then
tmp = x + (y / (a / z))
else
tmp = y + 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 <= -3.1e+33) {
tmp = y + x;
} else if (t <= -1.3e-82) {
tmp = x - (y / (t / z));
} else if (t <= -2.05e-103) {
tmp = y + x;
} else if (t <= 3.2e-51) {
tmp = x + (y / (a / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.1e+33: tmp = y + x elif t <= -1.3e-82: tmp = x - (y / (t / z)) elif t <= -2.05e-103: tmp = y + x elif t <= 3.2e-51: tmp = x + (y / (a / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e+33) tmp = Float64(y + x); elseif (t <= -1.3e-82) tmp = Float64(x - Float64(y / Float64(t / z))); elseif (t <= -2.05e-103) tmp = Float64(y + x); elseif (t <= 3.2e-51) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.1e+33) tmp = y + x; elseif (t <= -1.3e-82) tmp = x - (y / (t / z)); elseif (t <= -2.05e-103) tmp = y + x; elseif (t <= 3.2e-51) tmp = x + (y / (a / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e+33], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.3e-82], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.05e-103], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.2e-51], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+33}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-82}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-103}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-51}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.1e33 or -1.3e-82 < t < -2.04999999999999998e-103 or 3.2e-51 < t Initial program 99.2%
Taylor expanded in t around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -3.1e33 < t < -1.3e-82Initial program 93.6%
Taylor expanded in z around inf 81.9%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in a around 0 69.7%
mul-1-neg69.7%
unsub-neg69.7%
associate-/l*69.7%
Simplified69.7%
if -2.04999999999999998e-103 < t < 3.2e-51Initial program 97.7%
Taylor expanded in t around 0 80.1%
+-commutative80.1%
associate-/l*83.7%
Simplified83.7%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+160) (not (<= t 6e+204))) (+ y x) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+160) || !(t <= 6e+204)) {
tmp = y + x;
} 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 <= (-3.4d+160)) .or. (.not. (t <= 6d+204))) then
tmp = y + x
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 <= -3.4e+160) || !(t <= 6e+204)) {
tmp = y + x;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+160) or not (t <= 6e+204): tmp = y + x else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+160) || !(t <= 6e+204)) tmp = Float64(y + x); 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 <= -3.4e+160) || ~((t <= 6e+204))) tmp = y + x; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+160], N[Not[LessEqual[t, 6e+204]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+160} \lor \neg \left(t \leq 6 \cdot 10^{+204}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -3.4000000000000003e160 or 5.99999999999999965e204 < t Initial program 100.0%
Taylor expanded in t around inf 92.3%
+-commutative92.3%
Simplified92.3%
if -3.4000000000000003e160 < t < 5.99999999999999965e204Initial program 97.4%
Taylor expanded in z around inf 79.9%
associate-/l*83.8%
Simplified83.8%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+47) (not (<= t 1.15e-51))) (+ x (* (/ y t) (- t z))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+47) || !(t <= 1.15e-51)) {
tmp = x + ((y / t) * (t - 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 ((t <= (-9d+47)) .or. (.not. (t <= 1.15d-51))) then
tmp = x + ((y / t) * (t - 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 ((t <= -9e+47) || !(t <= 1.15e-51)) {
tmp = x + ((y / t) * (t - z));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+47) or not (t <= 1.15e-51): tmp = x + ((y / t) * (t - z)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+47) || !(t <= 1.15e-51)) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); 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 <= -9e+47) || ~((t <= 1.15e-51))) tmp = x + ((y / t) * (t - z)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+47], N[Not[LessEqual[t, 1.15e-51]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $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 -9 \cdot 10^{+47} \lor \neg \left(t \leq 1.15 \cdot 10^{-51}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -8.99999999999999958e47 or 1.15000000000000001e-51 < t Initial program 99.2%
Taylor expanded in a around 0 71.0%
mul-1-neg71.0%
unsub-neg71.0%
associate-/l*85.3%
associate-/r/83.8%
Simplified83.8%
if -8.99999999999999958e47 < t < 1.15000000000000001e-51Initial program 96.9%
Taylor expanded in z around inf 84.6%
associate-/l*88.6%
Simplified88.6%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.85e-32) (not (<= z 21000000000.0))) (+ x (/ y (/ (- a t) z))) (- x (/ y (/ (- a t) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e-32) || !(z <= 21000000000.0)) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (y / ((a - t) / 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 <= (-2.85d-32)) .or. (.not. (z <= 21000000000.0d0))) then
tmp = x + (y / ((a - t) / z))
else
tmp = x - (y / ((a - t) / 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 <= -2.85e-32) || !(z <= 21000000000.0)) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (y / ((a - t) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.85e-32) or not (z <= 21000000000.0): tmp = x + (y / ((a - t) / z)) else: tmp = x - (y / ((a - t) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.85e-32) || !(z <= 21000000000.0)) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.85e-32) || ~((z <= 21000000000.0))) tmp = x + (y / ((a - t) / z)); else tmp = x - (y / ((a - t) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.85e-32], N[Not[LessEqual[z, 21000000000.0]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{-32} \lor \neg \left(z \leq 21000000000\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\
\end{array}
\end{array}
if z < -2.8500000000000002e-32 or 2.1e10 < z Initial program 95.8%
Taylor expanded in z around inf 81.8%
associate-/l*88.8%
Simplified88.8%
if -2.8500000000000002e-32 < z < 2.1e10Initial program 99.9%
Taylor expanded in z around 0 83.6%
mul-1-neg83.6%
unsub-neg83.6%
*-commutative83.6%
associate-/l*93.2%
Simplified93.2%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.05e-103) (+ y x) (if (<= t 1.7e-52) (+ x (* z (/ y a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.05e-103) {
tmp = y + x;
} else if (t <= 1.7e-52) {
tmp = x + (z * (y / a));
} else {
tmp = y + 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 <= (-2.05d-103)) then
tmp = y + x
else if (t <= 1.7d-52) then
tmp = x + (z * (y / a))
else
tmp = y + 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 <= -2.05e-103) {
tmp = y + x;
} else if (t <= 1.7e-52) {
tmp = x + (z * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.05e-103: tmp = y + x elif t <= 1.7e-52: tmp = x + (z * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.05e-103) tmp = Float64(y + x); elseif (t <= 1.7e-52) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.05e-103) tmp = y + x; elseif (t <= 1.7e-52) tmp = x + (z * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.05e-103], N[(y + x), $MachinePrecision], If[LessEqual[t, 1.7e-52], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-103}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-52}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.04999999999999998e-103 or 1.70000000000000009e-52 < t Initial program 98.2%
Taylor expanded in t around inf 73.8%
+-commutative73.8%
Simplified73.8%
if -2.04999999999999998e-103 < t < 1.70000000000000009e-52Initial program 97.7%
Taylor expanded in t around 0 80.1%
+-commutative80.1%
associate-/l*83.7%
associate-/r/83.0%
Simplified83.0%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.05e-103) (+ y x) (if (<= t 3.4e-49) (+ x (/ y (/ a z))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.05e-103) {
tmp = y + x;
} else if (t <= 3.4e-49) {
tmp = x + (y / (a / z));
} else {
tmp = y + 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 <= (-2.05d-103)) then
tmp = y + x
else if (t <= 3.4d-49) then
tmp = x + (y / (a / z))
else
tmp = y + 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 <= -2.05e-103) {
tmp = y + x;
} else if (t <= 3.4e-49) {
tmp = x + (y / (a / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.05e-103: tmp = y + x elif t <= 3.4e-49: tmp = x + (y / (a / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.05e-103) tmp = Float64(y + x); elseif (t <= 3.4e-49) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.05e-103) tmp = y + x; elseif (t <= 3.4e-49) tmp = x + (y / (a / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.05e-103], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.4e-49], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-103}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.04999999999999998e-103 or 3.40000000000000005e-49 < t Initial program 98.2%
Taylor expanded in t around inf 73.8%
+-commutative73.8%
Simplified73.8%
if -2.04999999999999998e-103 < t < 3.40000000000000005e-49Initial program 97.7%
Taylor expanded in t around 0 80.1%
+-commutative80.1%
associate-/l*83.7%
Simplified83.7%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (a - t)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (a - t)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{a - t}
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -8e-125) (+ y x) (if (<= t 3.9e-58) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-125) {
tmp = y + x;
} else if (t <= 3.9e-58) {
tmp = x;
} else {
tmp = y + 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 <= (-8d-125)) then
tmp = y + x
else if (t <= 3.9d-58) then
tmp = x
else
tmp = y + 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 <= -8e-125) {
tmp = y + x;
} else if (t <= 3.9e-58) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8e-125: tmp = y + x elif t <= 3.9e-58: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8e-125) tmp = Float64(y + x); elseif (t <= 3.9e-58) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8e-125) tmp = y + x; elseif (t <= 3.9e-58) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8e-125], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.9e-58], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-125}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-58}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -8.0000000000000001e-125 or 3.89999999999999992e-58 < t Initial program 98.2%
Taylor expanded in t around inf 72.8%
+-commutative72.8%
Simplified72.8%
if -8.0000000000000001e-125 < t < 3.89999999999999992e-58Initial program 97.5%
Taylor expanded in x around inf 51.8%
Final simplification66.1%
(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.0%
Taylor expanded in x around inf 54.0%
Final simplification54.0%
(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 2023293
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(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)))))