
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (- y z) (/ t (- a z)) x))
double code(double x, double y, double z, double t, double a) {
return fma((y - z), (t / (a - z)), x);
}
function code(x, y, z, t, a) return fma(Float64(y - z), Float64(t / Float64(a - z)), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)
\end{array}
Initial program 85.3%
+-commutative85.3%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.5e+156)
(+ t x)
(if (<= t -2.25e+104)
(/ y (/ a t))
(if (<= t 1.5e+148) (+ t x) (* t (- 1.0 (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+156) {
tmp = t + x;
} else if (t <= -2.25e+104) {
tmp = y / (a / t);
} else if (t <= 1.5e+148) {
tmp = t + x;
} else {
tmp = t * (1.0 - (y / 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 <= (-5.5d+156)) then
tmp = t + x
else if (t <= (-2.25d+104)) then
tmp = y / (a / t)
else if (t <= 1.5d+148) then
tmp = t + x
else
tmp = t * (1.0d0 - (y / 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 <= -5.5e+156) {
tmp = t + x;
} else if (t <= -2.25e+104) {
tmp = y / (a / t);
} else if (t <= 1.5e+148) {
tmp = t + x;
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+156: tmp = t + x elif t <= -2.25e+104: tmp = y / (a / t) elif t <= 1.5e+148: tmp = t + x else: tmp = t * (1.0 - (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+156) tmp = Float64(t + x); elseif (t <= -2.25e+104) tmp = Float64(y / Float64(a / t)); elseif (t <= 1.5e+148) tmp = Float64(t + x); else tmp = Float64(t * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+156) tmp = t + x; elseif (t <= -2.25e+104) tmp = y / (a / t); elseif (t <= 1.5e+148) tmp = t + x; else tmp = t * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+156], N[(t + x), $MachinePrecision], If[LessEqual[t, -2.25e+104], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+148], N[(t + x), $MachinePrecision], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+156}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{+104}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+148}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if t < -5.5000000000000003e156 or -2.2499999999999999e104 < t < 1.50000000000000007e148Initial program 89.5%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 73.7%
if -5.5000000000000003e156 < t < -2.2499999999999999e104Initial program 84.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around 0 51.9%
Taylor expanded in x around 0 51.5%
associate-*l/59.2%
Simplified59.2%
*-commutative59.2%
clear-num59.2%
un-div-inv59.4%
Applied egg-rr59.4%
if 1.50000000000000007e148 < t Initial program 60.2%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in a around 0 32.7%
mul-1-neg32.7%
unsub-neg32.7%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in x around 0 32.7%
mul-1-neg32.7%
associate-/l*64.0%
div-sub64.0%
sub-neg64.0%
*-inverses64.0%
metadata-eval64.0%
distribute-rgt-neg-in64.0%
+-commutative64.0%
distribute-neg-in64.0%
metadata-eval64.0%
sub-neg64.0%
Simplified64.0%
Final simplification71.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e+120) (not (<= z 1.86e+74))) (+ t x) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e+120) || !(z <= 1.86e+74)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.9d+120)) .or. (.not. (z <= 1.86d+74))) then
tmp = t + x
else
tmp = x + ((y * t) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e+120) || !(z <= 1.86e+74)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e+120) or not (z <= 1.86e+74): tmp = t + x else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e+120) || !(z <= 1.86e+74)) tmp = Float64(t + x); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.9e+120) || ~((z <= 1.86e+74))) tmp = t + x; else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e+120], N[Not[LessEqual[z, 1.86e+74]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+120} \lor \neg \left(z \leq 1.86 \cdot 10^{+74}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -2.9000000000000001e120 or 1.85999999999999998e74 < z Initial program 63.0%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in z around inf 90.7%
if -2.9000000000000001e120 < z < 1.85999999999999998e74Initial program 97.1%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in y around inf 87.8%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-24) (not (<= z 1.11e-69))) (+ x (* t (/ z (- z a)))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-24) || !(z <= 1.11e-69)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-9d-24)) .or. (.not. (z <= 1.11d-69))) then
tmp = x + (t * (z / (z - a)))
else
tmp = x + ((y * t) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-24) || !(z <= 1.11e-69)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-24) or not (z <= 1.11e-69): tmp = x + (t * (z / (z - a))) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-24) || !(z <= 1.11e-69)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9e-24) || ~((z <= 1.11e-69))) tmp = x + (t * (z / (z - a))); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-24], N[Not[LessEqual[z, 1.11e-69]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-24} \lor \neg \left(z \leq 1.11 \cdot 10^{-69}\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -8.9999999999999995e-24 or 1.10999999999999999e-69 < z Initial program 74.9%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in y around 0 71.3%
mul-1-neg71.3%
unsub-neg71.3%
associate-/l*91.9%
Simplified91.9%
if -8.9999999999999995e-24 < z < 1.10999999999999999e-69Initial program 98.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around inf 95.8%
Final simplification93.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e-45) (not (<= z 1.05e+36))) (+ t x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e-45) || !(z <= 1.05e+36)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2d-45)) .or. (.not. (z <= 1.05d+36))) then
tmp = t + x
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e-45) || !(z <= 1.05e+36)) {
tmp = t + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e-45) or not (z <= 1.05e+36): tmp = t + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e-45) || !(z <= 1.05e+36)) tmp = Float64(t + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2e-45) || ~((z <= 1.05e+36))) tmp = t + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e-45], N[Not[LessEqual[z, 1.05e+36]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-45} \lor \neg \left(z \leq 1.05 \cdot 10^{+36}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.99999999999999997e-45 or 1.05000000000000002e36 < z Initial program 72.2%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around inf 81.8%
if -1.99999999999999997e-45 < z < 1.05000000000000002e36Initial program 98.5%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 87.5%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.95e+158) x (if (<= a 3.9e+134) (+ t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.95e+158) {
tmp = x;
} else if (a <= 3.9e+134) {
tmp = t + 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.95d+158)) then
tmp = x
else if (a <= 3.9d+134) then
tmp = t + 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.95e+158) {
tmp = x;
} else if (a <= 3.9e+134) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.95e+158: tmp = x elif a <= 3.9e+134: tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.95e+158) tmp = x; elseif (a <= 3.9e+134) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.95e+158) tmp = x; elseif (a <= 3.9e+134) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.95e+158], x, If[LessEqual[a, 3.9e+134], N[(t + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+158}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{+134}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.95e158 or 3.89999999999999983e134 < a Initial program 87.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 76.9%
if -1.95e158 < a < 3.89999999999999983e134Initial program 84.7%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in z around inf 67.7%
Final simplification69.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.6e+42) t (if (<= t 3.9e+122) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.6e+42) {
tmp = t;
} else if (t <= 3.9e+122) {
tmp = x;
} else {
tmp = 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 <= (-5.6d+42)) then
tmp = t
else if (t <= 3.9d+122) then
tmp = x
else
tmp = 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 <= -5.6e+42) {
tmp = t;
} else if (t <= 3.9e+122) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.6e+42: tmp = t elif t <= 3.9e+122: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.6e+42) tmp = t; elseif (t <= 3.9e+122) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.6e+42) tmp = t; elseif (t <= 3.9e+122) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.6e+42], t, If[LessEqual[t, 3.9e+122], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+42}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+122}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -5.5999999999999999e42 or 3.8999999999999999e122 < t Initial program 60.9%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in a around 0 30.6%
mul-1-neg30.6%
unsub-neg30.6%
associate-/l*64.2%
Simplified64.2%
Taylor expanded in x around 0 28.3%
mul-1-neg28.3%
associate-/l*59.6%
div-sub59.6%
sub-neg59.6%
*-inverses59.6%
metadata-eval59.6%
distribute-rgt-neg-in59.6%
+-commutative59.6%
distribute-neg-in59.6%
metadata-eval59.6%
sub-neg59.6%
Simplified59.6%
Taylor expanded in y around 0 41.9%
if -5.5999999999999999e42 < t < 3.8999999999999999e122Initial program 97.2%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 74.7%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ t (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * (t / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * (t / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (t / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 85.3%
associate-/l*98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 85.3%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in a around 0 56.9%
mul-1-neg56.9%
unsub-neg56.9%
associate-/l*67.8%
Simplified67.8%
Taylor expanded in x around 0 17.9%
mul-1-neg17.9%
associate-/l*29.1%
div-sub29.1%
sub-neg29.1%
*-inverses29.1%
metadata-eval29.1%
distribute-rgt-neg-in29.1%
+-commutative29.1%
distribute-neg-in29.1%
metadata-eval29.1%
sub-neg29.1%
Simplified29.1%
Taylor expanded in y around 0 21.0%
Final simplification21.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024066
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))