
(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 12 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 -1.12e+14)
(+ y x)
(if (<= t -9.2e-122)
(+ x (/ (* y z) a))
(if (<= t -1.4e-131)
(- x (* z (/ y t)))
(if (<= t 920.0) (+ x (* z (/ y a))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.12e+14) {
tmp = y + x;
} else if (t <= -9.2e-122) {
tmp = x + ((y * z) / a);
} else if (t <= -1.4e-131) {
tmp = x - (z * (y / t));
} else if (t <= 920.0) {
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 <= (-1.12d+14)) then
tmp = y + x
else if (t <= (-9.2d-122)) then
tmp = x + ((y * z) / a)
else if (t <= (-1.4d-131)) then
tmp = x - (z * (y / t))
else if (t <= 920.0d0) 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 <= -1.12e+14) {
tmp = y + x;
} else if (t <= -9.2e-122) {
tmp = x + ((y * z) / a);
} else if (t <= -1.4e-131) {
tmp = x - (z * (y / t));
} else if (t <= 920.0) {
tmp = x + (z * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.12e+14: tmp = y + x elif t <= -9.2e-122: tmp = x + ((y * z) / a) elif t <= -1.4e-131: tmp = x - (z * (y / t)) elif t <= 920.0: tmp = x + (z * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.12e+14) tmp = Float64(y + x); elseif (t <= -9.2e-122) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= -1.4e-131) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 920.0) 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 <= -1.12e+14) tmp = y + x; elseif (t <= -9.2e-122) tmp = x + ((y * z) / a); elseif (t <= -1.4e-131) tmp = x - (z * (y / t)); elseif (t <= 920.0) tmp = x + (z * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.12e+14], N[(y + x), $MachinePrecision], If[LessEqual[t, -9.2e-122], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.4e-131], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 920.0], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+14}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-131}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 920:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.12e14 or 920 < t Initial program 99.9%
Taylor expanded in t around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -1.12e14 < t < -9.20000000000000028e-122Initial program 96.1%
Taylor expanded in t around 0 85.2%
if -9.20000000000000028e-122 < t < -1.4e-131Initial program 88.6%
Taylor expanded in z around inf 75.2%
associate-/l*74.2%
Simplified74.2%
Taylor expanded in a around 0 65.4%
mul-1-neg65.4%
unsub-neg65.4%
associate-/l*54.1%
Simplified54.1%
associate-/r/65.0%
Applied egg-rr65.0%
if -1.4e-131 < t < 920Initial program 96.9%
Taylor expanded in z around inf 86.8%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.6%
Applied egg-rr91.6%
Taylor expanded in a around inf 82.6%
Final simplification83.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5000000000.0)
(+ y x)
(if (<= t -2.8e-122)
(+ x (/ (* y z) a))
(if (<= t -1.35e-131)
(- x (/ (* y z) t))
(if (<= t 6000.0) (+ x (* z (/ y a))) (+ y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5000000000.0) {
tmp = y + x;
} else if (t <= -2.8e-122) {
tmp = x + ((y * z) / a);
} else if (t <= -1.35e-131) {
tmp = x - ((y * z) / t);
} else if (t <= 6000.0) {
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 <= (-5000000000.0d0)) then
tmp = y + x
else if (t <= (-2.8d-122)) then
tmp = x + ((y * z) / a)
else if (t <= (-1.35d-131)) then
tmp = x - ((y * z) / t)
else if (t <= 6000.0d0) 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 <= -5000000000.0) {
tmp = y + x;
} else if (t <= -2.8e-122) {
tmp = x + ((y * z) / a);
} else if (t <= -1.35e-131) {
tmp = x - ((y * z) / t);
} else if (t <= 6000.0) {
tmp = x + (z * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5000000000.0: tmp = y + x elif t <= -2.8e-122: tmp = x + ((y * z) / a) elif t <= -1.35e-131: tmp = x - ((y * z) / t) elif t <= 6000.0: tmp = x + (z * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5000000000.0) tmp = Float64(y + x); elseif (t <= -2.8e-122) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= -1.35e-131) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (t <= 6000.0) 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 <= -5000000000.0) tmp = y + x; elseif (t <= -2.8e-122) tmp = x + ((y * z) / a); elseif (t <= -1.35e-131) tmp = x - ((y * z) / t); elseif (t <= 6000.0) tmp = x + (z * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[t, -2.8e-122], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-131], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6000.0], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-131}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 6000:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -5e9 or 6e3 < t Initial program 99.9%
Taylor expanded in t around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -5e9 < t < -2.7999999999999999e-122Initial program 96.1%
Taylor expanded in t around 0 85.2%
if -2.7999999999999999e-122 < t < -1.35000000000000011e-131Initial program 88.6%
Taylor expanded in z around inf 75.2%
associate-/l*74.2%
Simplified74.2%
Taylor expanded in a around 0 65.4%
mul-1-neg65.4%
unsub-neg65.4%
associate-/l*54.1%
Simplified54.1%
Taylor expanded in y around 0 65.4%
if -1.35000000000000011e-131 < t < 6e3Initial program 96.9%
Taylor expanded in z around inf 86.8%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.6%
Applied egg-rr91.6%
Taylor expanded in a around inf 82.6%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -150000000000.0) (not (<= t 105000000000.0))) (+ y x) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -150000000000.0) || !(t <= 105000000000.0)) {
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 <= (-150000000000.0d0)) .or. (.not. (t <= 105000000000.0d0))) 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 <= -150000000000.0) || !(t <= 105000000000.0)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -150000000000.0) or not (t <= 105000000000.0): tmp = y + x else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -150000000000.0) || !(t <= 105000000000.0)) 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 <= -150000000000.0) || ~((t <= 105000000000.0))) tmp = y + x; else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -150000000000.0], N[Not[LessEqual[t, 105000000000.0]], $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 -150000000000 \lor \neg \left(t \leq 105000000000\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -1.5e11 or 1.05e11 < t Initial program 99.9%
Taylor expanded in t around inf 86.7%
+-commutative86.7%
Simplified86.7%
if -1.5e11 < t < 1.05e11Initial program 96.2%
Taylor expanded in a around inf 79.0%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -350000000000.0) (not (<= t 5600000000.0))) (+ y x) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -350000000000.0) || !(t <= 5600000000.0)) {
tmp = y + x;
} else {
tmp = x + ((z - t) * (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 <= (-350000000000.0d0)) .or. (.not. (t <= 5600000000.0d0))) then
tmp = y + x
else
tmp = x + ((z - t) * (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 <= -350000000000.0) || !(t <= 5600000000.0)) {
tmp = y + x;
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -350000000000.0) or not (t <= 5600000000.0): tmp = y + x else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -350000000000.0) || !(t <= 5600000000.0)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -350000000000.0) || ~((t <= 5600000000.0))) tmp = y + x; else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -350000000000.0], N[Not[LessEqual[t, 5600000000.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -350000000000 \lor \neg \left(t \leq 5600000000\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.5e11 or 5.6e9 < t Initial program 99.9%
Taylor expanded in t around inf 86.7%
+-commutative86.7%
Simplified86.7%
if -3.5e11 < t < 5.6e9Initial program 96.2%
associate-*r/94.9%
Simplified94.9%
associate-/l*96.9%
associate-/r/95.6%
Applied egg-rr95.6%
Taylor expanded in a around inf 80.5%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e+25) (not (<= t 2.8e+21))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+25) || !(t <= 2.8e+21)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4d+25)) .or. (.not. (t <= 2.8d+21))) then
tmp = y + x
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+25) || !(t <= 2.8e+21)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e+25) or not (t <= 2.8e+21): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e+25) || !(t <= 2.8e+21)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4e+25) || ~((t <= 2.8e+21))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e+25], N[Not[LessEqual[t, 2.8e+21]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+25} \lor \neg \left(t \leq 2.8 \cdot 10^{+21}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.00000000000000036e25 or 2.8e21 < t Initial program 99.9%
Taylor expanded in t around inf 86.7%
+-commutative86.7%
Simplified86.7%
if -4.00000000000000036e25 < t < 2.8e21Initial program 96.4%
Taylor expanded in z around inf 86.8%
associate-/l*89.0%
Simplified89.0%
associate-/r/90.1%
Applied egg-rr90.1%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2800000.0) (+ x (/ y (/ (- a t) z))) (if (<= z 1.58e+60) (- x (/ y (/ (- a t) t))) (+ x (/ (* y z) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2800000.0) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 1.58e+60) {
tmp = x - (y / ((a - t) / 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 (z <= (-2800000.0d0)) then
tmp = x + (y / ((a - t) / z))
else if (z <= 1.58d+60) then
tmp = x - (y / ((a - t) / 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 (z <= -2800000.0) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 1.58e+60) {
tmp = x - (y / ((a - t) / t));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2800000.0: tmp = x + (y / ((a - t) / z)) elif z <= 1.58e+60: tmp = x - (y / ((a - t) / t)) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2800000.0) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); elseif (z <= 1.58e+60) tmp = Float64(x - Float64(y / Float64(Float64(a - t) / t))); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2800000.0) tmp = x + (y / ((a - t) / z)); elseif (z <= 1.58e+60) tmp = x - (y / ((a - t) / t)); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2800000.0], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.58e+60], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2800000:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{elif}\;z \leq 1.58 \cdot 10^{+60}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if z < -2.8e6Initial program 99.8%
Taylor expanded in z around inf 79.6%
associate-/l*90.1%
Simplified90.1%
if -2.8e6 < z < 1.58e60Initial program 98.5%
Taylor expanded in z around 0 82.0%
mul-1-neg82.0%
unsub-neg82.0%
*-commutative82.0%
associate-/l*95.2%
Simplified95.2%
if 1.58e60 < z Initial program 94.0%
Taylor expanded in z around inf 88.4%
Final simplification92.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -54000000000000.0) (not (<= t 70.0))) (+ y x) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -54000000000000.0) || !(t <= 70.0)) {
tmp = y + x;
} 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 <= (-54000000000000.0d0)) .or. (.not. (t <= 70.0d0))) then
tmp = y + x
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 <= -54000000000000.0) || !(t <= 70.0)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -54000000000000.0) or not (t <= 70.0): tmp = y + x else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -54000000000000.0) || !(t <= 70.0)) tmp = Float64(y + x); 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 <= -54000000000000.0) || ~((t <= 70.0))) tmp = y + x; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -54000000000000.0], N[Not[LessEqual[t, 70.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -54000000000000 \lor \neg \left(t \leq 70\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -5.4e13 or 70 < t Initial program 99.9%
Taylor expanded in t around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -5.4e13 < t < 70Initial program 96.1%
Taylor expanded in t around 0 77.3%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e+14) (not (<= t 470.0))) (+ y x) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e+14) || !(t <= 470.0)) {
tmp = y + x;
} 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 <= (-3d+14)) .or. (.not. (t <= 470.0d0))) then
tmp = y + x
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 <= -3e+14) || !(t <= 470.0)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e+14) or not (t <= 470.0): tmp = y + x else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e+14) || !(t <= 470.0)) tmp = Float64(y + x); 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 <= -3e+14) || ~((t <= 470.0))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e+14], N[Not[LessEqual[t, 470.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+14} \lor \neg \left(t \leq 470\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3e14 or 470 < t Initial program 99.9%
Taylor expanded in t around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -3e14 < t < 470Initial program 96.1%
Taylor expanded in z around inf 86.7%
associate-/l*89.1%
Simplified89.1%
associate-/r/90.2%
Applied egg-rr90.2%
Taylor expanded in a around inf 78.8%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.26e+92) x (if (<= a 1.4e+124) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.26e+92) {
tmp = x;
} else if (a <= 1.4e+124) {
tmp = y + x;
} 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 <= (-1.26d+92)) then
tmp = x
else if (a <= 1.4d+124) then
tmp = y + x
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 <= -1.26e+92) {
tmp = x;
} else if (a <= 1.4e+124) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.26e+92: tmp = x elif a <= 1.4e+124: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.26e+92) tmp = x; elseif (a <= 1.4e+124) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.26e+92) tmp = x; elseif (a <= 1.4e+124) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.26e+92], x, If[LessEqual[a, 1.4e+124], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.26 \cdot 10^{+92}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+124}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.26e92 or 1.4e124 < a Initial program 98.7%
Taylor expanded in x around inf 71.5%
if -1.26e92 < a < 1.4e124Initial program 97.7%
Taylor expanded in t around inf 70.5%
+-commutative70.5%
Simplified70.5%
Final simplification70.8%
(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 98.0%
Final simplification98.0%
(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.9%
Final simplification54.9%
(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 2024027
(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)))))